refactor: cleanup unneeded type casting
[e-mobility-charging-stations-simulator.git] / src / charging-station / ui-server / UIServerUtils.ts
index 2056c2096fde585402c939700b32cd2b092b2e8d..a4f3bf51dafd7d6aa3612412617a58a4cd5dfa93 100644 (file)
@@ -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)
   }
 }