@typed/filter
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@typed/filter

Well-typed filtering

Filter ArrayLike objects and Arrays, but also most.js Streams and Filterables!

Let me have it!

npm install --save @typed/filter

Usage

import { filter } from '@typed/filter';
import { from } from 'most';

const evens = filter(x => x % 2 === 0);

const array = [0, 1, 2, 3, 4];

evens(array) === [0, 2, 4];
evens(from(array)).observe(console.log) // 0, 2, 4

Types

export interface Filterable<A> {
  filter(predicate: (a: A) => boolean): Filterable<A>;
}

Readme

Keywords

Package Sidebar

Install

npm i @typed/filter

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • typed