feat: add performance statistics to UI protocol
[e-mobility-charging-stations-simulator.git] / src / utils / Utils.ts
index ae27035ff079c028f30bee9884d5b2de5521c18a..cff63715719b07d254b045c133a9be2170e01291 100644 (file)
@@ -16,6 +16,7 @@ import {
 import { Constants } from './Constants.js'
 import {
   type EmptyObject,
+  type ProtocolResponse,
   type TimestampedData,
   WebSocketCloseEventStatusString
 } from '../types/index.js'
@@ -343,8 +344,12 @@ export const secureRandom = (): number => {
 }
 
 export const JSONStringifyWithMapSupport = (
-  object: Record<string, unknown> | Array<Record<string, unknown>> | Map<unknown, unknown>,
-  space?: number
+  object:
+  | Record<string, unknown>
+  | Array<Record<string, unknown>>
+  | Map<unknown, unknown>
+  | ProtocolResponse,
+  space?: string | number
 ): string => {
   return JSON.stringify(
     object,