Nomnom Pumpernickle Muffins
Miss any of our Open RFC calls?Watch the recordings here! »

@rsql/builder

1.0.0 • Public • Published

@rsql/builder

API for building RSQL for Node.js and Browsers

npm lerna code style: prettier commitizen friendly tested with jest auto release

Installation

# with npm 
npm install --save @rsql/builder
 
# with yarn 
yarn add @rsql/builder

API

builder.comparison(selector, operator, value): ComparisonNode

Creates new ComparisonNode - similar to the createComparisonNode from the @rsql/ast but with simpler API (no need to create SelectorNode or ValueNode and accepts numbers as values)

builder.<operator>(selector, value): ComparisonNode

builder.eq(selector, value): ComparisonNode
builder.neq(selector, value): ComparisonNode
builder.le(selector, value): ComparisonNode
builder.lt(selector, value): ComparisonNode
builder.ge(selector, value): ComparisonNode
builder.gt(selector, value): ComparisonNode

Creates new ComparisonNode with the predefined operator for single value.

builder.<operator>(selector, values): ComparisonNode

builder.in(selector, values): ComparisonNode
builder.out(selector, values): ComparisonNode

Creates new ComparisonNode with the predefined operator for multiple values.

builder.logic(expressions, operator): LogicNode

Creates new LogicNode - similar to the createLogicNode from the @rsql/ast but with simpler API (accepts one or more expressions)

builder.<operator>(...expressions): LogicNode

builder.and(...expressions): LogicNode
builder.or(...expressions): LogicNode

Creates new LogicNode with the predefined operator for one or more expressions.

License

MIT

Install

npm i @rsql/builder

DownloadsWeekly Downloads

297

Version

1.0.0

License

MIT

Unpacked Size

20.7 kB

Total Files

8

Last publish

Collaborators

  • avatar