@typescript-eslint/utils 8.4.1-alpha.0 → 8.4.1-alpha.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepMerge.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/deepMerge.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAExD;;;GAGG;AACH,iBAAS,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,UAAU,CAEzD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,KAAK,GAAE,UAAe,EACtB,MAAM,GAAE,UAAe,GACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"deepMerge.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/deepMerge.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAExD;;;GAGG;AACH,iBAAS,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,UAAU,CAEzD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,KAAK,GAAE,UAAe,EACtB,MAAM,GAAE,UAAe,GACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA4BzB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -19,28 +19,29 @@ function isObjectNotArray(obj) {
|
|
|
19
19
|
function deepMerge(first = {}, second = {}) {
|
|
20
20
|
// get the unique set of keys across both objects
|
|
21
21
|
const keys = new Set(Object.keys(first).concat(Object.keys(second)));
|
|
22
|
-
return Array.from(keys
|
|
22
|
+
return Object.fromEntries(Array.from(keys, key => {
|
|
23
23
|
const firstHasKey = key in first;
|
|
24
24
|
const secondHasKey = key in second;
|
|
25
25
|
const firstValue = first[key];
|
|
26
26
|
const secondValue = second[key];
|
|
27
|
+
let value;
|
|
27
28
|
if (firstHasKey && secondHasKey) {
|
|
28
29
|
if (isObjectNotArray(firstValue) && isObjectNotArray(secondValue)) {
|
|
29
30
|
// object type
|
|
30
|
-
|
|
31
|
+
value = deepMerge(firstValue, secondValue);
|
|
31
32
|
}
|
|
32
33
|
else {
|
|
33
34
|
// value type
|
|
34
|
-
|
|
35
|
+
value = secondValue;
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
else if (firstHasKey) {
|
|
38
|
-
|
|
39
|
+
value = firstValue;
|
|
39
40
|
}
|
|
40
41
|
else {
|
|
41
|
-
|
|
42
|
+
value = secondValue;
|
|
42
43
|
}
|
|
43
|
-
return
|
|
44
|
-
}
|
|
44
|
+
return [key, value];
|
|
45
|
+
}));
|
|
45
46
|
}
|
|
46
47
|
//# sourceMappingURL=deepMerge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepMerge.js","sourceRoot":"","sources":["../../src/eslint-utils/deepMerge.ts"],"names":[],"mappings":";;AAiBA,
|
|
1
|
+
{"version":3,"file":"deepMerge.js","sourceRoot":"","sources":["../../src/eslint-utils/deepMerge.ts"],"names":[],"mappings":";;AAiBA,8BA+BC;AAEQ,4CAAgB;AAhDzB;;;GAGG;AACH,SAAS,gBAAgB,CAAC,GAAY;IACpC,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACvE,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,SAAS,CACvB,QAAoB,EAAE,EACtB,SAAqB,EAAE;IAEvB,iDAAiD;IACjD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAErE,OAAO,MAAM,CAAC,WAAW,CACvB,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE;QACrB,MAAM,WAAW,GAAG,GAAG,IAAI,KAAK,CAAC;QACjC,MAAM,YAAY,GAAG,GAAG,IAAI,MAAM,CAAC;QACnC,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAEhC,IAAI,KAAK,CAAC;QACV,IAAI,WAAW,IAAI,YAAY,EAAE,CAAC;YAChC,IAAI,gBAAgB,CAAC,UAAU,CAAC,IAAI,gBAAgB,CAAC,WAAW,CAAC,EAAE,CAAC;gBAClE,cAAc;gBACd,KAAK,GAAG,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;YAC7C,CAAC;iBAAM,CAAC;gBACN,aAAa;gBACb,KAAK,GAAG,WAAW,CAAC;YACtB,CAAC;QACH,CAAC;aAAM,IAAI,WAAW,EAAE,CAAC;YACvB,KAAK,GAAG,UAAU,CAAC;QACrB,CAAC;aAAM,CAAC;YACN,KAAK,GAAG,WAAW,CAAC;QACtB,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typescript-eslint/utils",
|
|
3
|
-
"version": "8.4.1-alpha.
|
|
3
|
+
"version": "8.4.1-alpha.2",
|
|
4
4
|
"description": "Utilities for working with TypeScript + ESLint together",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@eslint-community/eslint-utils": "^4.4.0",
|
|
67
|
-
"@typescript-eslint/scope-manager": "8.4.1-alpha.
|
|
68
|
-
"@typescript-eslint/types": "8.4.1-alpha.
|
|
69
|
-
"@typescript-eslint/typescript-estree": "8.4.1-alpha.
|
|
67
|
+
"@typescript-eslint/scope-manager": "8.4.1-alpha.2",
|
|
68
|
+
"@typescript-eslint/types": "8.4.1-alpha.2",
|
|
69
|
+
"@typescript-eslint/typescript-estree": "8.4.1-alpha.2"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"eslint": "^8.57.0 || ^9.0.0"
|