X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcharging-station%2Fui-server%2FUIServerUtils.ts;h=a4f3bf51dafd7d6aa3612412617a58a4cd5dfa93;hb=ba9a56a613727d96757690a8b52af6731f3fd8a8;hp=2056c2096fde585402c939700b32cd2b092b2e8d;hpb=66a7748ddeda8c94d7562a1ce58d440319654a4c;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 2056c209..a4f3bf51 100644 --- a/src/charging-station/ui-server/UIServerUtils.ts +++ b/src/charging-station/ui-server/UIServerUtils.ts @@ -49,12 +49,7 @@ export class UIServerUtils { } public static isLoopback (address: string): boolean { - // eslint-disable-next-line prefer-regex-literals - const isLoopbackRegExp = new RegExp( - // eslint-disable-next-line no-useless-escape - /^localhost$|^127(?:\.\d+){0,2}\.\d+$|^(?:0*\:)*?:?0*1$/, - 'i' - ) - return isLoopbackRegExp.test(address) + // eslint-disable-next-line no-useless-escape + return /^localhost$|^127(?:\.\d+){0,2}\.\d+$|^(?:0*\:)*?:?0*1$/i.test(address) } }