Skip to main content

jsonLogicAdditionalOperators

const jsonLogicAdditionalOperators: object

Register these operators with jsonLogic before applying the result of formatQuery(query, 'jsonlogic').

Type declaration

endsWith()

endsWith: (a, b) => boolean

Parameters

ParameterType
astring
bstring

Returns

boolean

startsWith()

startsWith: (a, b) => boolean

Parameters

ParameterType
astring
bstring

Returns

boolean

Example

for (const [op, func] of Object.entries(jsonLogicAdditionalOperators)) {
jsonLogic.add_operation(op, func);
}
jsonLogic.apply({ "startsWith": [{ "var": "firstName" }, "Stev"] }, data);

Defined in

packages/react-querybuilder/src/utils/formatQuery/utils.ts:64


caution

API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.