@idlebox/deepmerge 0.0.10 → 0.0.12
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/package.json +8 -5
- package/src/index.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idlebox/deepmerge",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "Deep merge utility for JSON files with custom merge strategies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -16,17 +16,20 @@
|
|
|
16
16
|
"mocha": "^11.7.5",
|
|
17
17
|
"rimraf": "^6.1.2",
|
|
18
18
|
"@build-script/baseline-rig": "latest",
|
|
19
|
-
"@mpis/run": "^0.0.
|
|
19
|
+
"@mpis/run": "^0.0.20"
|
|
20
20
|
},
|
|
21
21
|
"sideEffects": false,
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"author": "GongT <admin@gongt.me>",
|
|
24
|
-
"repository":
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/GongT/baobao",
|
|
27
|
+
"directory": "@idlebox/deepmerge"
|
|
28
|
+
},
|
|
25
29
|
"main": "./lib/index.js",
|
|
26
30
|
"scripts": {
|
|
27
31
|
"build": "mpis-run build",
|
|
28
32
|
"watch": "mpis-run watch",
|
|
29
|
-
"clean": "mpis-run clean"
|
|
30
|
-
"lint": "internal-lint"
|
|
33
|
+
"clean": "mpis-run clean"
|
|
31
34
|
}
|
|
32
35
|
}
|
package/src/index.ts
CHANGED
|
@@ -97,9 +97,9 @@ const defaults: StrategyRequired = {
|
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* 深复制并合并两个对象,原对象不会修改(当然,无法限制options传入的回调)。
|
|
100
|
-
*
|
|
100
|
+
*
|
|
101
101
|
* 并且其中的对象引用完全依赖传入的options。
|
|
102
|
-
*
|
|
102
|
+
*
|
|
103
103
|
* 对返回值进行写操作可能产生意外影响。
|
|
104
104
|
*/
|
|
105
105
|
export function deepmerge<A, B = any>(a: A, b: B, options?: MergeStrategy): A & B {
|