@digitaledgeit/filter-chain

A simple filter chain for running multiple filters on an input value.

Stats

StarsIssuesVersionUpdatedCreatedSize
@digitaledgeit/filter-chain
0.3.06 years ago6 years agoMinified + gzip package size for @digitaledgeit/filter-chain in KB

Readme

filter-chain

A simple filter chain for running multiple filters on an input value.

Methods

FilterChain([filters])

Create a new filter chain from an array of filter functions.

.add(filter)

Add a filter function. Filter functions can be synchronous function(value) { return value; }, or asynchronous function(value, cb) { cb(value); }.

.filter(value, callback)

Run each filter on the value and then call the callback with the filtered value.

Example

See test/test.json

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.