Function cloneJson

  • Perform a deep clone of an object or array compatible with JSON stringification. Object fields that are not compatible with stringification will be omitted. Array entries that are not compatible with stringification will be censored as null.

    Type Parameters

    • T extends object

    Parameters

    • obj: T

      A JSON-compatible object or array to clone.

    Returns T

    JsonStringifyError If the object contains circular references or causes other JSON stringification errors.