Skip to content

Latest commit

 

History

History
49 lines (28 loc) · 1.14 KB

readme.md

File metadata and controls

49 lines (28 loc) · 1.14 KB

arr-u-legit Build Status Coverage Status

🤔 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