• This is an alternative to JSON.stringify that ensure that circular references are replaced by a placeholder.

    Parameters

    • obj: any

      The object to serialize.

    • Optional replacer: DebuggerClientCycleReplacer

      A function called for each property on the object or array being stringified, with the property key and its value, and that returns the new value. If not specified, values are not altered.

    • Optional maxDepth: number

      The maximum depth, after which values are replaced by a string ("[Max depth reached]"). If not specified, there is no maximum depth.

    • Optional spaces: number

      The number of spaces for indentation.

    • Optional cycleReplacer: DebuggerClientCycleReplacer

      Function used to replace circular references with a new value.

    Returns string