From 617cad0c86c3fea53b56a738bb0d6ddc3da05237 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 15 Mar 2023 22:46:18 +0100 Subject: [PATCH] refactor(simulator): remove unneeded type casting 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 | 2 +- src/charging-station/ocpp/1.6/OCPP16RequestService.ts | 2 +- src/charging-station/ocpp/2.0/OCPP20RequestService.ts | 2 +- src/utils/Configuration.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 645c3f73..ac5aaa93 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1510,7 +1510,7 @@ export class ChargingStation { messageType )} is not an array`, undefined, - cachedRequest as unknown as JsonType + cachedRequest as JsonType ); } diff --git a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts index b4585598..1d571b04 100644 --- a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts @@ -138,7 +138,7 @@ export class OCPP16RequestService extends OCPPRequestService { this.buildRequestPayload(chargingStation, commandName, commandParams), commandName, params - )) as unknown as ResponseType; + )) as ResponseType; } // OCPPError usage here is debatable: it's an error in the OCPP stack but not targeted to sendError(). throw new OCPPError( diff --git a/src/charging-station/ocpp/2.0/OCPP20RequestService.ts b/src/charging-station/ocpp/2.0/OCPP20RequestService.ts index 16eef116..92d70aed 100644 --- a/src/charging-station/ocpp/2.0/OCPP20RequestService.ts +++ b/src/charging-station/ocpp/2.0/OCPP20RequestService.ts @@ -75,7 +75,7 @@ export class OCPP20RequestService extends OCPPRequestService { this.buildRequestPayload(chargingStation, commandName, commandParams), commandName, params - )) as unknown as ResponseType; + )) as ResponseType; } // OCPPError usage here is debatable: it's an error in the OCPP stack but not targeted to sendError(). throw new OCPPError( diff --git a/src/utils/Configuration.ts b/src/utils/Configuration.ts index 36b4e362..7d5b217d 100644 --- a/src/utils/Configuration.ts +++ b/src/utils/Configuration.ts @@ -128,7 +128,7 @@ export class Configuration { !Utils.isUndefined(Configuration.getConfig()['stationTemplateURLs']) && (Configuration.getConfig().stationTemplateUrls = Configuration.getConfig()[ 'stationTemplateURLs' - ] as unknown as StationTemplateUrl[]); + ] as StationTemplateUrl[]); Configuration.getConfig().stationTemplateUrls.forEach((stationUrl: StationTemplateUrl) => { if (!Utils.isUndefined(stationUrl['numberOfStation'])) { console.error( -- 2.34.1