X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Fui-server%2FUIServerUtils.ts;h=4d621172b94e7875f6c6bfd683ebd3050f68ec42;hb=1d6f2eb4f4c766283604e417bd34e16f18c8e997;hp=a4f3bf51dafd7d6aa3612412617a58a4cd5dfa93;hpb=bbb339cc4034016235193fa39d905ed0540b50f7;p=e-mobility-charging-stations-simulator.git 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,