From: Jérôme Benoit Date: Thu, 9 Mar 2023 21:31:05 +0000 (+0100) Subject: refactor(simulator): delete attributes instead of undefining X-Git-Tag: v1.1.95~19 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=cdde2cfed18fa29abc91915f3929288eafcae677;p=e-mobility-charging-stations-simulator.git refactor(simulator): delete attributes instead of undefining Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index ce816715..6796bc95 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -573,7 +573,7 @@ export class ChargingStation { this.sharedLRUCache.deleteChargingStationConfiguration(this.configurationFileHash); this.templateFileWatcher?.close(); this.sharedLRUCache.deleteChargingStationTemplate(this.stationInfo?.templateHash); - this.bootNotificationResponse = undefined; + delete this.bootNotificationResponse; this.started = false; parentPort?.postMessage(MessageChannelUtils.buildStoppedMessage(this)); this.stopping = false; @@ -987,7 +987,7 @@ export class ChargingStation { this.stationInfo = this.getStationInfo(); this.saveStationInfo(); // Avoid duplication of connectors related information in RAM - this.stationInfo?.Connectors && delete this.stationInfo.Connectors; + delete this.stationInfo?.Connectors; this.configuredSupervisionUrl = this.getConfiguredSupervisionUrl(); if (this.getEnableStatistics() === true) { this.performanceStatistics = PerformanceStatistics.getInstance( @@ -1317,7 +1317,7 @@ export class ChargingStation { this.templateFile } with connector ${connectorId} status configuration defined, undefine it` ); - connectorStatus.status = undefined; + delete connectorStatus.status; } } @@ -1878,7 +1878,7 @@ export class ChargingStation { ConnectorStatusEnum.Unavailable ) ); - this.getConnectorStatus(connectorId).status = undefined; + delete this.getConnectorStatus(connectorId)?.status; } } }