https://github.com/brh55/arr-u-legit
🤔 Strict compare an unsure array against a set of valid values to check if it's legit
https://github.com/brh55/arr-u-legit
array-helper comparison nodejs strict-comparisons
Last synced: 22 days ago
JSON representation
🤔 Strict compare an unsure array against a set of valid values to check if it's legit
- Host: GitHub
- URL: https://github.com/brh55/arr-u-legit
- Owner: brh55
- License: mit
- Created: 2017-06-23T18:45:25.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-07T15:40:29.000Z (almost 9 years ago)
- Last Synced: 2025-07-09T14:49:32.725Z (11 months ago)
- Topics: array-helper, comparison, nodejs, strict-comparisons
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# arr-u-legit [](https://travis-ci.org/brh55/arr-u-legit) [](https://coveralls.io/github/brh55/arr-u-legit?branch=master)
> 🤔 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
```js
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](https://github.com/brh55/arr-u-legit)