fix performanceStorage type assignment when not present
authorcaptaineaglex <captaineaglex@yahoo.com>
Tue, 7 Dec 2021 13:45:57 +0000 (16:45 +0300)
committercaptaineaglex <captaineaglex@yahoo.com>
Tue, 7 Dec 2021 13:45:57 +0000 (16:45 +0300)
src/utils/Configuration.ts

index 6777e8cc1d505c574102d86ebd8f8be1bbd85618..bf25445c00136eefcb85ed2e11acdf9e660f410c 100644 (file)
@@ -61,7 +61,9 @@ export default class Configuration {
       storageConfiguration =
       {
         ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'enabled') && { enabled: Configuration.getConfig().performanceStorage.enabled },
-        ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'type') && { type: Configuration.getConfig().performanceStorage.type },
+        ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'type')
+          ? { type: Configuration.getConfig().performanceStorage.type }
+          : { type: StorageType.JSON_FILE },
         ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'uri')
           ? { uri: Configuration.getConfig().performanceStorage.uri }
           : { uri: this.getDefaultPerformanceStorageUri(Configuration.getConfig()?.performanceStorage?.type ?? StorageType.JSON_FILE) }