@ac-essentials/misc-util
    Preparing search index...

    Function jsonMakeCircularReferenceReplacerFunction

    • 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

      • Optionalreplacer: JsonReplacer

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

      • Optionaloptions: JsonMakeCircularReferenceReplacerFunctionOptions

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

      Returns JsonReplacerFunction

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