cidr-regex 7.1.0 → 7.1.2
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/README.md +1 -3
- package/dist/index.d.ts +6 -8
- package/dist/index.js +4 -2
- package/package.json +13 -14
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
## Usage
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
|
-
|
|
9
|
+
pnpm add cidr-regex
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
```js
|
|
@@ -69,8 +69,6 @@ The options object has the following properties:
|
|
|
69
69
|
- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address
|
|
70
70
|
- [cidr-tools](https://github.com/silverwind/cidr-tools) - Tools to work with IPv4 and IPv6 CIDR network lists
|
|
71
71
|
|
|
72
|
-
## License
|
|
73
|
-
|
|
74
72
|
© [silverwind](https://github.com/silverwind), distributed under BSD licence
|
|
75
73
|
|
|
76
74
|
Based on previous work by [Felipe Apostol](https://github.com/flipjs)
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region index.d.ts
|
|
2
|
-
type CidrRegexOptions = {
|
|
2
|
+
export type CidrRegexOptions = {
|
|
3
3
|
/**
|
|
4
4
|
Only match an exact string. Useful with `RegExp#test()` to check if a string is an IP address. *(`false` matches any IP address in a string)*
|
|
5
5
|
|
|
@@ -15,14 +15,12 @@ type CidrRegexOptions = {
|
|
|
15
15
|
*/
|
|
16
16
|
readonly prefix?: "required" | "optional" | "none";
|
|
17
17
|
};
|
|
18
|
+
export declare const v4: (opts?: CidrRegexOptions) => RegExp;
|
|
19
|
+
export declare const v6: (opts?: CidrRegexOptions) => RegExp;
|
|
18
20
|
declare function cidrRegex(opts?: CidrRegexOptions): RegExp;
|
|
19
21
|
declare namespace cidrRegex {
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
export var _b: (opts?: CidrRegexOptions) => RegExp;
|
|
23
|
-
export { _b as v6 };
|
|
22
|
+
export { v4 };
|
|
23
|
+
export { v6 };
|
|
24
24
|
}
|
|
25
|
-
declare const v4: (opts?: CidrRegexOptions) => RegExp;
|
|
26
|
-
declare const v6: (opts?: CidrRegexOptions) => RegExp;
|
|
27
25
|
//#endregion
|
|
28
|
-
export {
|
|
26
|
+
export { cidrRegex as default };
|
package/dist/index.js
CHANGED
|
@@ -34,9 +34,11 @@ function regexFor(family, { exact, prefix = "required" }) {
|
|
|
34
34
|
if (!exact) re.lastIndex = 0;
|
|
35
35
|
return re;
|
|
36
36
|
}
|
|
37
|
+
const v4 = (opts = {}) => regexFor(V4, opts);
|
|
38
|
+
const v6 = (opts = {}) => regexFor(V6, opts);
|
|
37
39
|
const cidrRegex = (opts = {}) => regexFor(V46, opts);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
cidrRegex.v4 = v4;
|
|
41
|
+
cidrRegex.v6 = v6;
|
|
40
42
|
|
|
41
43
|
//#endregion
|
|
42
44
|
export { cidrRegex as default, v4, v6 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cidr-regex",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.2",
|
|
4
4
|
"description": "Regular expression for matching IP addresses in CIDR notation and bare IP addresses",
|
|
5
5
|
"author": "silverwind <me@silverwind.io>",
|
|
6
6
|
"contributors": [
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
],
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "silverwind/cidr-regex"
|
|
11
|
+
"url": "git+https://github.com/silverwind/cidr-regex.git"
|
|
12
12
|
},
|
|
13
13
|
"keywords": [
|
|
14
14
|
"cidr",
|
|
@@ -36,19 +36,18 @@
|
|
|
36
36
|
"node": ">=22"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@types/node": "26.
|
|
39
|
+
"@types/node": "26.6.3",
|
|
40
40
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
41
|
-
"eslint": "10.
|
|
42
|
-
"eslint-config-silverwind": "
|
|
43
|
-
"
|
|
44
|
-
"tsdown": "
|
|
45
|
-
"tsdown-config-silverwind": "4.0.3",
|
|
41
|
+
"eslint": "10.11.0",
|
|
42
|
+
"eslint-config-silverwind": "151.0.1",
|
|
43
|
+
"tsdown": "0.23.0",
|
|
44
|
+
"tsdown-config-silverwind": "4.1.2",
|
|
46
45
|
"typescript": "6.0.3",
|
|
47
|
-
"typescript-config-silverwind": "
|
|
48
|
-
"updates": "
|
|
49
|
-
"updates-config-silverwind": "4.0.
|
|
50
|
-
"versions": "15.
|
|
51
|
-
"vitest": "
|
|
52
|
-
"vitest-config-silverwind": "
|
|
46
|
+
"typescript-config-silverwind": "21.0.1",
|
|
47
|
+
"updates": "19.0.2",
|
|
48
|
+
"updates-config-silverwind": "4.0.7",
|
|
49
|
+
"versions": "15.5.1",
|
|
50
|
+
"vitest": "5.0.2",
|
|
51
|
+
"vitest-config-silverwind": "12.0.5"
|
|
53
52
|
}
|
|
54
53
|
}
|