GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - orinak/sqem

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
lib
lib
 
 
packages/dynamic-defaults
packages/dynamic-defaults
 
 
test
test
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
lerna.json
lerna.json
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

sqem

Cast data against JSON Schema with ajv

Install

npm install sqem

Usage

{
  "type": "object",
  "dynamicDefaults": {
    "id": "shortid"
  },
  "properties": {
    "name": { "type": "string" },
    "age": { "type": "number" }
  },
  "required": [
    "name"
  ],
  "additionalProperties": false
}
const cast = sqem(schema)

cast({ 
  name: 'Exo',
  age : '40',
  size: 2
})

// > Right { name: 'Exo', age: 40, id: 'f3ytunvu1' }

cast({ size: 2 })

// > Left { code: 422 }

API

cast :: S -> A -> Either E A

Params

  • schema - JSON Schema
  • input - Data to validate

License

MIT

About

No description, website, or topics provided.

Resources

Readme
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.