cidr-regex 4.0.4 → 4.0.5

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.
Files changed (2) hide show
  1. package/index.d.ts +25 -19
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -17,27 +17,33 @@ export function v4(options?: Options): RegExp;
17
17
  */
18
18
  export function v6(options?: Options): RegExp;
19
19
 
20
- /**
21
- Regular expression for matching IP addresses in CIDR notation
20
+ declare const _default: {
22
21
 
23
- @returns A regex for matching both IPv4 and IPv6 CIDRs.
22
+ /**
23
+ Regular expression for matching IP addresses in CIDR notation
24
24
 
25
- @example
26
- ```
27
- // Contains a CIDR IP address?
28
- cidrRegex().test("foo 192.168.0.1/24");
29
- //=> true
25
+ @returns A regex for matching both IPv4 and IPv6 CIDRs.
30
26
 
31
- // Is a CIDR IP address?
32
- cidrRegex({exact: true}).test("foo 192.168.0.1/24");
33
- //=> false
27
+ @example
28
+ ```
29
+ // Contains a CIDR IP address?
30
+ cidrRegex().test("foo 192.168.0.1/24");
31
+ //=> true
34
32
 
35
- cidrRegex.v6({exact: true}).test("1:2:3:4:5:6:7:8/64");
36
- //=> true
33
+ // Is a CIDR IP address?
34
+ cidrRegex({exact: true}).test("foo 192.168.0.1/24");
35
+ //=> false
37
36
 
38
- // Extract CIDRs from string
39
- "foo 192.168.0.1/24 bar 1:2:3:4:5:6:7:8/64 baz".match(cidrRegex());
40
- //=> ["192.168.0.1/24", "1:2:3:4:5:6:7:8/64"]
41
- ```
42
- */
43
- export default function cidrRegex(options?: Options): RegExp;
37
+ cidrRegex.v6({exact: true}).test("1:2:3:4:5:6:7:8/64");
38
+ //=> true
39
+
40
+ // Extract CIDRs from string
41
+ "foo 192.168.0.1/24 bar 1:2:3:4:5:6:7:8/64 baz".match(cidrRegex());
42
+ //=> ["192.168.0.1/24", "1:2:3:4:5:6:7:8/64"]
43
+ ```
44
+ */
45
+ (options?: Options): RegExp,
46
+ v4: typeof v4;
47
+ v6: typeof v6;
48
+ };
49
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cidr-regex",
3
- "version": "4.0.4",
3
+ "version": "4.0.5",
4
4
  "description": "Regular expression for matching IP addresses in CIDR notation",
5
5
  "author": "silverwind <me@silverwind.io>",
6
6
  "contributors": [