UNPKG

jovo-v4-community-plugin-jexl-output

Version:

A Jovo V4 framework plugin which adds Jexl support for output strings.

20 lines (19 loc) 734 B
/** * Starting with a text string which contains "Jexl" expressions (described in * detail here: https://github.com/TomFrost/Jexl) this processor will iterate * and evaluate each expression. * * The evaluated expressions are then used to replace their Jexl originals. * * Examples and possible outcome: * * Input string "Your lucky number is ${1+Math.floor(Math.random()*10)}" * * Possible output: "Your lucky number is 7" * * @param text some string that may contain Jexl expressions * @param jexlContext some context which is used when evaluating an Jexl expresson * @returns original string with all expressions evaluated * */ export declare function processJexlExpression(text: string, jexlContext: any): string;