From 2fed026523ca885118657642e9f5316120377556 Mon Sep 17 00:00:00 2001 From: lublak <44057030+lublak@users.noreply.github.com> Date: Thu, 7 Jan 2021 13:42:05 +0100 Subject: [PATCH] :bug: Fix for same name rename (#1317) If you rename to the same name, it just gets removed. This should not be the case. --- packages/nodes-base/nodes/RenameKeys.node.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/nodes/RenameKeys.node.ts b/packages/nodes-base/nodes/RenameKeys.node.ts index 033d907c3..7838c80bb 100644 --- a/packages/nodes-base/nodes/RenameKeys.node.ts +++ b/packages/nodes-base/nodes/RenameKeys.node.ts @@ -96,8 +96,8 @@ export class RenameKeys implements INodeType { } renameKeys.forEach((renameKey) => { - if (renameKey.currentKey === '' || renameKey.newKey === '') { - // Ignore all which do not have all the values set + if (renameKey.currentKey === '' || renameKey.newKey === '' || renameKey.currentKey === renameKey.newKey) { + // Ignore all which do not have all the values set or if the new key is equal to the current key return; } value = get(item.json, renameKey.currentKey as string);