From cdde2cfed18fa29abc91915f3929288eafcae677 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 9 Mar 2023 22:31:05 +0100 Subject: [PATCH] refactor(simulator): delete attributes instead of undefining MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStation.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; } } } -- 2.34.1