@nib/validation-methods
v1.2.1
Published
Various methods for validating objects
Downloads
56
Maintainers
Readme
validation-methods
Various methods for validating objects
Installation
$ npm i @nib/validation-methods
API
var methods = require('validation-methods');
methods.required('foo'); // true
methods.equals(1,1); // true;
methods.email('[email protected]'); // true
methods.string(1); // false;
methods.number('string'); // false
Validating array contents
var validateSubsetOf = methods.isSubsetOf([1,2,3]);
validateSubsetOf([1]); // true
validateSubsetOf([1,3]); // true
validateSubsetOf([1,5]); // false
License
MIT