Cleanup Array.from() usage
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 29 Aug 2022 19:32:00 +0000 (21:32 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 29 Aug 2022 19:32:00 +0000 (21:32 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/MessageChannelUtils.ts
src/charging-station/ui-server/ui-services/AbstractUIService.ts

index 2371dd3df8a1146f6d0961ca26629dcba35aade8..9a88d17266dfdc4dceeab44930e5732e2109ad75 100644 (file)
@@ -55,7 +55,7 @@ export class MessageChannelUtils {
       stationInfo: chargingStation.stationInfo,
       stopped: chargingStation.stopped,
       bootNotificationResponse: chargingStation.bootNotificationResponse,
-      connectors: Array.from(chargingStation.connectors.values()).map(
+      connectors: [...chargingStation.connectors.values()].map(
         // eslint-disable-next-line @typescript-eslint/no-unused-vars
         ({ transactionSetInterval, ...connectorStatusRest }) => connectorStatusRest
       ),
index e72af5c0549fa1feb2f4c9bfd66225f53fe76e27..1e0f2a92e0a9f3189f969428c6eb8fda59a7837a 100644 (file)
@@ -118,7 +118,7 @@ export default abstract class AbstractUIService {
     // TODO: remove cast to unknown
     return {
       status: ResponseStatus.SUCCESS,
-      ...Array.from(this.uiServer.chargingStations.values()),
+      ...[...this.uiServer.chargingStations.values()],
     } as unknown as ResponsePayload;
   }