ip-utilties 1.3.2 → 1.4.0
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 +4 -11
- package/src/ip.mjs +5 -0
- package/types/ip.d.mts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ip-utilties",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -38,23 +38,16 @@
|
|
|
38
38
|
"lint:docs": "documentation lint ./src**/*.mjs",
|
|
39
39
|
"lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
|
|
40
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"
|
|
47
|
-
},
|
|
48
41
|
"devDependencies": {
|
|
49
42
|
"ava": "^6.3.0",
|
|
50
|
-
"browser-ava": "^2.3.
|
|
43
|
+
"browser-ava": "^2.3.31",
|
|
51
44
|
"c8": "^10.1.3",
|
|
52
45
|
"documentation": "^14.0.3",
|
|
53
|
-
"semantic-release": "^24.2.
|
|
46
|
+
"semantic-release": "^24.2.5",
|
|
54
47
|
"typescript": "^5.8.3"
|
|
55
48
|
},
|
|
56
49
|
"engines": {
|
|
57
|
-
"node": ">=22.
|
|
50
|
+
"node": ">=22.16.0"
|
|
58
51
|
},
|
|
59
52
|
"repository": {
|
|
60
53
|
"type": "git",
|
package/src/ip.mjs
CHANGED
|
@@ -296,6 +296,11 @@ export function isLinkLocal(address) {
|
|
|
296
296
|
return eaddr?.[0] === 0xfe80;
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
+
export function isUniqueLocal(address) {
|
|
300
|
+
const eaddr = encodeIP(address);
|
|
301
|
+
return eaddr?.[0] === 0xfc00 || eaddr?.[0] === 0xfd00;
|
|
302
|
+
}
|
|
303
|
+
|
|
299
304
|
export function hasWellKnownSubnet(address) {
|
|
300
305
|
return isLocalhost(address) || isLinkLocal(address);
|
|
301
306
|
}
|
package/types/ip.d.mts
CHANGED
|
@@ -27,6 +27,7 @@ export function normalizeIP(address: any): string;
|
|
|
27
27
|
export function reverseArpa(address: any): string;
|
|
28
28
|
export function isLocalhost(address: any): boolean;
|
|
29
29
|
export function isLinkLocal(address: any): boolean;
|
|
30
|
+
export function isUniqueLocal(address: any): boolean;
|
|
30
31
|
export function hasWellKnownSubnet(address: any): boolean;
|
|
31
32
|
export const IPV6_LINK_LOCAL_BROADCAST: any;
|
|
32
33
|
export const IPV6_ROUTER_BROADCAST: any;
|