I have an existing aurelia 1 app - and I’m building some functionality in which I’d like to parse a user provided expression - execute it with a context/scope and get back a boolean/value.
Rather than import some other expression parser, I was wondering if it’d be possible to import and use the expression parser that aurelia uses in the binding syntax parser.
For example, user provides this JSON object:
{
"skip": "rows.length === 0"
}
I’d like to (safely) execute it with some values and get back a result:
const shouldSkip = parse(jsonData.skip)({ rows: [] });