uinix-fp-filter
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

uinix-fp-filter

Build Coverage Downloads Size

uinix-fp array filter utility.


Install

This package is ESM-only and requires Node 12+.

npm install uinix-fp-filter

Use

import {filter} from 'uinix-fp-filter';

const isEven = x => x % 2 === 0;

filter(isEven)([1, 2, 3, 4]); // [2, 4]

const filterIsEven = filter(isEven); // curried
filter([1, 2, 3, 4]); // [2, 4]

API

This package exports the following identifiers: filter. There is no default export.

filter(f)(xs)

Parameters (Curried)
  • f ((x: X) => boolean): The predicate function
  • xs (X[]): Any value
Returns
  • X[] — Array of filtered values passing the predicate test.

License

MIT © Chris Zhou

Package Sidebar

Install

npm i uinix-fp-filter

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

2.88 kB

Total Files

4

Last publish

Collaborators

  • chrisrzhou