@nib/validation-methods

Various methods for validating objects

Stats

StarsIssuesVersionUpdatedCreatedSize
@nib/validation-methods
011.2.15 years ago6 years agoMinified + gzip package size for @nib/validation-methods in KB

Readme

validation-methods

Build Status

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('foo@mail.com'); // 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

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.