Skip to content

nib-health-funds/validation-methods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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