-import { WorkerBroadcastChannel } from './WorkerBroadcastChannel.js'
import {
type BroadcastChannelResponse,
type BroadcastChannelResponsePayload,
type ResponsePayload,
ResponseStatus
} from '../../types/index.js'
-import { isNullOrUndefined, logger } from '../../utils/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'
: 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 }) => {
}
return undefined
})
- .filter((hashId) => !isNullOrUndefined(hashId)) 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 }) => {
}
return undefined
})
- .filter((hashId) => !isNullOrUndefined(hashId)) 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) => {
- if (response != null && response.status === ResponseStatus.FAILURE) {
+ ?.responses.map(response => {
+ if (response.status === ResponseStatus.FAILURE) {
return response
}
return undefined
})
- .filter((response) => !isNullOrUndefined(response)) as BroadcastChannelResponsePayload[]
+ .filter(response => response != null)!
})
}
}