refactor: silencer linter warnings
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 3 Feb 2024 18:09:50 +0000 (19:09 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 3 Feb 2024 18:09:50 +0000 (19:09 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ocpp/OCPPServiceUtils.ts
src/charging-station/ui-server/UIServerUtils.ts

index ddbec5f9272f64702fb0ce15ae0a9f9b50f4d67f..0a3935c4130e408631e5b800b9432bc2229e42cd 100644 (file)
@@ -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
 
index a4f3bf51dafd7d6aa3612412617a58a4cd5dfa93..4d621172b94e7875f6c6bfd683ebd3050f68ec42 100644 (file)
@@ -9,7 +9,7 @@ export class UIServerUtils {
     // This is intentional
   }
 
-  public static handleProtocols = (
+  public static readonly handleProtocols = (
     protocols: Set<string>,
     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,