From: Jérôme Benoit Date: Mon, 29 Aug 2022 19:32:00 +0000 (+0200) Subject: Cleanup Array.from() usage X-Git-Tag: v1.1.69~16 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=bbc6c09253da8c84496ef229c27c404a1d69ebfb;p=e-mobility-charging-stations-simulator.git Cleanup Array.from() usage Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/MessageChannelUtils.ts b/src/charging-station/MessageChannelUtils.ts index 2371dd3d..9a88d172 100644 --- a/src/charging-station/MessageChannelUtils.ts +++ b/src/charging-station/MessageChannelUtils.ts @@ -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 ), diff --git a/src/charging-station/ui-server/ui-services/AbstractUIService.ts b/src/charging-station/ui-server/ui-services/AbstractUIService.ts index e72af5c0..1e0f2a92 100644 --- a/src/charging-station/ui-server/ui-services/AbstractUIService.ts +++ b/src/charging-station/ui-server/ui-services/AbstractUIService.ts @@ -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; }