cloneDeep es-toolkit
Creates a deep copy of the given value.
Usage
cloneDeep(obj)
Use cloneDeep when you want to completely copy an object or array, including all nested structures. A deep copy creates new copies of all nested objects and arrays, making the original and the copy completely independent.
It supports various JavaScript types like Map and Set, and handles circular references safely.
For read-only properties defined by getters, the return value of the getter is stored as a regular property in the copied object.
Parameters
The value to deeply copy. It can be any type, such as objects, arrays, or primitive values.
Returns
A deep copy of the given value.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.