Standard schema is a vocabulary for validating data.
npm install standardschema --save
import { schemaFromJSON } from 'standardschema'
const schema = schemaFromJSON({
'@type': 'Object',
'properties': [
{
'@type': 'Property',
'key': 'foo',
'value': { '@type': 'String' }
}
]
})
schema.isAssignable(schemaFromJSON({ '@type': 'Integer' })) //=> false
Apache 2.0