refactor: split WorkerConstants class
[e-mobility-charging-stations-simulator.git] / src / charging-station / SharedLRUCache.ts
index 9fd940795bbe33788589c528e74b058672a202a1..d55f358e18809b19e65972287330047440c3ab8b 100644 (file)
@@ -38,7 +38,7 @@ export class SharedLRUCache {
   ): void {
     if (this.isChargingStationConfigurationCacheable(chargingStationConfiguration)) {
       this.set(
-        this.getChargingStationConfigurationKey(chargingStationConfiguration.configurationHash),
+        this.getChargingStationConfigurationKey(chargingStationConfiguration.configurationHash!),
         chargingStationConfiguration,
       );
     }
@@ -62,7 +62,7 @@ export class SharedLRUCache {
 
   public setChargingStationTemplate(chargingStationTemplate: ChargingStationTemplate): void {
     this.set(
-      this.getChargingStationTemplateKey(chargingStationTemplate.templateHash),
+      this.getChargingStationTemplateKey(chargingStationTemplate.templateHash!),
       chargingStationTemplate,
     );
   }
@@ -114,8 +114,8 @@ export class SharedLRUCache {
       isNullOrUndefined(chargingStationConfiguration?.automaticTransactionGenerator) === false &&
       isNullOrUndefined(chargingStationConfiguration?.configurationHash) === false &&
       isNotEmptyArray(chargingStationConfiguration?.configurationKey) === true &&
-      isEmptyObject(chargingStationConfiguration?.stationInfo) === false &&
-      isEmptyObject(chargingStationConfiguration?.automaticTransactionGenerator) === false &&
+      isEmptyObject(chargingStationConfiguration.stationInfo!) === false &&
+      isEmptyObject(chargingStationConfiguration.automaticTransactionGenerator!) === false &&
       isNotEmptyString(chargingStationConfiguration?.configurationHash) === true
     );
   }