Constrain a variable to a schema
var isSchema =val = 'hello world'ret;ret =;retvalid;// trueretvalue;// 'hello world'
$ npm install is-schema
is-schema uses is-validation to constrain the schema. All methods
Chain are available through the schema.
- val - The variable to constrain to a schema
- schema - The schema object describing what
valshould be. If
schemais a string, it will be treated as the schema's
type may be one of the following:
If a schema's property is an object, it will treat it as another schema for
- The order in which the variable is validated / manipulated against the schema cannot be defined.
Using the manipulation methods of
is-validationmay have unexpected results