ip-utilties 1.3.0 → 1.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ip-utilties",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -12,12 +12,12 @@
12
12
  },
13
13
  "description": "ip v4/v6 utility functions",
14
14
  "keywords": [
15
+ "cidr",
15
16
  "ip",
16
17
  "ipv4",
17
18
  "ipv6",
18
19
  "network",
19
- "subnet",
20
- "cidr"
20
+ "subnet"
21
21
  ],
22
22
  "contributors": [
23
23
  {
@@ -28,7 +28,7 @@
28
28
  "license": "0BSD",
29
29
  "scripts": {
30
30
  "prepare": "node --run prepare:typescript",
31
- "prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule --target es2024 --lib esnext -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
31
+ "prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
32
32
  "test": "node --run test:browser-ava && node --run test:ava",
33
33
  "test:browser-ava": "browser-ava --headless --no-keep-open tests/*-ava.mjs tests/*-ava-browser.mjs",
34
34
  "test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
@@ -36,18 +36,25 @@
36
36
  "docs": "documentation readme --section=API ./src**/*.mjs",
37
37
  "lint": "node --run lint:docs && node --run lint:typescript",
38
38
  "lint:docs": "documentation lint ./src**/*.mjs",
39
- "lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target es2024 --lib esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
39
+ "lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
40
+ },
41
+ "dependencies": {
42
+ "ava": "^6.3.0",
43
+ "content-entry": "^13.0.4",
44
+ "fetch-rate-limit-util": "^4.5.2",
45
+ "repository-provider": "^35.3.8",
46
+ "repository-provider-test-support": "^3.1.18"
40
47
  },
41
48
  "devDependencies": {
42
- "ava": "^6.2.0",
43
- "browser-ava": "^2.3.16",
49
+ "ava": "^6.3.0",
50
+ "browser-ava": "^2.3.29",
44
51
  "c8": "^10.1.3",
45
52
  "documentation": "^14.0.3",
46
53
  "semantic-release": "^24.2.3",
47
54
  "typescript": "^5.8.3"
48
55
  },
49
56
  "engines": {
50
- "node": ">=22.14.0"
57
+ "node": ">=22.15.0"
51
58
  },
52
59
  "repository": {
53
60
  "type": "git",
package/src/ip.mjs CHANGED
@@ -223,14 +223,14 @@ export function normalizeCIDR(address) {
223
223
  let [prefix, prefixLength] = address.split(/\//);
224
224
  let longPrefix;
225
225
 
226
- if (!prefixLength && isLinkLocal(address)) {
226
+ prefixLength = prefixLength === undefined ? 0 : parseInt(prefixLength);
227
+
228
+ if (isLinkLocal(address)) {
227
229
  prefix = "fe80::";
228
230
  longPrefix = prefix;
229
231
  prefixLength = 64;
230
232
  } else {
231
- prefixLength = parseInt(prefixLength);
232
-
233
- const family = isIPv6(prefix) ? ipv6 : ipv4;
233
+ const family = /*_family(prefix); */ isIPv6(prefix) ? ipv6 : ipv4;
234
234
  let n;
235
235
 
236
236
  if (prefixLength) {
@@ -240,8 +240,6 @@ export function normalizeCIDR(address) {
240
240
 
241
241
  if (isLocalhost(n)) {
242
242
  prefixLength = family === ipv6 ? 128 : 8;
243
- } else {
244
- return {};
245
243
  }
246
244
  }
247
245
  prefix = _decode(family, n, prefixLength);
package/types/ip.d.mts CHANGED
@@ -17,11 +17,6 @@ export function prefixIP(address: any, length: any): string;
17
17
  export function rangeIP(address: any, prefix: any, lowerAdd?: number, upperReduce?: number): any[];
18
18
  export function matchPrefixIP(prefix: any, length: any, address: any): boolean;
19
19
  export function normalizeCIDR(address: any): {
20
- longPrefix?: undefined;
21
- prefix?: undefined;
22
- prefixLength?: undefined;
23
- cidr?: undefined;
24
- } | {
25
20
  longPrefix: any;
26
21
  prefix: any;
27
22
  prefixLength: any;