Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

joi-strict

blackflux2kMIT4.0.0

Thin wrapper around joi that defaults to stricter validation.

joi, strict, validation, extension, schema

readme

joi-strict

Build Status Test Coverage Dependabot Status Dependencies NPM Downloads Semantic-Release Gardener

Thin wrapper around joi that defaults to stricter validation.

Install

Install with npm:

$ npm install --save joi-strict

Changes 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 required

For more examples, please refer to the tests.