cidr-regex 4.1.0 → 4.1.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 +6 -4
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import ipRegex from
|
|
2
|
-
|
|
1
|
+
import ipRegex from "ip-regex";
|
|
3
2
|
const defaultOpts = { exact: false };
|
|
4
3
|
const v4str = `${ipRegex.v4().source}\\/(3[0-2]|[12]?[0-9])`;
|
|
5
4
|
const v6str = `${ipRegex.v6().source}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`;
|
|
@@ -9,5 +8,8 @@ const v46exact = new RegExp(`(?:^${v4str}$)|(?:^${v6str}$)`);
|
|
|
9
8
|
const cidrRegex = ({ exact } = defaultOpts) => exact ? v46exact : new RegExp(`(?:${v4str})|(?:${v6str})`, "g");
|
|
10
9
|
const v4 = cidrRegex.v4 = ({ exact } = defaultOpts) => exact ? v4exact : new RegExp(v4str, "g");
|
|
11
10
|
const v6 = cidrRegex.v6 = ({ exact } = defaultOpts) => exact ? v6exact : new RegExp(v6str, "g");
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
export {
|
|
12
|
+
cidrRegex as default,
|
|
13
|
+
v4,
|
|
14
|
+
v6
|
|
15
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cidr-regex",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Regular expression for matching IP addresses in CIDR notation",
|
|
5
5
|
"author": "silverwind <me@silverwind.io>",
|
|
6
6
|
"contributors": [
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"eslint": "8.57.0",
|
|
28
28
|
"eslint-config-silverwind": "85.1.4",
|
|
29
29
|
"eslint-config-silverwind-typescript": "3.2.7",
|
|
30
|
-
"tsd": "0.31.0",
|
|
31
30
|
"typescript": "5.4.5",
|
|
32
31
|
"typescript-config-silverwind": "4.3.2",
|
|
33
32
|
"updates": "16.1.1",
|