🐛 Fix for same name rename (#1317)

If you rename to the same name, it just gets removed. This should not be the case.
This commit is contained in:
lublak 2021-01-07 13:42:05 +01:00 committed by GitHub
parent b389ef116d
commit 2fed026523
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);