Open
Description
In case anyone needs to whitelist only selected operators without explicitly setting false
for every other:
const ALLOWED_OPERATORS = ['add', 'subtract', 'multiply', 'divide', 'power'];
const parser = new Parser({
operators: new Proxy({}, {
has() {
return true;
},
get(target, prop) {
return typeof prop === 'string' && ALLOWED_OPERATORS.includes(prop);
},
}),
});
Metadata
Metadata
Assignees
Labels
No labels