From: Jérôme Benoit Date: Wed, 15 Mar 2023 21:46:18 +0000 (+0100) Subject: refactor(simulator): remove unneeded type casting X-Git-Tag: v1.1.95~12 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=617cad0c86c3fea53b56a738bb0d6ddc3da05237;p=e-mobility-charging-stations-simulator.git refactor(simulator): remove unneeded type casting Signed-off-by: Jérôme Benoit --- 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(