0.2.0 • Published 7 years ago

arr-u-legit v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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