Skip to content

🤔 Strict compare an unsure array against a set of valid values to check if it's legit

License

Notifications You must be signed in to change notification settings

brh55/arr-u-legit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

🤔 Strict compare an unsure array against a set of valid values to check if it's legit

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published