0.11.5 • Published 6 years ago

standardschema v0.11.5

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
6 years ago

Standard Schema

NPM version NPM downloads Build status Test coverage

Standard schema is a vocabulary for validating data.

Installation

npm install standardschema --save

Usage

import { schemaFromJSON } from 'standardschema'

const schema = schemaFromJSON({
  '@type': 'Object',
  'properties': [
    {
      '@type': 'Property',
      'key': 'foo',
      'value': { '@type': 'String' }
    }
  ]
})

schema.isAssignable(schemaFromJSON({ '@type': 'Integer' })) //=> false

License

Apache 2.0