Skip to content

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

Notifications You must be signed in to change notification settings

digitaledgeit/js-filter-chain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published