Quri - Vivid Component
Convert javascript query arrays to the Quri PHP query format.
Supports all field expressions & logical operators in the Quri spec.
Installing
npm i --save @rexlabs/quri
yarn add @rexlabs/quri
Usage
// Import
import { toQuri } from '@rexlabs/quri';
// Create your query
const query = [
{
field: 'age',
op: '>',
value: 21
},
{
op: 'or',
value: [
{
field: 'name',
op: '==',
value: 'Fred'
}
]
}
];
// Convert to quri
const quri = toQuri(query); // age.gt(21),or(name.eq(Fred))
Development
Install dependencies
$ yarn
Available Commands
$ yarn test # runs all units tests
$ yarn test:watch # runs unit tests when files change
$ yarn build # bundles the package for production
Legal
Copyright (c) 2019 Rex Software All Rights Reserved.