X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Fbroadcast-channel%2FWorkerBroadcastChannel.ts;h=9102b10009a7114597a3091f344357c0a6abea12;hb=08b58f0020986c0ad1b55e562aaf325a47b9d58c;hp=fd73b1bb59021ced8057ca4b85961dafbb860758;hpb=7671fa0be211e944f027ebd83f3a0ad64c2ef2d6;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/broadcast-channel/WorkerBroadcastChannel.ts b/src/charging-station/broadcast-channel/WorkerBroadcastChannel.ts index fd73b1bb..9102b100 100644 --- a/src/charging-station/broadcast-channel/WorkerBroadcastChannel.ts +++ b/src/charging-station/broadcast-channel/WorkerBroadcastChannel.ts @@ -6,7 +6,7 @@ import type { JsonType, MessageEvent, } from '../../types'; -import { Utils, logger } from '../../utils'; +import { logPrefix, logger, validateUUID } from '../../utils'; const moduleName = 'WorkerBroadcastChannel'; @@ -36,17 +36,17 @@ export abstract class WorkerBroadcastChannel extends BroadcastChannel { logger.error( `${this.logPrefix( moduleName, - 'validateMessageEvent' - )} Worker broadcast channel protocol message event data is not an array` + 'validateMessageEvent', + )} Worker broadcast channel protocol message event data is not an array`, ); return false; } - if (Utils.validateUUID(messageEvent.data[0]) === false) { + if (validateUUID(messageEvent.data[0]) === false) { logger.error( `${this.logPrefix( moduleName, - 'validateMessageEvent' - )} Worker broadcast channel protocol message event data UUID field is invalid` + 'validateMessageEvent', + )} Worker broadcast channel protocol message event data UUID field is invalid`, ); return false; } @@ -54,6 +54,6 @@ export abstract class WorkerBroadcastChannel extends BroadcastChannel { } private logPrefix = (modName: string, methodName: string): string => { - return Utils.logPrefix(` Worker Broadcast Channel | ${modName}.${methodName}:`); + return logPrefix(` Worker Broadcast Channel | ${modName}.${methodName}:`); }; }