Socket
Book a DemoInstallSign in
Socket

@iterables/all

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iterables/all

Return true if all elements of an iterable match.

latest
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
3
-25%
Maintainers
1
Weekly downloads
 
Created
Source

@iterables/all

Return true if all elements of an iterable match.

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

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

Installation

$ npm install --save @iterables/all

API

all(iterable, test = Boolean) -> Iterator

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

Returns true if all elements matched test, or false if any element failed.

Stops consuming elements from iterable as soon as they fail 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