Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getExpressionEngine(): expressions.ExpressionParser {
if (!expressionEngine) {
expressionEngine = new expressions.ExpressionParser((func: string): any => {
switch (func) {
case 'phrase': return ph.PhraseEvaluator
case 'phrases': return ph.PhrasesEvaluator
case 'substitutions': return SubstitutionsEvaluator
default:
return expressions.ExpressionFunctions.standardFunctions.get(func)
}
})
}
return expressionEngine
}