1 | var _clone =
|
2 | /*#__PURE__*/
|
3 | require("./internal/_clone");
|
4 |
|
5 | var _curry1 =
|
6 | /*#__PURE__*/
|
7 | require("./internal/_curry1");
|
8 | /**
|
9 | * Creates a deep copy of the value which may contain (nested) `Array`s and
|
10 | * `Object`s, `Number`s, `String`s, `Boolean`s and `Date`s. `Function`s are
|
11 | * assigned by reference rather than copied
|
12 | *
|
13 | * Dispatches to a `clone` method if present.
|
14 | *
|
15 | * @func
|
16 | * @memberOf R
|
17 | * @since v0.1.0
|
18 | * @category Object
|
19 | * @sig {*} -> {*}
|
20 | * @param {*} value The object or array to clone
|
21 | * @return {*} A deeply cloned copy of `val`
|
22 | * @example
|
23 | *
|
24 | * const objects = [{}, {}, {}];
|
25 | * const objectsClone = R.clone(objects);
|
26 | * objects === objectsClone; //=> false
|
27 | * objects[0] === objectsClone[0]; //=> false
|
28 | */
|
29 |
|
30 |
|
31 | var clone =
|
32 | /*#__PURE__*/
|
33 | _curry1(function clone(value) {
|
34 | return value != null && typeof value.clone === 'function' ? value.clone() : _clone(value, [], [], true);
|
35 | });
|
36 |
|
37 | module.exports = clone; |
\ | No newline at end of file |