UI Server: dedupe some code in helpers
[e-mobility-charging-stations-simulator.git] / src / charging-station / ChargingStationWorkerBroadcastChannel.ts
index 9de2cfb2784dc75965403734ccb97b327d940bed..42448275432337772fe80a691a5364840680f068 100644 (file)
@@ -38,9 +38,7 @@ export default class ChargingStationWorkerBroadcastChannel extends WorkerBroadca
     if (this.isResponse(messageEvent.data)) {
       return;
     }
-    if (Array.isArray(messageEvent.data) === false) {
-      throw new BaseError('Worker broadcast channel protocol request is not an array');
-    }
+    this.validateMessageEvent(messageEvent);
 
     const [uuid, command, requestPayload] = messageEvent.data as BroadcastChannelRequest;