Skip to content

Latest commit

 

History

History
46 lines (35 loc) · 1.22 KB

README.md

File metadata and controls

46 lines (35 loc) · 1.22 KB

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