fix(Merge Node): Enrich input 2 fix (#6526)

This commit is contained in:
Michael Kret
2023-06-23 16:21:42 +03:00
committed by GitHub
parent 806d134602
commit c82c7f1912
3 changed files with 26 additions and 30 deletions

View File

@@ -541,14 +541,18 @@ export class MergeV2 implements INodeType {
const mergedEntries = mergeMatched(matches.matched, clashResolveOptions, joinMode);
if (clashResolveOptions.resolveClash === 'addSuffix') {
const suffix = joinMode === 'enrichInput1' ? '1' : '2';
returnData.push(
...mergedEntries,
...addSuffixToEntriesKeys(matches.unmatched1, suffix),
);
if (joinMode === 'enrichInput1') {
if (clashResolveOptions.resolveClash === 'addSuffix') {
returnData.push(...mergedEntries, ...addSuffixToEntriesKeys(matches.unmatched1, '1'));
} else {
returnData.push(...mergedEntries, ...matches.unmatched1);
}
} else {
returnData.push(...mergedEntries, ...matches.unmatched1);
if (clashResolveOptions.resolveClash === 'addSuffix') {
returnData.push(...mergedEntries, ...addSuffixToEntriesKeys(matches.unmatched2, '2'));
} else {
returnData.push(...mergedEntries, ...matches.unmatched2);
}
}
}
}