cidr-regex 7.0.0 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
const octet = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)";
|
|
3
3
|
const v4dotted = `${octet}(?:\\.${octet}){3}`;
|
|
4
4
|
const hex = "[\\dA-Fa-f]{1,4}";
|
|
5
|
+
const scopeIdRe = "(?:%[^\\s%/\\0]+)?";
|
|
5
6
|
const v4src = `${v4dotted}/(?:3[0-2]|[12]?\\d)`;
|
|
6
|
-
const v6src = `(?:(?:${hex}:){7}(?:${hex}|:)|(?:${hex}:){6}(?:${v4dotted}|:${hex}|:)|(?:${hex}:){5}(?::${v4dotted}|(?::${hex}){1,2}|:)|(?:${hex}:){4}(?:(?::${hex})?:${v4dotted}|(?::${hex}){1,3}|:)|(?:${hex}:){3}(?:(?::${hex}){0,2}:${v4dotted}|(?::${hex}){1,4}|:)|(?:${hex}:){2}(?:(?::${hex}){0,3}:${v4dotted}|(?::${hex}){1,5}|:)|${hex}:(?:(?::${hex}){0,4}:${v4dotted}|(?::${hex}){1,6}|:)|:(?:(?::${hex}){0,5}:${v4dotted}|(?::${hex}){1,7}|:))(
|
|
7
|
+
const v6src = `(?:(?:${hex}:){7}(?:${hex}|:)|(?:${hex}:){6}(?:${v4dotted}|:${hex}|:)|(?:${hex}:){5}(?::${v4dotted}|(?::${hex}){1,2}|:)|(?:${hex}:){4}(?:(?::${hex})?:${v4dotted}|(?::${hex}){1,3}|:)|(?:${hex}:){3}(?:(?::${hex}){0,2}:${v4dotted}|(?::${hex}){1,4}|:)|(?:${hex}:){2}(?:(?::${hex}){0,3}:${v4dotted}|(?::${hex}){1,5}|:)|${hex}:(?:(?::${hex}){0,4}:${v4dotted}|(?::${hex}){1,6}|:)|:(?:(?::${hex}){0,5}:${v4dotted}|(?::${hex}){1,7}|:))${scopeIdRe}/(?:12[0-8]|1[01]\\d|[1-9]?\\d)`;
|
|
7
8
|
const v6srcFast = `(?=[\\dA-Fa-f:])${v6src}`;
|
|
8
9
|
const v4exact = new RegExp(`^${v4src}$`);
|
|
9
10
|
const v6exact = new RegExp(`^${v6src}$`);
|