mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-28 22:19:41 -08:00
18 lines
551 B
TypeScript
18 lines
551 B
TypeScript
import { ErrorReporter } from 'n8n-core';
|
|
import { ExpressionEvaluatorProxy } from 'n8n-workflow';
|
|
import Container from 'typedi';
|
|
|
|
import config from '@/config';
|
|
|
|
export const initExpressionEvaluator = () => {
|
|
ExpressionEvaluatorProxy.setEvaluator(config.getEnv('expression.evaluator'));
|
|
ExpressionEvaluatorProxy.setDifferEnabled(config.getEnv('expression.reportDifference'));
|
|
ExpressionEvaluatorProxy.setDiffReporter((expr) => {
|
|
Container.get(ErrorReporter).warn('Expression difference', {
|
|
extra: {
|
|
expression: expr,
|
|
},
|
|
});
|
|
});
|
|
};
|