Performs a deep clone of the specified variable and returns the cloned variable.
Parameters:
Name | Type | Description |
---|---|---|
value | * | The value to clone. |
- Since
- 3.1.0
- Source
Returns:
Returns a deep copy of the specified variable.
- Type:
- *
Example
import { cloneDeep } from "@gravityforms/utils";
function Example() {
const obj = { prop: 'val' };
const clone = cloneDeep( obj );
}
Methods
(inner) _cloneDeepSafe(value, seen) → {*}
Performs a deep clone of the specified variable and returns the cloned variable.
Parameters:
Name | Type | Description |
---|---|---|
value | * | The value to clone. |
seen | WeakMap | A WeakMap to handle circular references. |
- Since
- 3.1.0
- Source
Returns:
Returns a deep copy of the specified variable.
- Type:
- *