From: Jérôme Benoit Date: Mon, 7 Aug 2023 22:27:51 +0000 (+0200) Subject: refactor: remove unneeded backward compatibility code X-Git-Tag: v1.2.20~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=4fa476b70ba0110845cd9f55372afb6b6b03b8f6;p=e-mobility-charging-stations-simulator.git refactor: remove unneeded backward compatibility code Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 1e3cebf5..b037bc30 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -364,11 +364,7 @@ export class ChargingStation { } public getMaximumPower(stationInfo?: ChargingStationInfo): number { - const localStationInfo = stationInfo ?? this.stationInfo; - return ( - (localStationInfo?.['maxPower' as keyof ChargingStationInfo] as number) ?? - localStationInfo.maximumPower - ); + return (stationInfo ?? this.stationInfo).maximumPower!; } public getConnectorMaximumAvailablePower(connectorId: number): number {