cidr-tools 5.1.1 → 5.1.3

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.js +2 -4
  2. package/package.json +20 -20
package/index.js CHANGED
@@ -27,10 +27,8 @@ function doNormalize(cidr) {
27
27
  const {start, prefix, single, version} = parse(cidr);
28
28
  if (!single) { // cidr
29
29
  // set network address to first address
30
- const addr = normalizeIp(stringifyIp({number: start, version}));
31
- return `${addr}/${prefix}`;
30
+ return `${normalizeIp(stringifyIp({number: start, version}))}/${prefix}`;
32
31
  } else { // single ip
33
- if (!version) throw new Error(`Invalid network: ${cidr}`);
34
32
  return normalizeIp(cidr);
35
33
  }
36
34
  }
@@ -147,7 +145,7 @@ function excludeNets(a, b, v) {
147
145
 
148
146
  const remaining = [];
149
147
  for (const part of parts) {
150
- for (const subpart of subparts(part, v)) {
148
+ for (const subpart of subparts(part)) {
151
149
  remaining.push(formatPart(subpart, v));
152
150
  }
153
151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cidr-tools",
3
- "version": "5.1.1",
3
+ "version": "5.1.3",
4
4
  "author": "silverwind <me@silverwind.io>",
5
5
  "description": "Tools to work with IPv4 and IPv6 CIDR network lists",
6
6
  "repository": "silverwind/cidr-tools",
@@ -11,18 +11,6 @@
11
11
  "engines": {
12
12
  "node": ">=14"
13
13
  },
14
- "keywords": [
15
- "cidr",
16
- "ip",
17
- "network",
18
- "cidr-tools",
19
- "address",
20
- "ipv4",
21
- "ipv6",
22
- "merge",
23
- "exclude",
24
- "expand"
25
- ],
26
14
  "files": [
27
15
  "index.js",
28
16
  "index.d.ts"
@@ -30,15 +18,27 @@
30
18
  "types": "./index.d.ts",
31
19
  "dependencies": {
32
20
  "cidr-regex": "4.0.2",
33
- "ip-bigint": "5.0.3",
21
+ "ip-bigint": "6.0.0",
34
22
  "ip-regex": "5.0.0",
35
23
  "string-natural-compare": "3.0.1"
36
24
  },
37
25
  "devDependencies": {
38
- "eslint": "8.23.1",
39
- "eslint-config-silverwind": "54.0.2",
40
- "jest": "29.0.3",
41
- "updates": "13.1.7",
42
- "versions": "9.3.2"
43
- }
26
+ "eslint": "8.29.0",
27
+ "eslint-config-silverwind": "64.0.2",
28
+ "updates": "13.2.4",
29
+ "versions": "10.4.1",
30
+ "vitest": "0.25.8"
31
+ },
32
+ "keywords": [
33
+ "cidr",
34
+ "ip",
35
+ "network",
36
+ "cidr-tools",
37
+ "address",
38
+ "ipv4",
39
+ "ipv6",
40
+ "merge",
41
+ "exclude",
42
+ "expand"
43
+ ]
44
44
  }