mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +00:00
fix(Merge Node): Fix possible stack overflow (#19101)
This commit is contained in:
@@ -291,7 +291,7 @@ export class MergeV2 implements INodeType {
|
||||
}
|
||||
|
||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
const returnData: INodeExecutionData[] = [];
|
||||
let returnData: INodeExecutionData[] = [];
|
||||
|
||||
const mode = this.getNodeParameter('mode', 0) as string;
|
||||
|
||||
@@ -536,7 +536,7 @@ export class MergeV2 implements INodeType {
|
||||
output = [...output, ...unmatched1, ...unmatched2];
|
||||
}
|
||||
|
||||
returnData.push(...output);
|
||||
returnData = returnData.concat(output);
|
||||
}
|
||||
|
||||
if (joinMode === 'keepNonMatches') {
|
||||
@@ -565,15 +565,21 @@ export class MergeV2 implements INodeType {
|
||||
|
||||
if (joinMode === 'enrichInput1') {
|
||||
if (clashResolveOptions.resolveClash === 'addSuffix') {
|
||||
returnData.push(...mergedEntries, ...addSuffixToEntriesKeys(matches.unmatched1, '1'));
|
||||
returnData = returnData.concat(
|
||||
mergedEntries,
|
||||
addSuffixToEntriesKeys(matches.unmatched1, '1'),
|
||||
);
|
||||
} else {
|
||||
returnData.push(...mergedEntries, ...matches.unmatched1);
|
||||
returnData = returnData.concat(mergedEntries, matches.unmatched1);
|
||||
}
|
||||
} else {
|
||||
if (clashResolveOptions.resolveClash === 'addSuffix') {
|
||||
returnData.push(...mergedEntries, ...addSuffixToEntriesKeys(matches.unmatched2, '2'));
|
||||
returnData = returnData.concat(
|
||||
mergedEntries,
|
||||
addSuffixToEntriesKeys(matches.unmatched2, '2'),
|
||||
);
|
||||
} else {
|
||||
returnData.push(...mergedEntries, ...matches.unmatched2);
|
||||
returnData = returnData.concat(mergedEntries, matches.unmatched2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user