mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Remove circular references before serializing executions in public API (#8043)
## Summary Handle circular references in the public API for executions created prior to the fix from #8030 ## Related tickets [PAY-1119](https://linear.app/n8n/issue/PAY-1119) ## Review / Merge checklist - [x] PR title and summary are descriptive.
This commit is contained in:
committed by
GitHub
parent
1e7a309e63
commit
989888d9bc
@@ -89,7 +89,7 @@ type JSONStringifyOptions = {
|
||||
replaceCircularRefs?: boolean;
|
||||
};
|
||||
|
||||
const replaceCircularReferences = <T>(value: T, knownObjects = new WeakSet()): T => {
|
||||
export const replaceCircularReferences = <T>(value: T, knownObjects = new WeakSet()): T => {
|
||||
if (typeof value !== 'object' || value === null || value instanceof RegExp) return value;
|
||||
if ('toJSON' in value && typeof value.toJSON === 'function') return value.toJSON() as T;
|
||||
if (knownObjects.has(value)) return '[Circular Reference]' as T;
|
||||
|
||||
Reference in New Issue
Block a user