es-toolkit 1.43.0-dev.1716 → 1.43.0-dev.1717
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,37 +8,37 @@
|
|
|
8
8
|
* @example
|
|
9
9
|
* // Clone a primitive values
|
|
10
10
|
* const num = 29;
|
|
11
|
-
* const clonedNum =
|
|
11
|
+
* const clonedNum = cloneDeep(num);
|
|
12
12
|
* console.log(clonedNum); // 29
|
|
13
13
|
* console.log(clonedNum === num); // true
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* // Clone an array
|
|
17
17
|
* const arr = [1, 2, 3];
|
|
18
|
-
* const clonedArr =
|
|
18
|
+
* const clonedArr = cloneDeep(arr);
|
|
19
19
|
* console.log(clonedArr); // [1, 2, 3]
|
|
20
20
|
* console.log(clonedArr === arr); // false
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* // Clone an array with nested objects
|
|
24
24
|
* const arr = [1, { a: 1 }, [1, 2, 3]];
|
|
25
|
-
* const clonedArr =
|
|
25
|
+
* const clonedArr = cloneDeep(arr);
|
|
26
26
|
* arr[1].a = 2;
|
|
27
|
-
* console.log(arr); // [
|
|
27
|
+
* console.log(arr); // [1, { a: 2 }, [1, 2, 3]]
|
|
28
28
|
* console.log(clonedArr); // [1, { a: 1 }, [1, 2, 3]]
|
|
29
29
|
* console.log(clonedArr === arr); // false
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
32
32
|
* // Clone an object
|
|
33
33
|
* const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };
|
|
34
|
-
* const clonedObj =
|
|
34
|
+
* const clonedObj = cloneDeep(obj);
|
|
35
35
|
* console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }
|
|
36
36
|
* console.log(clonedObj === obj); // false
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* // Clone an object with nested objects
|
|
40
40
|
* const obj = { a: 1, b: { c: 1 } };
|
|
41
|
-
* const clonedObj =
|
|
41
|
+
* const clonedObj = cloneDeep(obj);
|
|
42
42
|
* obj.b.c = 2;
|
|
43
43
|
* console.log(obj); // { a: 1, b: { c: 2 } }
|
|
44
44
|
* console.log(clonedObj); // { a: 1, b: { c: 1 } }
|
|
@@ -8,37 +8,37 @@
|
|
|
8
8
|
* @example
|
|
9
9
|
* // Clone a primitive values
|
|
10
10
|
* const num = 29;
|
|
11
|
-
* const clonedNum =
|
|
11
|
+
* const clonedNum = cloneDeep(num);
|
|
12
12
|
* console.log(clonedNum); // 29
|
|
13
13
|
* console.log(clonedNum === num); // true
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* // Clone an array
|
|
17
17
|
* const arr = [1, 2, 3];
|
|
18
|
-
* const clonedArr =
|
|
18
|
+
* const clonedArr = cloneDeep(arr);
|
|
19
19
|
* console.log(clonedArr); // [1, 2, 3]
|
|
20
20
|
* console.log(clonedArr === arr); // false
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* // Clone an array with nested objects
|
|
24
24
|
* const arr = [1, { a: 1 }, [1, 2, 3]];
|
|
25
|
-
* const clonedArr =
|
|
25
|
+
* const clonedArr = cloneDeep(arr);
|
|
26
26
|
* arr[1].a = 2;
|
|
27
|
-
* console.log(arr); // [
|
|
27
|
+
* console.log(arr); // [1, { a: 2 }, [1, 2, 3]]
|
|
28
28
|
* console.log(clonedArr); // [1, { a: 1 }, [1, 2, 3]]
|
|
29
29
|
* console.log(clonedArr === arr); // false
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
32
32
|
* // Clone an object
|
|
33
33
|
* const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };
|
|
34
|
-
* const clonedObj =
|
|
34
|
+
* const clonedObj = cloneDeep(obj);
|
|
35
35
|
* console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }
|
|
36
36
|
* console.log(clonedObj === obj); // false
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* // Clone an object with nested objects
|
|
40
40
|
* const obj = { a: 1, b: { c: 1 } };
|
|
41
|
-
* const clonedObj =
|
|
41
|
+
* const clonedObj = cloneDeep(obj);
|
|
42
42
|
* obj.b.c = 2;
|
|
43
43
|
* console.log(obj); // { a: 1, b: { c: 2 } }
|
|
44
44
|
* console.log(clonedObj); // { a: 1, b: { c: 1 } }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-toolkit",
|
|
3
|
-
"version": "1.43.0-dev.
|
|
3
|
+
"version": "1.43.0-dev.1717+5e23d821",
|
|
4
4
|
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
|
|
5
5
|
"homepage": "https://es-toolkit.dev",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|