Field filter
npm install field-filter
Implements the partial response query filter method as seen here
Examples
var filter = ; var input = a: 'a' b: 'b' c: 'c'; var filterString = 'a,b'; ; a: 'a' b: 'b' var input = a: b: c: d: e: 'e' f: 'f' g: 'g' f: 'f' g: h: 'h' ; // () and / to sub-selectvar filterString = 'a( b/c( d/e ) , g)'; a: b: c: d: e: 'e' g: h: 'h' // wildcard *var input = a: b: c: 'c' d: 'd' e: c: 'c' f: 'f' g: h: i: 'i' j: 'j' k: i: 'i' j: 'j' m: 'm'; var filterString = 'a/*/c,g(*(i, j)),*'; a: b: c: 'c' e: c: 'c' g: h: i: 'i' j: 'j' k: i: 'i' j: 'j' m: 'm'); // array indexvar input = a: 'a' b: 'c' 'd' e: 'e' ; var filterString = '0(a,b/1)'; a: 'a' b: undefined 'd' );