feat(Set Node): Preserve binary data by default (#9668)

Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
Elias Meire
2024-06-18 10:32:51 +02:00
committed by GitHub
parent 0524f588f6
commit d1163533a6
10 changed files with 154 additions and 12 deletions

View File

@@ -56,13 +56,17 @@ export function composeReturnItem(
inputItem: INodeExecutionData,
newFields: IDataObject,
options: SetNodeOptions,
nodeVersion: number,
) {
const newItem: INodeExecutionData = {
json: {},
pairedItem: { item: itemIndex },
};
if (options.includeBinary && inputItem.binary !== undefined) {
const includeBinary =
(nodeVersion >= 3.4 && !options.stripBinary && options.include !== 'none') ||
(nodeVersion < 3.4 && !!options.includeBinary);
if (includeBinary && inputItem.binary !== undefined) {
// Create a shallow copy of the binary data so that the old
// data references which do not get changed still stay behind
// but the incoming data does not get changed.