arr-u-legit
v0.2.0
Published
Strict compare an unsure array against a set of valid values to check if it's legit
Downloads
12
Maintainers
Readme
arr-u-legit
🤔 Strict compare an unsure array against a set of valid values to check if it's legit
Install
$ npm install --save arr-u-legit
Usage
const legit = require('arr-u-legit');
legit(['apple', 'banana'], ['apple', 'banana', 'orange']); // => true
legit(['apple', 'banana', 'pineapple'], ['apple', 'banana', 'orange']); // => false
// Show Invalid Items
legit(['apple', 'banana', 'chicken'], ['apple', 'banana', 'orange'], true); // => ['chicken']
API
legit(unsureArray, validOptions [, showItems])
unsureArray
Type: array
The unsure array in question.
validOptions
Type: array
A set of valid options to compare against.
showItems
Type: bool
Default: false
A boolean flag to return the invalid items instead of a boolean result
License
MIT © Brandon Him