From f1bd9d1970f24c8234582c82fcd58c806391b78b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 26 Nov 2023 23:55:02 +0100 Subject: [PATCH] refactor: cleanup undefined handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/Helpers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/charging-station/Helpers.ts b/src/charging-station/Helpers.ts index ce0ba3e3..13721bd6 100644 --- a/src/charging-station/Helpers.ts +++ b/src/charging-station/Helpers.ts @@ -76,7 +76,7 @@ export const getChargingStationId = ( index: number, stationTemplate: ChargingStationTemplate | undefined, ): string => { - if (isUndefined(stationTemplate)) { + if (stationTemplate === undefined) { return "Unknown 'chargingStationId'"; } // In case of multiple instances: add instance index to charging station id @@ -85,7 +85,7 @@ export const getChargingStationId = ( const idStr = `000000000${index.toString()}`; return stationTemplate?.fixedName ? stationTemplate.baseName - : `${stationTemplate?.baseName}-${instanceIndex.toString()}${idStr.substring( + : `${stationTemplate.baseName}-${instanceIndex.toString()}${idStr.substring( idStr.length - 4, )}${idSuffix}`; }; -- 2.34.1