]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
refactor: remove redundant EmptyObject from CommandResponse union
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 20 Apr 2026 13:46:06 +0000 (15:46 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 20 Apr 2026 13:46:06 +0000 (15:46 +0200)
EmptyObject (Record<string, never>) is structurally assignable to every
object type in the union. Empty responses are handled at runtime via
isEmpty() checks before reaching type-narrowing logic.

src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts

index a2adb481455aff10b87d05ad684832c3138043bf..b2533aa1d3b5672b76de76222c7e8d72f45fd855 100644 (file)
@@ -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