2024-12-11 06:36:17 -08:00
|
|
|
import { ErrorReporter } from 'n8n-core';
|
|
|
|
import { ExpressionEvaluatorProxy } from 'n8n-workflow';
|
|
|
|
import Container from 'typedi';
|
2023-09-21 05:57:45 -07:00
|
|
|
|
2024-09-12 09:07:18 -07:00
|
|
|
import config from '@/config';
|
|
|
|
|
2023-09-21 05:57:45 -07:00
|
|
|
export const initExpressionEvaluator = () => {
|
|
|
|
ExpressionEvaluatorProxy.setEvaluator(config.getEnv('expression.evaluator'));
|
|
|
|
ExpressionEvaluatorProxy.setDifferEnabled(config.getEnv('expression.reportDifference'));
|
|
|
|
ExpressionEvaluatorProxy.setDiffReporter((expr) => {
|
2024-12-11 06:36:17 -08:00
|
|
|
Container.get(ErrorReporter).warn('Expression difference', {
|
2023-09-21 05:57:45 -07:00
|
|
|
extra: {
|
|
|
|
expression: expr,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|