mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
fix(core): AugmentObject should handle the constructor property correctly (#12744)
This commit is contained in:
committed by
GitHub
parent
af5b64a61d
commit
36bc164da4
@@ -36,6 +36,7 @@ export function augmentArray<T>(data: T[]): T[] {
|
||||
return Reflect.deleteProperty(getData(), key);
|
||||
},
|
||||
get(target, key: string, receiver): unknown {
|
||||
if (key === 'constructor') return Array;
|
||||
const value = Reflect.get(newData ?? target, key, receiver) as unknown;
|
||||
const newValue = augment(value);
|
||||
if (newValue !== value) {
|
||||
@@ -83,6 +84,8 @@ export function augmentObject<T extends object>(data: T): T {
|
||||
|
||||
const proxy = new Proxy(data, {
|
||||
get(target, key: string, receiver): unknown {
|
||||
if (key === 'constructor') return Object;
|
||||
|
||||
if (deletedProperties.has(key)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user