mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(core): Fix property existence checks on AugmentObject (#6842)
Fixes https://community.n8n.io/t/code-node-returns-full-item-object-on-node-all/28823
This commit is contained in:
committed by
GitHub
parent
e4f041815a
commit
732416f52f
@@ -33,7 +33,7 @@ export function augmentArray<T>(data: T[]): T[] {
|
||||
return Reflect.deleteProperty(getData(), key);
|
||||
},
|
||||
get(target, key: string, receiver): unknown {
|
||||
const value = Reflect.get(newData !== undefined ? newData : target, key, receiver) as unknown;
|
||||
const value = Reflect.get(newData ?? target, key, receiver) as unknown;
|
||||
const newValue = augment(value);
|
||||
if (newValue !== value) {
|
||||
newData = getData();
|
||||
@@ -54,10 +54,10 @@ export function augmentArray<T>(data: T[]): T[] {
|
||||
return Object.getOwnPropertyDescriptor(data, key) ?? defaultPropertyDescriptor;
|
||||
},
|
||||
has(target, key) {
|
||||
return Reflect.has(newData !== undefined ? newData : target, key);
|
||||
return Reflect.has(newData ?? target, key);
|
||||
},
|
||||
ownKeys(target) {
|
||||
return Reflect.ownKeys(newData !== undefined ? newData : target);
|
||||
return Reflect.ownKeys(newData ?? target);
|
||||
},
|
||||
set(target, key: string, newValue: unknown) {
|
||||
// Always proxy all objects. Like that we can check in get simply if it
|
||||
@@ -134,8 +134,7 @@ export function augmentObject<T extends object>(data: T): T {
|
||||
},
|
||||
has(target, key) {
|
||||
if (deletedProperties.indexOf(key) !== -1) return false;
|
||||
const newKeys = Object.keys(newData);
|
||||
return Reflect.has(newKeys.length ? newData : target, key);
|
||||
return Reflect.has(newData, key) || Reflect.has(target, key);
|
||||
},
|
||||
ownKeys(target) {
|
||||
const originalKeys = Reflect.ownKeys(target);
|
||||
|
||||
Reference in New Issue
Block a user