starry.filter

4.0.0 • Public • Published

Member of the starry suite—modular functions for iterable objects.

npm node

Status

Applies to the whole suite.

Build Status Coverage Status

Usage

function filter<T = any>(
  iterable: Iterable<T>,
  predicate: (item: T) => boolean = x => x as any
  ): Iterable<T>

Returns a new iterable that only contains the elements from iterable that satisfies predicate.

Parameters:

  • iterable: Iterable<T>
  • predicate: (T) => boolean. Default: x => x

Returns: Iterable<T>

Package Sidebar

Install

npm i starry.filter

Weekly Downloads

0

Version

4.0.0

License

MIT

Unpacked Size

5.64 kB

Total Files

9

Last publish

Collaborators

  • seangenabe