1.0.1 • Published 3 months ago

array-where v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 months ago

Background

I often mix up the filtering of arrays because I put in what I want to filter out into the predicate, because that's what filtering should be.

So this library is purely to add a better named extension method that just forwards the parameters to the this.filter() so you don't need to worry about mixing it up again.

For further reading on the underlying .filter() functionality, see the MDN docs.

Install

Using NPM:

npm install array-where

Then, it can be imported with:

import 'array-where'

Usage

For flat values:

[1, 2, 3].where(x => x > 1)

For objects:

[{ value: 1 }, { value: 2 }, { value: 3 },].where(item => item.value > 1)

1.0.1

3 months ago

1.0.0

3 months ago

0.0.8

3 months ago

0.0.7

3 months ago

0.0.6

3 months ago

0.0.5

3 months ago

0.0.4

3 months ago

0.0.3

3 months ago

0.0.2

3 months ago

0.0.1

3 months ago

0.0.0

3 months ago