(expression: string, context: Record<string, any>, customResolver = (_prefix: string, _expression: string) => '')
| 233 | } |
| 234 | |
| 235 | export function evaluateExpression(expression: string, context: Record<string, any>, customResolver = (_prefix: string, _expression: string) => ''): Primitive | undefined { |
| 236 | const result = expression.match(/\!|==|!=|>=|<=|>|<|\?|\|\||&&/) ? safeEval(render(expression, context, customResolver, true)) as Primitive : render(expression, context, customResolver); |
| 237 | return result === '' || result === 'undefined' || result === 'null' || result === null ? undefined : result; |
| 238 | } |
| 239 | |
| 240 | export function recursiveRender<T extends Record<string, any>>(obj: T, context: Record<string, any>, customResolver = (_prefix: string, _expression: string) => ''): T { |
| 241 | const result = (is.array(obj) ? [] : {}) as Record<string, any>; |
no test coverage detected