n8n/packages/nodes-base/nodes/Merge/v3/actions/router.ts
कारतोफ्फेलस्क्रिप्ट™ 969439ce56
fix(core): Fix .map calls on NodeExecutionOutput (no-changelog) (#11955)
2024-12-02 16:55:01 +01:00

17 lines
579 B
TypeScript

import type { IExecuteFunctions } from 'n8n-workflow';
import { getNodeInputsData } from '../helpers/utils';
import type { MergeType } from './node.type';
import * as mode from './mode';
export async function router(this: IExecuteFunctions) {
const inputsData = getNodeInputsData.call(this);
let operationMode = this.getNodeParameter('mode', 0) as string;
if (operationMode === 'combine') {
const combineBy = this.getNodeParameter('combineBy', 0) as string;
operationMode = combineBy;
}
return await mode[operationMode as MergeType].execute.call(this, inputsData);
}