Skip to content

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.

JsonReplacer

An optional user-defined replacer (function or property list) to apply after the circular reference handling.

JsonMakeCircularReferenceReplacerFunctionOptions

Options for configuring the circular safe replacer function, including the placeholder string to use for circular references.

JsonReplacerFunction

A JSON replacer function that handles circular references and applies the user-defined replacer if provided.