refactor: cleanup null checks and helpers
[e-mobility-charging-stations-simulator.git] / ui / web / src / composables / UIClient.ts
index c2f1b0c21bff809e568ef386b612c3fba5812e02..ccd16c215565855d99ec0fa400bb7da0f8dd89bc 100644 (file)
@@ -1,4 +1,4 @@
-import Utils from './Utils';
+import { promiseWithTimeout } from './Utils';
 import {
   ProcedureName,
   type ProtocolResponse,
@@ -128,7 +128,7 @@ export default class UIClient {
     id: string,
     procedureName: ProcedureName,
     resolve: (value: ResponsePayload | PromiseLike<ResponsePayload>) => void,
-    reject: (reason?: any) => void
+    reject: (reason?: unknown) => void
   ): void {
     this.responseHandlers.set(id, { procedureName, resolve, reject });
   }
@@ -146,7 +146,7 @@ export default class UIClient {
     data: RequestPayload
   ): Promise<ResponsePayload> {
     let uuid: string;
-    return Utils.promiseWithTimeout(
+    return promiseWithTimeout(
       new Promise((resolve, reject) => {
         uuid = crypto.randomUUID();
         const msg = JSON.stringify([uuid, command, data]);