nextemos 5.0.26 → 5.0.28
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/dist/helpers/getConfigs.js +16 -11
- package/package.json +1 -1
|
@@ -41,29 +41,34 @@ exports.defaultConfig = {
|
|
|
41
41
|
};
|
|
42
42
|
class ConfigStore {
|
|
43
43
|
constructor() {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
// Constructor'ı private tutuyoruz ama boş bırakıyoruz
|
|
45
|
+
}
|
|
46
|
+
static initialize() {
|
|
47
|
+
if (!this.config) {
|
|
48
|
+
try {
|
|
49
|
+
const loadedConfig = require("../../../../nextemos-config.json");
|
|
50
|
+
console.log("nextemos-config.json Config initialized successfully");
|
|
51
|
+
this.config = Object.assign(Object.assign({}, exports.defaultConfig), loadedConfig);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
console.warn("nextemos-config.json Config could not be loaded, using defaults:", error);
|
|
55
|
+
this.config = exports.defaultConfig;
|
|
56
|
+
}
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
59
|
static getInstance() {
|
|
56
60
|
if (!ConfigStore.instance) {
|
|
57
61
|
ConfigStore.instance = new ConfigStore();
|
|
62
|
+
this.initialize();
|
|
58
63
|
}
|
|
59
64
|
return ConfigStore.instance;
|
|
60
65
|
}
|
|
61
66
|
getConfig() {
|
|
62
|
-
return
|
|
67
|
+
return ConfigStore.config;
|
|
63
68
|
}
|
|
64
69
|
// Debug için config'i loglama metodu
|
|
65
70
|
logConfig() {
|
|
66
|
-
console.log("Current Config:", JSON.stringify(
|
|
71
|
+
console.log("Current Config:", JSON.stringify(ConfigStore.config, null, 2));
|
|
67
72
|
}
|
|
68
73
|
}
|
|
69
74
|
// Singleton instance'ı oluştur
|