Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

any

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

any

Returns `true` if a value exists in the given string, array or object.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24K
increased by12.44%
Maintainers
1
Weekly downloads
 
Created
Source

any NPM version Build Status

Returns true if a value exists in the given string, array or object.

  • if a callback is passed, checks to see if a truthy value is returned for any element in a collection or for any sub-string in a string.
  • returns as soon as it finds a passing value and does not iterate over the entire collection.

Install with npm

npm i any --save

Usage

var any = require('any');
any('a-b-c', 'a');
//=> true

any('a-b-c', 'd');
//=> false

any({a: 'b', c: 'd'}, 'a');
//=> true

any([{a: 'b', c: 'd'}], {a: 'b'});
//=> true

any('a-b-c', 'd');
//=> false

Running tests

Install dev dependencies.

npm i -d && npm test

Author

Jon Schlinkert

License

Copyright (c) 2015 Jon Schlinkert
Released under the MIT license


This file was generated by verb on February 26, 2015.

Keywords

FAQs

Package last updated on 27 Feb 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc