miller

Schema validator for objects. Best used as a sanity check for devs, and not to
validate user input (e.g. we're using throw).
Installation
$ npm i --save miller
Overview
var miller = require('miller');
var schema = miller({
code: 'number',
message: 'string'
});
schema({
code: 302,
message 'foo-bar'
});
API
miller(schema)
Create a validator based on a provided schema object. Input types can be
JavaScript primitives only.
var schema = miller({
foo: 'string',
bar: 'number'
});
miller()(input)
Check an object against the provided schema. If the schema doesn't match the
input throws a TypeError.
schema({
foo: 'bin',
bar: 123
});
License
MIT ©
Yoshua Wuyts