refactor: revert internal exports
[e-mobility-charging-stations-simulator.git] / src / charging-station / ChargingStationWorkerBroadcastChannel.ts
index 49ce0811d534be1e339c466a2b839132749235e3..30cef34eb2e5e7898bfa728aa86488199df597b8 100644 (file)
@@ -1,9 +1,7 @@
-import {
-  type ChargingStation,
-  ChargingStationConfigurationUtils,
-  WorkerBroadcastChannel,
-} from './internal';
+import type { ChargingStation } from './ChargingStation';
+import { ChargingStationConfigurationUtils } from './ChargingStationConfigurationUtils';
 import { OCPP16ServiceUtils } from './ocpp';
+import { WorkerBroadcastChannel } from './WorkerBroadcastChannel';
 import { BaseError, type OCPPError } from '../exception';
 import {
   AuthorizationStatus,
@@ -258,12 +256,12 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne
     }
     const [uuid, command, requestPayload] = validatedMessageEvent.data as BroadcastChannelRequest;
     if (
-      requestPayload?.hashIds !== undefined &&
+      !Utils.isNullOrUndefined(requestPayload?.hashIds) &&
       requestPayload?.hashIds?.includes(this.chargingStation.stationInfo.hashId) === false
     ) {
       return;
     }
-    if (requestPayload?.hashId !== undefined) {
+    if (!Utils.isNullOrUndefined(requestPayload?.hashId)) {
       logger.error(
         `${this.chargingStation.logPrefix()} ${moduleName}.requestHandler: 'hashId' field usage in PDU is deprecated, use 'hashIds' array instead`
       );
@@ -274,8 +272,7 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne
     try {
       commandResponse = await this.commandHandler(command, requestPayload);
       if (
-        commandResponse === undefined ||
-        commandResponse === null ||
+        Utils.isNullOrUndefined(commandResponse) ||
         Utils.isEmptyObject(commandResponse as CommandResponse)
       ) {
         responsePayload = {