feat(Merge Node)!: node tweaks n8n-4939 (#4321)

BREAKING CHANGE: The Merge node list of operations was rearranged.

Merge node: 'Combine' operation was added with 'Combine Mode' option, operations 'Merge By Fields', 'Merge By Position' and 'Multiplex' placed under 'Combine Mode' option.
To update -go to the workflows that use the Merge node, select 'Combine' operation and then choose an option from 'Combination Mode' that matches an operation that was previously used. If you want to continue even on error, you can set "Continue on Fail" to true.
This commit is contained in:
Michael Kret
2022-10-13 17:14:47 +03:00
committed by GitHub
parent 1db4fa2bf8
commit 6a37071350
4 changed files with 265 additions and 185 deletions

View File

@@ -35,6 +35,7 @@ type MultipleMatches = 'all' | 'first';
export type MatchFieldsOutput = 'both' | 'input1' | 'input2';
export type MatchFieldsJoinMode =
| 'keepEverything'
| 'keepMatches'
| 'keepNonMatches'
| 'enrichInput2'
@@ -294,12 +295,16 @@ export function selectMergeMethod(clashResolveOptions: ClashResolveOptions) {
}
}
if (mergeMode === 'deepMerge') {
return (target: IDataObject, ...source: IDataObject[]) =>
mergeWith(target, ...source, customizer);
return (target: IDataObject, ...source: IDataObject[]) => {
const targetCopy = Object.assign({}, target);
return mergeWith(targetCopy, ...source, customizer);
};
}
if (mergeMode === 'shallowMerge') {
return (target: IDataObject, ...source: IDataObject[]) =>
assignWith(target, ...source, customizer);
return (target: IDataObject, ...source: IDataObject[]) => {
const targetCopy = Object.assign({}, target);
return assignWith(targetCopy, ...source, customizer);
};
}
} else {
if (mergeMode === 'deepMerge') {