Wondering what’s next for npm?Check out our public roadmap! »

@propero/easy-filterTypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Easy Filter

Maintainability Test Coverage

npm i @propero/easy-filter
# Or with yarn 
yarn add @propero/easy-filter

Documentation

In progress... maybe... hopefully... within the next decade or so... no guarantees though

Examples

For further examples check out the example directory.

import { FilterParser, and, gt, eq } from "@propero/easy-filter";
 
 
const parser = new FilterParser();
 
const parsed = parser.parse("and(lt(age,18),like(firstName,A%))");
/*
{
  "op": "and",
  "filters": [{
    "op": "lt",
    "field": "age",
    "value": "18"
  },{
    "op": "like",
    "field": "firstName",
    "value": "A%"
  }]
}
*/
const serialized = parser.serialize(and(gt("age", "21"), eq("name", "Peter,()")));
// and(gt(age,21),eq(name,Peter\,\(\)))

Install

npm i @propero/easy-filter

DownloadsWeekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

13 MB

Total Files

53

Last publish

Collaborators

  • avatar
  • avatar