Socket
Socket
Sign inDemoInstall

@ndhoule/includes

Package Overview
Dependencies
2
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ndhoule/includes

Determine whether or not a value is contained by a given collection.


Version published
Maintainers
1
Created

Changelog

Source

2.0.1

  • Bump @ndhoule/each dependency to fix Browserify builds

Readme

Source

includes CI

Determine whether or not a value is contained by a given collection.

Uses SameValueZero (the algorithm used by Object.is) for equality comparisons.

Installation

$ component install ndhoule/includes
$ npm install @ndhoule/includes

API

includes(searchElement : *, collection : Object|Array|string) => boolean

includes(2, [1, 2, 3]);
//=> true

includes(4, [1, 2, 3]);
//=> false

includes(2, { a: 1, b: 2, c: 3 });
//=> true

includes('a', { a: 1, b: 2, c: 3 });
//=> false

includes('abc', 'xyzabc opq');
//=> true

includes('nope', 'xyzabc opq');
//=> false

License

Released under the MIT license.

Keywords

FAQs

Last updated on 02 May 2016

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc