From de1ec47bb99940a7abecd36a5ee6db6cd320f1f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 8 Mar 2022 20:37:19 +0100 Subject: [PATCH] Replace deprecated string helper usage MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStation.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; } -- 2.34.1