cidr-regex 7.1.1 → 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 CHANGED
@@ -6,7 +6,7 @@
6
6
  ## Usage
7
7
 
8
8
  ```sh
9
- $ npm i cidr-regex
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
@@ -15,14 +15,12 @@ export 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
- var _a: (opts?: CidrRegexOptions) => RegExp;
21
- export { _a as v4 };
22
- export var _b: (opts?: CidrRegexOptions) => RegExp;
23
- export { _b as v6 };
22
+ export { v4 };
23
+ export { v6 };
24
24
  }
25
- export declare const v4: (opts?: CidrRegexOptions) => RegExp;
26
- export declare const v6: (opts?: CidrRegexOptions) => RegExp;
27
25
  //#endregion
28
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
- const v4 = cidrRegex.v4 = (opts = {}) => regexFor(V4, opts);
39
- const v6 = cidrRegex.v6 = (opts = {}) => regexFor(V6, opts);
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.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": [
@@ -36,19 +36,18 @@
36
36
  "node": ">=22"
37
37
  },
38
38
  "devDependencies": {
39
- "@types/node": "26.6.2",
39
+ "@types/node": "26.6.3",
40
40
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
41
41
  "eslint": "10.11.0",
42
- "eslint-config-silverwind": "151.0.0",
43
- "jest-extended": "7.0.0",
42
+ "eslint-config-silverwind": "151.0.1",
44
43
  "tsdown": "0.23.0",
45
- "tsdown-config-silverwind": "4.1.1",
44
+ "tsdown-config-silverwind": "4.1.2",
46
45
  "typescript": "6.0.3",
47
- "typescript-config-silverwind": "21.0.0",
48
- "updates": "19.0.0",
49
- "updates-config-silverwind": "4.0.6",
50
- "versions": "15.5.0",
46
+ "typescript-config-silverwind": "21.0.1",
47
+ "updates": "19.0.2",
48
+ "updates-config-silverwind": "4.0.7",
49
+ "versions": "15.5.1",
51
50
  "vitest": "5.0.2",
52
- "vitest-config-silverwind": "12.0.4"
51
+ "vitest-config-silverwind": "12.0.5"
53
52
  }
54
53
  }