Open ablsc opened 2 years ago
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 : parseInt(size)", { "size": "" });
Following throws the error: Token ? (question) unexpected in expression: isNaN(parseInt(size)) ?
var jexl = require("jexl") jexl.addFunction("parseInt", (arg) => Number.parseInt(arg)); jexl.addFunction("isNaN", (arg) => Number.isNaN(arg)); jexl.evalSync("isNaN(parseInt(size)) ? 0 : parseInt(size)", { "size": "" });
I ran into this also, glad there is a workaround with == true, but that is kind of odd
Didn't see anyone else raising this one, so here goes
Following works
Following throws the error: Token ? (question) unexpected in expression: isNaN(parseInt(size)) ?