🤔 Strict compare an unsure array against a set of valid values to check if it's legit
$ npm install --save arr-u-legit
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']
Type: array
The unsure array in question.
Type: array
A set of valid options to compare against.
Type: bool
Default: false
A boolean flag to return the invalid items instead of a boolean result
MIT © Brandon Him