From: Jérôme Benoit Date: Tue, 8 Mar 2022 19:37:19 +0000 (+0100) Subject: Replace deprecated string helper usage X-Git-Tag: v1.1.53~8 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=de1ec47bb99940a7abecd36a5ee6db6cd320f1f1;p=e-mobility-charging-stations-simulator.git Replace deprecated string helper usage Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index ebd77f83..76efaf55 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -653,14 +653,13 @@ export default class ChargingStation { // In case of multiple instances: add instance index to charging station id const instanceIndex = process.env.CF_INSTANCE_INDEX ?? 0; const idSuffix = stationTemplate.nameSuffix ?? ''; + const idStr = '000000000' + this.index.toString(); return stationTemplate.fixedName ? stationTemplate.baseName : stationTemplate.baseName + '-' + instanceIndex.toString() + - ('000000000' + this.index.toString()).substr( - ('000000000' + this.index.toString()).length - 4 - ) + + idStr.substring(idStr.length - 4) + idSuffix; }