Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
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
// 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)