Package Exports
- joi-strict
- joi-strict/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (joi-strict) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
joi-strict
Thin wrapper around joi that defaults to stricter validation.
Install
Install with npm:
$ npm install --save joi-strictChanges from default
The following changes to the default joi behaviour were made:
- Every entry is required unless explicitly marked as optional().
- Unknown object keys are not allowed unless explicitly market unknown(true).
- Additional function
Joi.test(object, schema)to check if a schema matches an object - boolean() and number() automatically runs in strict() mode.
Usage
const Joi = require('joi-strict');
Joi.string().validate();
// => "value" is requiredFor more examples, please refer to the tests.
