jsonMakeCircularReferenceReplacerFunction
jsonMakeCircularReferenceReplacerFunction(
replacer?,options?):JsonReplacerFunction
Defined in: packages/core/src/json/replacers/circular-reference.ts:30
Create a JSON replacer function that safely handles circular references by replacing them with a specified placeholder string.
This function uses a WeakMap to track parent objects during serialization, allowing it to detect circular references and replace them with the provided placeholder. It can be combined with an optional user-defined replacer for additional customization.
Parameters
Section titled “Parameters”replacer?
Section titled “replacer?”An optional user-defined replacer (function or property list) to apply after the circular reference handling.
options?
Section titled “options?”JsonMakeCircularReferenceReplacerFunctionOptions
Options for configuring the circular safe replacer function, including the placeholder string to use for circular references.
Returns
Section titled “Returns”A JSON replacer function that handles circular references and applies the user-defined replacer if provided.