mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): augmentObject should use existing property descriptors whenever possible (#5872)
* fix(core): Augmented objects should use existing property descriptors whenever possible * add a test for non-enumerable keys
This commit is contained in:
committed by
GitHub
parent
31cd04c476
commit
6a1b7c306b
@@ -520,5 +520,13 @@ describe('AugmentObject', () => {
|
||||
|
||||
expect(timeAugmented).toBeLessThan(timeCopied);
|
||||
});
|
||||
|
||||
test('should ignore non-enumerable keys', () => {
|
||||
const originalObject = { a: 1, b: 2 };
|
||||
Object.defineProperty(originalObject, '__hiddenProp', { enumerable: false });
|
||||
|
||||
const augmentedObject = augmentObject(originalObject);
|
||||
expect(Object.keys(augmentedObject)).toEqual(['a', 'b']);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user