npm.io
0.4.0 • Published 7 years ago

@kinday/njv

Licence
—
Version
0.4.0
Deps
2
Size
90 kB
Vulns
0
Weekly
0

njv

Work in progress! Nothing to see here!

Docs

Import:

import validate from 'njv'

Interface:

const schema = { type: 'number' }

console.log(validate(schema, 5))
// { valid: true, errors: [] }

console.log(validate(schema, 'invalid'))
// {
//   valid: false,
//   errors: [
//     {
//       absoluteInstancePath: [],
//       absoluteSchemaPath: ["type"],
//       context: undefined,
//       validator: 'type',
//       validatorValue: 'number',
//     }
//   ]
// }