@itrocks/framework 0.0.9 → 0.0.11
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/cjs/config.js +12 -2
- package/package.json +1 -1
package/cjs/config.js
CHANGED
|
@@ -6,7 +6,18 @@ const node_fs_1 = require("node:fs");
|
|
|
6
6
|
function mergeConfigObject(config, mergeConfig) {
|
|
7
7
|
Object.entries(mergeConfig).forEach(([key, value]) => {
|
|
8
8
|
if (config[key]) {
|
|
9
|
-
|
|
9
|
+
if (Array.isArray(value)) {
|
|
10
|
+
if (!Array.isArray(config[key])) {
|
|
11
|
+
config[key] = [config[key]];
|
|
12
|
+
}
|
|
13
|
+
config[key].push(...value);
|
|
14
|
+
}
|
|
15
|
+
else if (Array.isArray(config[key])) {
|
|
16
|
+
config[key].push(value);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
mergeConfigObject(config[key], value);
|
|
20
|
+
}
|
|
10
21
|
}
|
|
11
22
|
else {
|
|
12
23
|
config[key] = value;
|
|
@@ -17,6 +28,5 @@ function mergeConfig(config, appConfigFile) {
|
|
|
17
28
|
if (!(0, node_fs_1.existsSync)(app_dir_1.appDir + appConfigFile))
|
|
18
29
|
return;
|
|
19
30
|
mergeConfigObject(config, Object.values(require(app_dir_1.appDir + appConfigFile))[0]);
|
|
20
|
-
console.log('Merged config', config);
|
|
21
31
|
}
|
|
22
32
|
//# sourceMappingURL=config.js.map
|
package/package.json
CHANGED