@adonis-agora/filter
Version:
Server-side query filtering/sorting/pagination for AdonisJS — Spatie-style input, a Lucid adapter, and field allow-listing. Part of the Agora ecosystem.
43 lines • 885 B
JavaScript
/**
* All valid operator strings, used for runtime validation.
*/
export const FILTER_OPERATORS = [
'equals',
'notEquals',
'contains',
'notContains',
'iContains',
'startsWith',
'endsWith',
'gt',
'gte',
'lt',
'lte',
'between',
'notBetween',
'in',
'notIn',
'isAnyOf',
'isEmpty',
'isNotEmpty',
'isNull',
'isNotNull',
'exists',
'notExists',
];
/**
* SQL-symbol aliases accepted on input and normalized to a canonical
* {@link FilterOperator} before validation and query building. Lets callers
* write the familiar `=`/`!=`/`<`/`>` shorthands instead of the named form.
*/
export const OPERATOR_ALIASES = {
'=': 'equals',
'==': 'equals',
'!=': 'notEquals',
'<>': 'notEquals',
'>': 'gt',
'>=': 'gte',
'<': 'lt',
'<=': 'lte',
};
//# sourceMappingURL=operators.js.map