contained
Checks if values are contained in a comparator array using deep equality.
RegExps and functions are evaluated rather than compared.
Comparators are run through until one evaluates true
.
Installation
npm install --save contained
var contained = ;
Usage
contained(array)
will return a checking function.
var checker = ; ; // true, 5 is in the array.; // true, the regexp evaluates true.; // false; // true. deeply matches a value.; // false; // true, the function returns true when passed 10.
checker.list
can be used to check multiple values and return a single boolean. All values must pass.
var checker = ;checker; // truechecker; // false
You can check values directly by passing it directly to contained
or contained.list
.
console; // trueconsole; // true