Web UI: add and fix missing commands support
[e-mobility-charging-stations-simulator.git] / src / charging-station / ui-server / ui-services / AbstractUIService.ts
index db9a036d183054b7fd77cb98dda7ac0e3eb7626f..092742b718c6e294f44b5e83165f9633182d9292 100644 (file)
@@ -1,6 +1,7 @@
 import { RawData } from 'ws';
 
 import BaseError from '../../../exception/BaseError';
+import { Bootstrap } from '../../../internal';
 import { JsonType } from '../../../types/JsonType';
 import {
   ProcedureName,
@@ -13,10 +14,8 @@ import {
   ResponseStatus,
 } from '../../../types/UIProtocol';
 import logger from '../../../utils/Logger';
-import Utils from '../../../utils/Utils';
-import Bootstrap from '../../Bootstrap';
 import UIServiceWorkerBroadcastChannel from '../../UIServiceWorkerBroadcastChannel';
-import { AbstractUIServer } from '../AbstractUIServer';
+import type { AbstractUIServer } from '../AbstractUIServer';
 
 const moduleName = 'AbstractUIService';
 
@@ -119,8 +118,8 @@ export default abstract class AbstractUIService {
 
     const data = JSON.parse(rawData.toString()) as JsonType[];
 
-    if (Utils.isIterable(data) === false) {
-      throw new BaseError('UI protocol request is not iterable');
+    if (Array.isArray(data) === false) {
+      throw new BaseError('UI protocol request is not an array');
     }
 
     if (data.length !== 3) {