@modern-js/utils 1.7.6 → 1.7.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,2 @@
|
|
1
|
-
export declare
|
2
|
-
|
3
|
-
<T_2, U_2, V>(target: T_2, source1: U_2, source2: V): T_2 & U_2 & V;
|
4
|
-
<T_3, U_3, V_1, W>(target: T_3, source1: U_3, source2: V_1, source3: W): T_3 & U_3 & V_1 & W;
|
5
|
-
(target: object, ...sources: any[]): any;
|
6
|
-
}) => T;
|
1
|
+
export declare function applyOptionsChain<T, U>(defaults: T, options?: T | ((config: T, utils?: U) => T | void) | Array<T | ((config: T, utils?: U) => T | void)>, utils?: U, mergeFn?: typeof Object.assign): T;
|
2
|
+
export declare function applyOptionsChain<T, U>(defaults: T, options: T | ((config: T, utils: U) => T | void) | Array<T | ((config: T, utils: U) => T | void)>, utils: U, mergeFn?: typeof Object.assign): T;
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.applyOptionsChain = void 0;
|
4
4
|
// eslint-disable-next-line import/no-useless-path-segments
|
5
5
|
const index_1 = require("./index");
|
6
|
-
|
6
|
+
function applyOptionsChain(defaults, options, utils, mergeFn = Object.assign) {
|
7
7
|
if (!options) {
|
8
8
|
return defaults;
|
9
9
|
}
|
@@ -20,11 +20,11 @@ const applyOptionsChain = (defaults, options, utils, mergeFn = Object.assign) =>
|
|
20
20
|
}
|
21
21
|
}
|
22
22
|
else if (Array.isArray(options)) {
|
23
|
-
return options.reduce((memo, cur) =>
|
23
|
+
return options.reduce((memo, cur) => applyOptionsChain(memo, cur, utils, mergeFn), defaults);
|
24
24
|
}
|
25
25
|
else {
|
26
26
|
throw new Error(`applyOptionsChain error:\ndefault options is: ${JSON.stringify(defaults)}`);
|
27
27
|
}
|
28
28
|
return defaults;
|
29
|
-
}
|
29
|
+
}
|
30
30
|
exports.applyOptionsChain = applyOptionsChain;
|
package/package.json
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
"modern",
|
12
12
|
"modern.js"
|
13
13
|
],
|
14
|
-
"version": "1.7.
|
14
|
+
"version": "1.7.7",
|
15
15
|
"jsnext:source": "./src/index.ts",
|
16
16
|
"types": "./dist/index.d.ts",
|
17
17
|
"main": "./dist/index.js",
|
@@ -23,6 +23,7 @@
|
|
23
23
|
"./format": "./dist/format.js",
|
24
24
|
"./constants": "./dist/constants.js",
|
25
25
|
"./ssr": "./dist/ssr.js",
|
26
|
+
"./glob": "./compiled/glob/index.js",
|
26
27
|
"./chalk": "./compiled/chalk/index.js",
|
27
28
|
"./json5": "./compiled/json5/index.js",
|
28
29
|
"./semver": "./compiled/semver/index.js",
|
@@ -51,6 +52,9 @@
|
|
51
52
|
"ssr": [
|
52
53
|
"./dist/ssr.d.ts"
|
53
54
|
],
|
55
|
+
"glob": [
|
56
|
+
"./compiled/glob/index.d.ts"
|
57
|
+
],
|
54
58
|
"chalk": [
|
55
59
|
"./compiled/chalk/index.d.ts"
|
56
60
|
],
|