Comparing version 8.1.0 to 8.1.1
@@ -19,1 +19,2 @@ export declare const max4: bigint; | ||
export {}; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -8,4 +8,3 @@ const max4 = 2n ** 32n - 1n; | ||
const version = ipVersion(ip); | ||
if (!version) | ||
throw new Error(`Invalid IP address: ${ip}`); | ||
if (!version) throw new Error(`Invalid IP address: ${ip}`); | ||
let number = 0n; | ||
@@ -33,3 +32,3 @@ let exp = 0n; | ||
let scopeid; | ||
[, ip, scopeid] = /(.+)%(.+)/.exec(ip); | ||
[, ip, scopeid] = /(.+)%(.+)/.exec(ip) || []; | ||
res.scopeid = scopeid; | ||
@@ -94,4 +93,4 @@ } | ||
function compressIPv6(parts) { | ||
let longest; | ||
let current; | ||
let longest = null; | ||
let current = null; | ||
for (const [index, part] of parts.entries()) { | ||
@@ -113,3 +112,3 @@ if (part === "0") { | ||
} | ||
if (!longest && current || current && current.size > longest.size) { | ||
if (!longest && current || current && longest && current.size > longest.size) { | ||
longest = current; | ||
@@ -116,0 +115,0 @@ } |
{ | ||
"name": "ip-bigint", | ||
"version": "8.1.0", | ||
"version": "8.1.1", | ||
"description": "Convert IPv4 and IPv6 addresses to and from BigInt", | ||
@@ -20,11 +20,11 @@ "author": "silverwind <me@silverwind.io>", | ||
"devDependencies": { | ||
"@types/node": "20.12.12", | ||
"@types/node": "20.14.7", | ||
"eslint": "8.57.0", | ||
"eslint-config-silverwind": "85.1.3", | ||
"eslint-config-silverwind-typescript": "3.2.5", | ||
"typescript-config-silverwind": "4.2.0", | ||
"updates": "16.1.1", | ||
"versions": "12.0.2", | ||
"vite": "5.2.11", | ||
"vite-plugin-dts": "3.9.1", | ||
"eslint-config-silverwind": "88.1.0", | ||
"eslint-config-silverwind-typescript": "4.0.2", | ||
"typescript-config-silverwind": "5.1.1", | ||
"updates": "16.2.0", | ||
"versions": "12.1.2", | ||
"vite": "5.3.1", | ||
"vite-config-silverwind": "2.2.2", | ||
"vitest": "1.6.0", | ||
@@ -31,0 +31,0 @@ "vitest-config-silverwind": "9.0.6" |
@@ -19,3 +19,2 @@ # ip-bigint | ||
// => "2001:db8::1" | ||
``` | ||
@@ -22,0 +21,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
8422
5
0
142
71