const { Parser } = require('expr-eval'); export default Parser; export const parser = new Parser({ operators: { // These default to true, but are included to be explicit add: true, concatenate: true, conditional: true, divide: true, factorial: true, multiply: true, power: true, remainder: true, subtract: true, // Disable and, or, not, <, ==, !=, etc. logical: true, comparison: true, // Disable 'in' and = operators in: true, assignment: false, }, }); parser.functions.setState = function (name: any, value: any, flag = true) { return { name, value, flag, }; };