Closed keyofdb closed 4 years ago
that would be so cool..
@TomFrost : maybe this feature can be added to v2.0
? That would greatly enhance this awesome library!
It's been a long time coming, but functions support is working in the functions branch. No docs there yet, but it works exactly as you might expect:
jexl.addFunction('hello', (arg) => `Hello, ${arg}!`)
jexl.evalSync('hello("world")') // "Hello, world!"
Getting this documented and teed up for the next release!
This is going to be fantastic! Thanks for your work @TomFrost!
Adding functions to the context would be nice, e.g.:
jexl.eval("a.b(5).c", { a: { b: v => ({ c: v }) } })
Any update on this @TomFrost? Is it safe to use the functions branch?
Released in 2.3.0!
Does this library support function calls?
For example, given the following context { number1: 3, number2: 5, number3: 4 }
Can i use something like the following? min(number1, number2, number3)