From: Jérôme Benoit Date: Sat, 3 Feb 2024 18:09:50 +0000 (+0100) Subject: refactor: silencer linter warnings X-Git-Tag: v1.2.35~26 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=1d6f2eb4f4c766283604e417bd34e16f18c8e997;p=e-mobility-charging-stations-simulator.git refactor: silencer linter warnings Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ocpp/OCPPServiceUtils.ts b/src/charging-station/ocpp/OCPPServiceUtils.ts index ddbec5f9..0a3935c4 100644 --- a/src/charging-station/ocpp/OCPPServiceUtils.ts +++ b/src/charging-station/ocpp/OCPPServiceUtils.ts @@ -1226,10 +1226,10 @@ const getMeasurandDefaultLocation = ( // eslint-disable-next-line @typescript-eslint/no-extraneous-class export class OCPPServiceUtils { - public static getMessageTypeString = getMessageTypeString - public static sendAndSetConnectorStatus = sendAndSetConnectorStatus - public static isIdTagAuthorized = isIdTagAuthorized - public static buildTransactionEndMeterValue = buildTransactionEndMeterValue + public static readonly getMessageTypeString = getMessageTypeString + public static readonly sendAndSetConnectorStatus = sendAndSetConnectorStatus + public static readonly isIdTagAuthorized = isIdTagAuthorized + public static readonly buildTransactionEndMeterValue = buildTransactionEndMeterValue protected static getSampledValueTemplate = getSampledValueTemplate protected static buildSampledValue = buildSampledValue diff --git a/src/charging-station/ui-server/UIServerUtils.ts b/src/charging-station/ui-server/UIServerUtils.ts index a4f3bf51..4d621172 100644 --- a/src/charging-station/ui-server/UIServerUtils.ts +++ b/src/charging-station/ui-server/UIServerUtils.ts @@ -9,7 +9,7 @@ export class UIServerUtils { // This is intentional } - public static handleProtocols = ( + public static readonly handleProtocols = ( protocols: Set, request: IncomingMessage ): string | false => { @@ -31,14 +31,16 @@ export class UIServerUtils { return false } - public static isProtocolAndVersionSupported = (protocolStr: string): boolean => { + public static readonly isProtocolAndVersionSupported = (protocolStr: string): boolean => { const [protocol, version] = UIServerUtils.getProtocolAndVersion(protocolStr) return ( Object.values(Protocol).includes(protocol) && Object.values(ProtocolVersion).includes(version) ) } - public static getProtocolAndVersion = (protocolStr: string): [Protocol, ProtocolVersion] => { + public static readonly getProtocolAndVersion = ( + protocolStr: string + ): [Protocol, ProtocolVersion] => { const protocolIndex = protocolStr.indexOf(Protocol.UI) const protocol = protocolStr.substring( protocolIndex,