From 8d2adfaae78b26983551ef0506fa5e04154a6494 Mon Sep 17 00:00:00 2001 From: Callum Fraser Date: Tue, 15 May 2018 23:48:18 +0100 Subject: [PATCH] Updated the Ip core file with more required functions/variables --- src/core/lib/Ip.mjs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/core/lib/Ip.mjs b/src/core/lib/Ip.mjs index 66a713c7..e844562e 100644 --- a/src/core/lib/Ip.mjs +++ b/src/core/lib/Ip.mjs @@ -390,9 +390,19 @@ export function _genIpv6Mask(cidr) { return mask; } - /** - * @constant - * @default - * @private - */ +/** +* @constant +* @default +* @private +*/ const _LARGE_RANGE_ERROR = "The specified range contains more than 65,536 addresses. Running this query could crash your browser. If you want to run it, select the \"Allow large queries\" option. You are advised to turn off \"Auto Bake\" whilst editing large ranges."; +/** +* @constant +* @default +*/ +export const IPV4_REGEX = /^\s*((?:\d{1,3}\.){3}\d{1,3})\s*$/; +/** +* @constant +* @default +*/ +export const IPV6_REGEX = /^\s*(((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\4)::|:\b|(?![\dA-F])))|(?!\3\4)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4}))\s*$/i;