@badrap/ipv46
Advanced tools
Comparing version 2.2.1 to 2.2.2
{ | ||
"name": "@badrap/ipv46", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "Parse, format and compare IPv4/6 addresses", | ||
@@ -5,0 +5,0 @@ "main": "./dist/cjs/index.js", |
@@ -238,8 +238,11 @@ function cmpSameLengthArrays<T>(left: T[], right: T[]): number { | ||
export const IP = { | ||
parse(string: string): IP | null { | ||
export const IP: { | ||
parse(string: string): IP | null; | ||
cmp(a: IP, b: IP): number; | ||
} = { | ||
parse(string) { | ||
return IPv4.parse(string) || IPv6.parse(string); | ||
}, | ||
cmp(a: IP, b: IP): number { | ||
cmp(a, b) { | ||
if (a.version === 6 && b.version === 6) { | ||
@@ -246,0 +249,0 @@ return IPv6.cmp(a, b); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
115119
1885