Chetan Padia
Chetan Padia
Thanks @TomFrost. This is something we really need so I wrote my own in Typescript. ```ts export type JexlAst = | { type: 'UnaryExpression'; operator: string; right: JexlAst } |...
On further inspection, while this works for simple cases, it doesn't work for more complex expressions because of operator precedence. For example `expressionStringFromAst` will give `"1 + 2 * 3"`...
The implementation above is not far off but misses some important corner cases which could change the logic of the expression. I've created a library with a much more robust...
This would be really helpful for us too. At the moment we extract identifiers from the AST then validate identifiers against the context or a "context validator". It looks something...
Some context for this is I'm trying to write an expression that give me a random string from a static list. ``` ["One","Two","Three"][(random() * 3) | floor] ``` Am I...
> Until this is fixed, you could throw this into a transform function: > > ```js > jexl.addTransform('random', (ary) => { > const idx = Math.floor(Math.random() * ary.length) > return...
Thanks @TomFrost! If you're feeling a little overwhelmed feel free to give me a shout. Happy to help if I can. :)
Thanks for pointing me to why. It was very helpful to work out why this was happening! This was very hard to debug otherwise. Should React show a warning? Or...
Ah, thanks. It's easier than I thought! Noticed there's a typo in my original code (which I just fixed). `USERS` should read `'my_table`.
Tried it out and it's not ideal because you end up with a promise, not a `dynasty.table`. So when requiring this file as `db` it looks something like this. ```...