Skip to content

Commit 2508a83

Browse files
committed
deps: is-cidr@5.1.0
1 parent 6278fe4 commit 2508a83

File tree

8 files changed

+77
-58
lines changed

8 files changed

+77
-58
lines changed

node_modules/cidr-regex/dist/index.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import ipRegex from "ip-regex";
2+
const defaultOpts = { exact: false };
3+
const v4str = `${ipRegex.v4().source}\\/(3[0-2]|[12]?[0-9])`;
4+
const v6str = `${ipRegex.v6().source}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`;
5+
const v4exact = new RegExp(`^${v4str}$`);
6+
const v6exact = new RegExp(`^${v6str}$`);
7+
const v46exact = new RegExp(`(?:^${v4str}$)|(?:^${v6str}$)`);
8+
const cidrRegex = ({ exact } = defaultOpts) => exact ? v46exact : new RegExp(`(?:${v4str})|(?:${v6str})`, "g");
9+
const v4 = cidrRegex.v4 = ({ exact } = defaultOpts) => exact ? v4exact : new RegExp(v4str, "g");
10+
const v6 = cidrRegex.v6 = ({ exact } = defaultOpts) => exact ? v6exact : new RegExp(v6str, "g");
11+
export {
12+
cidrRegex as default,
13+
v4,
14+
v6
15+
};

node_modules/cidr-regex/index.js

-15
This file was deleted.

node_modules/cidr-regex/package.json

+19-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cidr-regex",
3-
"version": "4.0.5",
3+
"version": "4.1.1",
44
"description": "Regular expression for matching IP addresses in CIDR notation",
55
"author": "silverwind <me@silverwind.io>",
66
"contributors": [
@@ -9,25 +9,32 @@
99
"repository": "silverwind/cidr-regex",
1010
"license": "BSD-2-Clause",
1111
"type": "module",
12-
"exports": "./index.js",
1312
"sideEffects": false,
13+
"main": "./dist/index.js",
14+
"exports": "./dist/index.js",
15+
"types": "./dist/index.d.ts",
16+
"files": [
17+
"dist"
18+
],
1419
"engines": {
1520
"node": ">=14"
1621
},
17-
"files": [
18-
"index.js",
19-
"index.d.ts"
20-
],
2122
"dependencies": {
2223
"ip-regex": "^5.0.0"
2324
},
2425
"devDependencies": {
26+
"@types/node": "20.12.12",
2527
"eslint": "8.57.0",
26-
"eslint-config-silverwind": "83.0.1",
27-
"tsd": "0.31.0",
28-
"updates": "16.0.0",
29-
"versions": "12.0.1",
30-
"vitest": "1.4.0",
31-
"vitest-config-silverwind": "7.0.3"
28+
"eslint-config-silverwind": "85.1.4",
29+
"eslint-config-silverwind-typescript": "3.2.7",
30+
"typescript": "5.4.5",
31+
"typescript-config-silverwind": "4.3.2",
32+
"updates": "16.1.1",
33+
"versions": "12.0.2",
34+
"vite": "5.2.11",
35+
"vite-config-silverwind": "1.1.2",
36+
"vite-plugin-dts": "3.9.1",
37+
"vitest": "1.6.0",
38+
"vitest-config-silverwind": "9.0.6"
3239
}
3340
}

node_modules/is-cidr/dist/index.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { v4 as v4$1, v6 as v6$1 } from "cidr-regex";
2+
const re4 = v4$1({ exact: true });
3+
const re6 = v6$1({ exact: true });
4+
const isCidr = (str) => re4.test(str) ? 4 : re6.test(str) ? 6 : 0;
5+
const v4 = isCidr.v4 = (str) => re4.test(str);
6+
const v6 = isCidr.v6 = (str) => re6.test(str);
7+
export {
8+
isCidr as default,
9+
v4,
10+
v6
11+
};

node_modules/is-cidr/index.js

-9
This file was deleted.

node_modules/is-cidr/package.json

+20-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "is-cidr",
3-
"version": "5.0.5",
3+
"version": "5.1.0",
44
"description": "Check if a string is an IP address in CIDR notation",
55
"author": "silverwind <me@silverwind.io>",
66
"contributors": [
@@ -9,25 +9,32 @@
99
"repository": "silverwind/is-cidr",
1010
"license": "BSD-2-Clause",
1111
"type": "module",
12-
"exports": "./index.js",
1312
"sideEffects": false,
13+
"main": "./dist/index.js",
14+
"exports": "./dist/index.js",
15+
"types": "./dist/index.d.ts",
16+
"files": [
17+
"dist"
18+
],
1419
"engines": {
1520
"node": ">=14"
1621
},
17-
"files": [
18-
"index.js",
19-
"index.d.ts"
20-
],
2122
"dependencies": {
22-
"cidr-regex": "^4.0.4"
23+
"cidr-regex": "^4.1.1"
2324
},
2425
"devDependencies": {
26+
"@types/node": "20.12.12",
2527
"eslint": "8.57.0",
26-
"eslint-config-silverwind": "83.0.1",
27-
"tsd": "0.31.0",
28-
"updates": "16.0.0",
29-
"versions": "12.0.1",
30-
"vitest": "1.4.0",
31-
"vitest-config-silverwind": "7.0.3"
28+
"eslint-config-silverwind": "85.1.4",
29+
"eslint-config-silverwind-typescript": "3.2.7",
30+
"typescript": "5.4.5",
31+
"typescript-config-silverwind": "4.3.2",
32+
"updates": "16.1.1",
33+
"versions": "12.0.2",
34+
"vite": "5.2.11",
35+
"vite-config-silverwind": "1.1.2",
36+
"vite-plugin-dts": "3.9.1",
37+
"vitest": "1.6.0",
38+
"vitest-config-silverwind": "9.0.6"
3239
}
3340
}

package-lock.json

+11-8
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
"hosted-git-info": "^7.0.2",
110110
"ini": "^4.1.3",
111111
"init-package-json": "^6.0.3",
112-
"is-cidr": "^5.0.5",
112+
"is-cidr": "^5.1.0",
113113
"json-parse-even-better-errors": "^3.0.2",
114114
"libnpmaccess": "^8.0.6",
115115
"libnpmdiff": "^6.1.2",
@@ -3056,10 +3056,11 @@
30563056
}
30573057
},
30583058
"node_modules/cidr-regex": {
3059-
"version": "4.0.5",
3060-
"resolved": "https://registry.npmjs.org/cidr-regex/-/cidr-regex-4.0.5.tgz",
3061-
"integrity": "sha512-gljhROSwEnEvC+2lKqfkv1dU2v46h8Cwob19LlfGeGRMDLuwFD5+3D6+/vaa9/QrVLDASiSQ2OYQwzzjQ5I57A==",
3059+
"version": "4.1.1",
3060+
"resolved": "https://registry.npmjs.org/cidr-regex/-/cidr-regex-4.1.1.tgz",
3061+
"integrity": "sha512-ekKcVp+iRB9zlKFXyx7io7nINgb0oRjgRdXNEodp1OuxRui8FXr/CA40Tz1voWUp9DPPrMyQKy01vJhDo4N1lw==",
30623062
"inBundle": true,
3063+
"license": "BSD-2-Clause",
30633064
"dependencies": {
30643065
"ip-regex": "^5.0.0"
30653066
},
@@ -6151,6 +6152,7 @@
61516152
"resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-5.0.0.tgz",
61526153
"integrity": "sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==",
61536154
"inBundle": true,
6155+
"license": "MIT",
61546156
"engines": {
61556157
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
61566158
},
@@ -6260,12 +6262,13 @@
62606262
}
62616263
},
62626264
"node_modules/is-cidr": {
6263-
"version": "5.0.5",
6264-
"resolved": "https://registry.npmjs.org/is-cidr/-/is-cidr-5.0.5.tgz",
6265-
"integrity": "sha512-zDlCvz2v8dBpumuGD4/fc7wzFKY6UYOvFW29JWSstdJoByGN3TKwS0tFA9VWc7DM01VOVOn/DaR84D8Mihp9Rg==",
6265+
"version": "5.1.0",
6266+
"resolved": "https://registry.npmjs.org/is-cidr/-/is-cidr-5.1.0.tgz",
6267+
"integrity": "sha512-OkVS+Ht2ssF27d48gZdB+ho1yND1VbkJRKKS6Pc1/Cw7uqkd9IOJg8/bTwBDQL6tfBhSdguPRnlGiE8pU/X5NQ==",
62666268
"inBundle": true,
6269+
"license": "BSD-2-Clause",
62676270
"dependencies": {
6268-
"cidr-regex": "^4.0.4"
6271+
"cidr-regex": "^4.1.1"
62696272
},
62706273
"engines": {
62716274
"node": ">=14"

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"hosted-git-info": "^7.0.2",
7575
"ini": "^4.1.3",
7676
"init-package-json": "^6.0.3",
77-
"is-cidr": "^5.0.5",
77+
"is-cidr": "^5.1.0",
7878
"json-parse-even-better-errors": "^3.0.2",
7979
"libnpmaccess": "^8.0.6",
8080
"libnpmdiff": "^6.1.2",

0 commit comments

Comments
 (0)