When constructing a new Parser, you can pass an options object to enable or disable specific groups of operators. By default, most operators are enabled. This is useful for restricting the expression language for security or specific use cases.
Supported operator groups include:
add, subtract, multiply, divide, remainder, power, factorial, concatenate (Arithmetic)logical (and, or, not)comparison (<, >, ==, !=, etc.)in (the in operator)assignment (= operator)
const parser = new Parser({
operators: {
add: true,
concatenate: true,
conditional: true,
divide: true,
factorial: true,
multiply: true,
power: true,
remainder: true,
subtract: true,
// Disable and, or, not, <, ==, !=, etc.
logical: false,
comparison: false,
// Disable 'in' and = operators
'in': false,
assignment: false
}
});