From 664ba1dde7b64ea9f9a262a31dec9aa91c6a92f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 25 Jul 2024 21:17:48 +0200 Subject: [PATCH] refactor: silence two linter errors 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 ++-- src/charging-station/IdTagsCache.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/charging-station/Helpers.ts b/src/charging-station/Helpers.ts index d40bce23..e8ef83c4 100644 --- a/src/charging-station/Helpers.ts +++ b/src/charging-station/Helpers.ts @@ -1314,8 +1314,8 @@ const getRandomSerialNumberSuffix = (params?: { randomBytesLength?: number upperCase?: boolean }): string => { - const randomSerialNumberSuffix = randomBytes(params.randomBytesLength ?? 16).toString('hex') - if (params.upperCase) { + const randomSerialNumberSuffix = randomBytes(params?.randomBytesLength ?? 16).toString('hex') + if (params?.upperCase) { return randomSerialNumberSuffix.toUpperCase() } return randomSerialNumberSuffix diff --git a/src/charging-station/IdTagsCache.ts b/src/charging-station/IdTagsCache.ts index 60fa9c4c..71e038be 100644 --- a/src/charging-station/IdTagsCache.ts +++ b/src/charging-station/IdTagsCache.ts @@ -50,7 +50,7 @@ export class IdTagsCache { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const hashId = chargingStation.stationInfo!.hashId // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const idTagsFile = getIdTagsFile(chargingStation.stationInfo)! + const idTagsFile = getIdTagsFile(chargingStation.stationInfo!)! switch (distribution) { case IdTagDistribution.RANDOM: return this.getRandomIdTag(hashId, idTagsFile) -- 2.34.1