feat!: handle Set at JSON serialization to string
[e-mobility-charging-stations-simulator.git] / src / charging-station / ui-server / UIWebSocketServer.ts
index 29a6567549105a7cc8e202b9249c99c8fa6b4200..bf0a6c444749201fe06d2cdcc6f24b10fa09582a 100644 (file)
@@ -5,6 +5,7 @@ import { StatusCodes } from 'http-status-codes'
 import { type RawData, WebSocket, WebSocketServer } from 'ws'
 
 import {
+  MapStringifyFormat,
   type ProtocolRequest,
   type ProtocolResponse,
   type UIServerConfiguration,
@@ -14,7 +15,7 @@ import {
   Constants,
   getWebSocketCloseEventStatusString,
   isNotEmptyString,
-  JSONStringifyWithMapSupport,
+  JSONStringify,
   logger,
   logPrefix,
   validateUUID
@@ -136,7 +137,7 @@ export class UIWebSocketServer extends AbstractUIServer {
       if (this.hasResponseHandler(responseId)) {
         const ws = this.responseHandlers.get(responseId) as WebSocket
         if (ws.readyState === WebSocket.OPEN) {
-          ws.send(JSONStringifyWithMapSupport(response))
+          ws.send(JSONStringify(response, undefined, MapStringifyFormat.object))
         } else {
           logger.error(
             `${this.logPrefix(