Socket
Book a DemoInstallSign in
Socket

@iterables/any

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iterables/any

Return true if any element of an iterable matches.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

@iterables/any

Return true if any element of an iterable matches.

const any = require('@iterables/any')

any('abc', xs => xs === 'c') // true
any('abc', xs => xs === 'd') // false
any([null, false, '']) // false
any([null, false, {}]) // true

Installation

$ npm install --save @iterables/any

API

any(iterable, test = Boolean) -> Iterator

  • iterable: any Iterator — a generator instance, Array, Map, String, or Set
  • test: A function taking xs and returning a boolean value.

Returns true if any element matched test, or false if no element matched.

Stops consuming elements from iterable as soon as they pass test.

License

MIT

FAQs

Package last updated on 08 Apr 2017

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