refactor: cleanup loops over object keys
[e-mobility-charging-stations-simulator.git] / src / charging-station / AutomaticTransactionGenerator.ts
index 233f2519dcb4c8b120fe20d74293505af9c38761..3c2a2c38c80abf3b4eb7e32df83c453ec10bc8b0 100644 (file)
@@ -3,7 +3,7 @@
 import { AsyncResource } from 'node:async_hooks';
 
 import type { ChargingStation } from './ChargingStation';
-import { ChargingStationUtils } from './ChargingStationUtils';
+import { checkChargingStation } from './ChargingStationUtils';
 import { IdTagsCache } from './IdTagsCache';
 import { BaseError } from '../exception';
 import { PerformanceStatistics } from '../performance';
@@ -68,9 +68,7 @@ export class AutomaticTransactionGenerator extends AsyncResource {
   }
 
   public start(): void {
-    if (
-      ChargingStationUtils.checkChargingStation(this.chargingStation, this.logPrefix()) === false
-    ) {
+    if (checkChargingStation(this.chargingStation, this.logPrefix()) === false) {
       return;
     }
     if (this.started === true) {
@@ -103,12 +101,7 @@ export class AutomaticTransactionGenerator extends AsyncResource {
   }
 
   public startConnector(connectorId: number): void {
-    if (
-      ChargingStationUtils.checkChargingStation(
-        this.chargingStation,
-        this.logPrefix(connectorId)
-      ) === false
-    ) {
+    if (checkChargingStation(this.chargingStation, this.logPrefix(connectorId)) === false) {
       return;
     }
     if (this.connectorsStatus.has(connectorId) === false) {