From: Jérôme Benoit Date: Mon, 20 Apr 2026 13:46:06 +0000 (+0200) Subject: refactor: remove redundant EmptyObject from CommandResponse union X-Git-Tag: v4.5~17 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=2a14332c95db3d4b81d4f9fb453a876f59a4ff33;p=e-mobility-charging-stations-simulator.git refactor: remove redundant EmptyObject from CommandResponse union EmptyObject (Record) is structurally assignable to every object type in the union. Empty responses are handled at runtime via isEmpty() checks before reaching type-narrowing logic. --- diff --git a/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts b/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts index a2adb481..b2533aa1 100644 --- a/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts +++ b/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts @@ -14,7 +14,6 @@ import { type BroadcastChannelResponsePayload, type DataTransferResponse, DataTransferStatus, - type EmptyObject, GenericStatus, GetCertificateStatusEnumType, type HeartbeatResponse, @@ -62,7 +61,6 @@ type CommandResponse = | AuthorizeResponse | BootNotificationResponse | DataTransferResponse - | EmptyObject | HeartbeatResponse | OCPP20Get15118EVCertificateResponse | OCPP20GetCertificateStatusResponse