supaapps-config-fetcher 1.0.5 → 1.0.6
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/ConfigManager.d.ts +1 -2
- package/dist/ConfigManager.js +1 -4
- package/package.json +1 -1
- package/src/ConfigManager.ts +2 -6
package/dist/ConfigManager.d.ts
CHANGED
package/dist/ConfigManager.js
CHANGED
|
@@ -36,13 +36,10 @@ class ConfigManager {
|
|
|
36
36
|
}
|
|
37
37
|
catch (error) {
|
|
38
38
|
console.error("Failed to load config:", error);
|
|
39
|
-
|
|
39
|
+
throw new Error('Received invalid config data');
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
getConfig() {
|
|
44
|
-
return this.config;
|
|
45
|
-
}
|
|
46
43
|
}
|
|
47
44
|
exports.ConfigManager = ConfigManager;
|
|
48
45
|
ConfigManager.instances = {};
|
package/package.json
CHANGED
package/src/ConfigManager.ts
CHANGED
|
@@ -19,7 +19,7 @@ export class ConfigManager<T> {
|
|
|
19
19
|
return ConfigManager.instances[key] as ConfigManager<T>;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
public async loadConfig(): Promise<T
|
|
22
|
+
public async loadConfig(): Promise<T> {
|
|
23
23
|
if (this.config) return this.config;
|
|
24
24
|
try {
|
|
25
25
|
const host = typeof window !== 'undefined' ? window.location.hostname : 'localhost';
|
|
@@ -28,11 +28,7 @@ export class ConfigManager<T> {
|
|
|
28
28
|
return this.config;
|
|
29
29
|
} catch (error) {
|
|
30
30
|
console.error("Failed to load config:", error);
|
|
31
|
-
|
|
31
|
+
throw new Error('Received invalid config data');
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
public getConfig(): T | null {
|
|
36
|
-
return this.config;
|
|
37
|
-
}
|
|
38
34
|
}
|