mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(core): Do not mark duplicates as circular references in jsonStringify (#5789)
* fix(core): jsonStringify should not mark duplicates as circular references * not mark duplicates as circular references in the code node as well
This commit is contained in:
committed by
GitHub
parent
f15f4bdcf2
commit
18efaf397a
@@ -30,6 +30,14 @@ describe('jsonStringify', () => {
|
||||
'{"a":1,"b":2,"c":"[Circular Reference]"}',
|
||||
);
|
||||
});
|
||||
|
||||
it('should not detect duplicates as circular references', () => {
|
||||
const y = { z: 5 };
|
||||
const x = [y, y, { y }];
|
||||
expect(jsonStringify(x, { replaceCircularRefs: true })).toEqual(
|
||||
'[{"z":5},{"z":5},{"y":{"z":5}}]',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('deepCopy', () => {
|
||||
|
||||
Reference in New Issue
Block a user