superfilter
A function to filter all the things. Utilizes heavy memoization to quickly filter JSON string / object / array data in flexible ways.
Install
npm install -S superfilter
Dependencies
none
Usage
const data = foo: 'bar' kung: fu: bar: 'foo' fuji: 1 2 coo: 'car' __type__: 'something' const print = console // { kung: { fu: { fuji: [ 2 ] } } }
Options
The third parameter an options object to tweak how you filter:
optionName | type | description |
---|---|---|
filterKeys |
undefined , Array<string> |
Only keys supplied will be used in filtering values. (undefined => filter on all keys) |
walkKeys |
undefined , Array<string> |
Only keys supplied will be used in recursive traversal. (undefined => walk all paths) |
insertMarks |
undefined , boolean |
Inserts <mark></mark> tags around matching text. |