build(deps-dev): apply updates
[e-mobility-charging-stations-simulator.git] / src / charging-station / broadcast-channel / UIServiceWorkerBroadcastChannel.ts
index 3a0c75b7d7e7ac19bce1cb255e320b7b4d35c5b0..1157c71e5e09c164dc8e653545e962d1e9f98aa7 100644 (file)
@@ -1,4 +1,3 @@
-import { WorkerBroadcastChannel } from './WorkerBroadcastChannel.js'
 import {
   type BroadcastChannelResponse,
   type BroadcastChannelResponsePayload,
@@ -8,6 +7,7 @@ import {
 } from '../../types/index.js'
 import { logger } from '../../utils/index.js'
 import type { AbstractUIService } from '../ui-server/ui-services/AbstractUIService.js'
+import { WorkerBroadcastChannel } from './WorkerBroadcastChannel.js'
 
 const moduleName = 'UIServiceWorkerBroadcastChannel'
 
@@ -70,6 +70,7 @@ export class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChannel {
         : ResponseStatus.FAILURE
     return {
       status: responsesStatus,
+      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
       hashIdsSucceeded: this.responses
         .get(uuid)
         ?.responses.map(({ status, hashId }) => {
@@ -78,8 +79,9 @@ export class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChannel {
           }
           return undefined
         })
-        .filter(hashId => hashId != null) as string[],
+        .filter(hashId => hashId != null)!,
       ...(responsesStatus === ResponseStatus.FAILURE && {
+        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
         hashIdsFailed: this.responses
           .get(uuid)
           ?.responses.map(({ status, hashId }) => {
@@ -88,9 +90,10 @@ export class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChannel {
             }
             return undefined
           })
-          .filter(hashId => hashId != null) as string[]
+          .filter(hashId => hashId != null)!
       }),
       ...(responsesStatus === ResponseStatus.FAILURE && {
+        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
         responsesFailed: this.responses
           .get(uuid)
           ?.responses.map(response => {
@@ -99,7 +102,7 @@ export class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChannel {
             }
             return undefined
           })
-          .filter(response => response != null) as BroadcastChannelResponsePayload[]
+          .filter(response => response != null)!
       })
     }
   }