UNPKG

@jsonquerylang/jsonquery

Version:

A small, flexible, and expandable JSON query language

18 lines 657 B
import type { JSONQuery, JSONQueryParseOptions } from './types'; /** * Parse a string containing a JSON Query into JSON. * * Example: * * const textQuery = '.friends | filter(.city == "new York") | sort(.age) | pick(.name, .age)' * const jsonQuery = parse(textQuery) * // jsonQuery = [ * // 'pipe', * // ['get', 'friends'], * // ['filter', ['eq', ['get', 'city'], 'New York']], * // ['sort', ['get', 'age']], * // ['pick', ['get', 'name'], ['get', 'age']] * // ] */ export declare function parse(query: string, options?: JSONQueryParseOptions): JSONQuery; //# sourceMappingURL=parse.d.ts.map