refactor: refine type casting in internal simulator communication code
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 30 Jan 2024 17:14:20 +0000 (18:14 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 30 Jan 2024 17:14:20 +0000 (18:14 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts

index c464f9ca11d33222925f2ee0bf52c19fa37f8948..c6e37f6095a3ddbb5a4cfe125add8cc5f8434ea4 100644 (file)
@@ -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}'`)