• Quickly clone a simple piece of data, returning a copy which can be mutated safely. This method DOES support recursive data structures containing inner objects or arrays. This method DOES NOT support advanced object types like Set, Map, or other specialized classes.

    Parameters

    • original: any

      Some sort of data

    • Optional options: {
          strict: boolean;
          _d: number;
      } = {}

      Options to configure the behaviour of deepClone

      • strict: boolean

        Throw an Error if deepClone is unable to clone something instead of returning the original

      • _d: number

        An internal depth tracker

    Returns any

    The clone of that data