repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor(simulator): introduce HTTP methods enum
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
UIServiceWorkerBroadcastChannel.ts
diff --git
a/src/charging-station/UIServiceWorkerBroadcastChannel.ts
b/src/charging-station/UIServiceWorkerBroadcastChannel.ts
index 8528c0e247002a3f830d5f777e5f488f93cda99a..5b7ab4847503eacfa3fc02fc0684c01269b3ae5c 100644
(file)
--- a/
src/charging-station/UIServiceWorkerBroadcastChannel.ts
+++ b/
src/charging-station/UIServiceWorkerBroadcastChannel.ts
@@
-1,5
+1,4
@@
-import type { AbstractUIService } from './internal';
-import { WorkerBroadcastChannel } from './WorkerBroadcastChannel';
+import { type AbstractUIService, WorkerBroadcastChannel } from './internal';
import {
type BroadcastChannelResponse,
type BroadcastChannelResponsePayload,
import {
type BroadcastChannelResponse,
type BroadcastChannelResponsePayload,
@@
-7,7
+6,7
@@
import {
type ResponsePayload,
ResponseStatus,
} from '../types';
type ResponsePayload,
ResponseStatus,
} from '../types';
-import { logger } from '../utils
/Logger
';
+import { logger } from '../utils';
const moduleName = 'UIServiceWorkerBroadcastChannel';
const moduleName = 'UIServiceWorkerBroadcastChannel';
@@
-70,31
+69,31
@@
export class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChannel {
status: responsesStatus,
hashIdsSucceeded: this.responses
.get(uuid)
status: responsesStatus,
hashIdsSucceeded: this.responses
.get(uuid)
- ?.responses.map(({ status, hashId }) => {
+ ?.responses.filter(({ hashId }) => hashId !== undefined)
+ .map(({ status, hashId }) => {
if (status === ResponseStatus.SUCCESS) {
return hashId;
}
if (status === ResponseStatus.SUCCESS) {
return hashId;
}
- })
- .filter((hashId) => hashId !== undefined),
+ }),
...(responsesStatus === ResponseStatus.FAILURE && {
hashIdsFailed: this.responses
.get(uuid)
...(responsesStatus === ResponseStatus.FAILURE && {
hashIdsFailed: this.responses
.get(uuid)
- ?.responses.map(({ status, hashId }) => {
+ ?.responses.filter(({ hashId }) => hashId !== undefined)
+ .map(({ status, hashId }) => {
if (status === ResponseStatus.FAILURE) {
return hashId;
}
if (status === ResponseStatus.FAILURE) {
return hashId;
}
- })
- .filter((hashId) => hashId !== undefined),
+ }),
}),
...(responsesStatus === ResponseStatus.FAILURE && {
responsesFailed: this.responses
.get(uuid)
}),
...(responsesStatus === ResponseStatus.FAILURE && {
responsesFailed: this.responses
.get(uuid)
- ?.responses.map((response) => {
+ ?.responses.filter((response) => response !== undefined)
+ .map((response) => {
if (response.status === ResponseStatus.FAILURE) {
return response;
}
if (response.status === ResponseStatus.FAILURE) {
return response;
}
- })
- .filter((response) => response !== undefined),
+ }),
}),
};
}
}),
};
}