Skip to content

parseFilter

parseFilter(source, limits?): FilterParse

Defined in: packages/schema/src/filter/parse.ts:38

Parses filter text, AIP-160 as the API takes it, into a filter, collecting every error. maxLength defaults to 10,000 characters and maxDepth to 64. Check the result against a resource with checkFilter before running it.

string

FilterLimits = {}

FilterParse

const parsed = parseFilter('status = "paid" AND total > 100')
if (parsed.ok && parsed.ast) printFilter(parsed.ast) // 'status = "paid" AND total > 100'