cidr-tools
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -5,2 +5,3 @@ "use strict"; | ||
const IPCIDR = require("ip-cidr"); | ||
const isIp = require("is-ip"); | ||
const isCidr = require("is-cidr"); | ||
@@ -27,5 +28,5 @@ const ipv6Normalize = require("ipv6-normalize"); | ||
} else { | ||
const parsed = new IPCIDR(cidrTools.normalize(str)); | ||
if (parsed && parsed.address) { | ||
return new IPCIDR(cidrTools.normalize(`${str}/${bits[parsed.address.v4 ? "v4" : "v6"]}`)); | ||
const version = isIp.version(str); | ||
if (version) { | ||
return new IPCIDR(cidrTools.normalize(`${str}/${bits[`v${version}`]}`)); | ||
} else { | ||
@@ -223,3 +224,3 @@ throw new Error(`Network is not a CIDR or IP: ${str}`); | ||
const parsed = new IPCIDR(cidr); | ||
const parsed = parse(cidr); | ||
if (parsed && parsed.address && parsed.address.v4) { | ||
@@ -226,0 +227,0 @@ return cidr; |
{ | ||
"name": "cidr-tools", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"author": "silverwind <me@silverwind.io>", | ||
@@ -33,5 +33,6 @@ "description": "Tools to work with IPv4 and IPv6 CIDR network lists", | ||
"ip-address": "^6.3.0", | ||
"ip-cidr": "^2.0.12", | ||
"ip-cidr": "^2.0.17", | ||
"ipv6-normalize": "^1.0.1", | ||
"is-cidr": "^3.1.0", | ||
"is-cidr": "^4.0.0", | ||
"is-ip": "3.1.0", | ||
"jsbn": "^1.1.0", | ||
@@ -41,8 +42,8 @@ "string-natural-compare": "^3.0.1" | ||
"devDependencies": { | ||
"eslint": "6.8.0", | ||
"eslint-config-silverwind": "11.0.4", | ||
"jest": "26.0.1", | ||
"updates": "10.2.10", | ||
"versions": "8.2.7" | ||
"eslint": "7.7.0", | ||
"eslint-config-silverwind": "18.0.2", | ||
"jest": "26.4.0", | ||
"updates": "10.3.4", | ||
"versions": "8.4.3" | ||
} | ||
} |
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
320
14302
7
+ Addedis-ip@3.1.0
+ Addedcidr-regex@3.1.1(transitive)
+ Addedip-regex@4.3.0(transitive)
+ Addedis-cidr@4.0.2(transitive)
+ Addedis-ip@3.1.0(transitive)
- Removedcidr-regex@2.0.10(transitive)
- Removedip-regex@2.1.0(transitive)
- Removedis-cidr@3.1.1(transitive)
Updatedip-cidr@^2.0.17
Updatedis-cidr@^4.0.0