JS wrapper for the QURI string specification
npm i -D quri
More information about the QURI specification and parser is available here.
Basic example
import Criteria from "quri";
let criteria = new Criteria();
criteria.toString(); // "field_1".eq("my value")
Nested example
let criteria = new Criteria();
criteria.appendExpression('field_1', '==', 'outer');
let nestedCriteria = new Criteria('or');
nestedCriteria.appendExpression('field_2', 'like', 'nested%');
nestedCriteria.appendExpression('field_3', 'in', [1,2,3,4]);
criteria.appendCriteria(nestedCriteria);
criteria.toString();
// "field_1".eq("outer"),("field_2".eq("nested%")|"field_3".in(1,2,3,4))
MIT © theHarvester