From: Jérôme Benoit Date: Tue, 30 Jan 2024 17:14:20 +0000 (+0100) Subject: refactor: refine type casting in internal simulator communication code X-Git-Tag: v1.2.34~16 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7f79ef45be4ba9bcfee9ec8c69cd54c75f24aec0;p=e-mobility-charging-stations-simulator.git refactor: refine type casting in internal simulator communication code Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts b/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts index c464f9ca..c6e37f60 100644 --- a/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts +++ b/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts @@ -345,7 +345,10 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne return await commandHandler(requestPayload) } return ( - commandHandler as (requestPayload?: BroadcastChannelRequestPayload) => CommandResponse + commandHandler as ( + requestPayload?: BroadcastChannelRequestPayload + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type + ) => CommandResponse | void )(requestPayload) } throw new BaseError(`Unknown worker broadcast channel command: '${command}'`)