Socket
Socket
Sign inDemoInstall

arr-u-legit

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    arr-u-legit

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


Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 07 Jul 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc