Jexl
Jexl copied to clipboard
Javascript Expression Language: Powerful context-based expression parser and evaluator
We have a situation where we're changing the context object in [our application](https://cogs.show) to expose more useful data. This means that expressions that our users have written now have to...
How do I write an object with a key that has a space? This example seems to fail: https://czosel.github.io/jexl-playground/#/?input=%7B%22key%20with%20a%20space%22%3A%20123%7D In fact, any key in quotes fails. Given Javascript lets you...
When travers a property in empty array, TypeError would be thrown ````javascript const context = { foo: { bar: [] } } // before // 'foo.bar.tek.hello' --> [TypeError: Cannot read...
Addresses https://github.com/TomFrost/Jexl/issues/97 Incorporates the suggestion provided in this comment, courtesy of [OlivierB-OB](https://github.com/OlivierB-OB): https://github.com/TomFrost/Jexl/issues/97#issuecomment-745129713 Basically, if there is a minus sign for a negative value past the first argument, there is...
Hi @TomFrost Minus is not interpreted properly... [1, 2, 3] => OK https://czosel.github.io/jexl-playground/#/?input=%5B1%2C%202%2C%203%5D [-1, 2, 3] => OK https://czosel.github.io/jexl-playground/#/?input=%5B-1%2C%202%2C%203%5D [-1, -2, 3] => Error: Token - (binaryOp) unexpected in expression:...
Hi, Thank you for your great work, One question does it use actual js eval or Function or have access to global JavaScript objects. Is it safe to use this...
Didn't see anyone else raising this one, so here goes Following works ``` var jexl = require("jexl") jexl.addFunction("parseInt", (arg) => Number.parseInt(arg)); jexl.addFunction("isNaN", (arg) => Number.isNaN(arg)); jexl.evalSync("isNaN(parseInt(size)) == true ? 0...
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. Commits 7efb22a 1.2.6 ef88b93 security notice for additional prototype pollution issue c2b9819 isConstructorOrProto adapted from PR bc8ecee test from prototype pollution PR See full...
I wanted to add custom toLocaleString method as expression but i realized that createToken function checks elements of grammar to identify token type. ```javascript else if (this._grammar.elements[element]) { token.type =...
Is there any way to get jexl to throw if the expression being evaluated uses an identifier that isn't found in the context? It seems that missing identifiers are just...