aql-parser
Parsing utility for AQL components.
Usage
npm install --save @ambassify/aql-parser
const aqlParser = require('@ambassify/aql-parser');
const fields = 'foo,bar,(baz,two)'
const condition = JSON.stringify({ key: 'foo', operator: 'eq', value: 1 });
const order = '-priority,id';
const url = [
'https://foo.bar/?fiels='
encodeURIComponent(fields),
'&condition=',
encodeURIComponent(condition),
'&order=',
encodeURIComponent(order),
].join('');
console.log(aqlParser.fields(fields));
console.log(aqlParser.condition(condition));
console.log(aqlParser.order(order));
console.log(aqlParser.url(url));