@helpers4/object 2.0.4 → 3.0.0-alpha.1
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.
- package/README.md +5 -3
- package/lib/index.d.ts +243 -78
- package/lib/index.js +121 -69
- package/lib/index.js.map +1 -1
- package/llms.txt +179 -151
- package/meta/api.json +150 -202
- package/meta/examples.json +20 -20
- package/meta/native-alternatives.json +1 -1
- package/package.json +3 -3
package/meta/examples.json
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"category": "object",
|
|
3
3
|
"functions": [
|
|
4
|
+
{
|
|
5
|
+
"name": "cloneDeep",
|
|
6
|
+
"examples": [
|
|
7
|
+
{
|
|
8
|
+
"title": "Clone a nested object",
|
|
9
|
+
"description": "Creates a deep copy — modifying the clone does not affect the original.",
|
|
10
|
+
"code": "const original = { a: { b: 1 } };\nconst cloned = cloneDeep(original);\ncloned.a.b = 2;\n// original.a.b is still 1"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
},
|
|
4
14
|
{
|
|
5
15
|
"name": "compact",
|
|
6
16
|
"examples": [
|
|
@@ -16,26 +26,6 @@
|
|
|
16
26
|
}
|
|
17
27
|
]
|
|
18
28
|
},
|
|
19
|
-
{
|
|
20
|
-
"name": "deepClone",
|
|
21
|
-
"examples": [
|
|
22
|
-
{
|
|
23
|
-
"title": "Clone a nested object",
|
|
24
|
-
"description": "Creates a deep copy — modifying the clone does not affect the original.",
|
|
25
|
-
"code": "const original = { a: { b: 1 } };\nconst cloned = deepClone(original);\ncloned.a.b = 2;\n// original.a.b is still 1"
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"name": "deepMerge",
|
|
31
|
-
"examples": [
|
|
32
|
-
{
|
|
33
|
-
"title": "Merge two objects deeply",
|
|
34
|
-
"description": "Recursively merges source properties into the target object.",
|
|
35
|
-
"code": "deepMerge({ a: 1, b: { c: 2 } }, { b: { d: 3 }, e: 4 })\n// => { a: 1, b: { c: 2, d: 3 }, e: 4 }"
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
},
|
|
39
29
|
{
|
|
40
30
|
"name": "diff",
|
|
41
31
|
"examples": [
|
|
@@ -176,6 +166,16 @@
|
|
|
176
166
|
}
|
|
177
167
|
]
|
|
178
168
|
},
|
|
169
|
+
{
|
|
170
|
+
"name": "mergeDeep",
|
|
171
|
+
"examples": [
|
|
172
|
+
{
|
|
173
|
+
"title": "Merge two objects deeply",
|
|
174
|
+
"description": "Returns a new object — neither input is mutated.",
|
|
175
|
+
"code": "mergeDeep({ a: 1, b: { c: 2 } }, { b: { d: 3 }, e: 4 })\n// => { a: 1, b: { c: 2, d: 3 }, e: 4 }"
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
179
|
{
|
|
180
180
|
"name": "omit",
|
|
181
181
|
"examples": [
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"native": "{ ...a, ...b } or Object.assign({}, a, b)",
|
|
45
45
|
"since": "ES2015",
|
|
46
46
|
"example": "const merged = { ...defaults, ...options }",
|
|
47
|
-
"notes": "For deep merge, use
|
|
47
|
+
"notes": "For deep merge, use mergeDeep from helpers4"
|
|
48
48
|
}
|
|
49
49
|
]
|
|
50
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helpers4/object",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.1",
|
|
4
4
|
"description": "A set of helpers in TS/JS, compatible with tree-shaking, for object.",
|
|
5
5
|
"author": "baxyz <baxy@etik.com>",
|
|
6
6
|
"license": "LGPL-3.0",
|
|
@@ -27,9 +27,8 @@
|
|
|
27
27
|
"keywords": [
|
|
28
28
|
"helpers",
|
|
29
29
|
"object",
|
|
30
|
+
"cloneDeep",
|
|
30
31
|
"compact",
|
|
31
|
-
"deepClone",
|
|
32
|
-
"deepMerge",
|
|
33
32
|
"diff",
|
|
34
33
|
"equalsDeep",
|
|
35
34
|
"equalsShallow",
|
|
@@ -39,6 +38,7 @@
|
|
|
39
38
|
"isEmpty",
|
|
40
39
|
"isNonEmpty",
|
|
41
40
|
"map",
|
|
41
|
+
"mergeDeep",
|
|
42
42
|
"omit",
|
|
43
43
|
"pick",
|
|
44
44
|
"removeUndefinedNull",
|