cidr-tools
Advanced tools
Comparing version 7.0.6 to 7.0.7
@@ -14,2 +14,3 @@ type IPv4Address = string; | ||
end: bigint; | ||
single: boolean; | ||
}; | ||
@@ -16,0 +17,0 @@ |
@@ -19,4 +19,4 @@ import {parseIp, stringifyIp, normalizeIp, ipVersion} from "ip-bigint"; | ||
function doNormalize(cidr, {compress = true, hexify = false} = {}) { | ||
const {start, end, prefix, version} = parse(cidr); | ||
if (start !== end) { // cidr | ||
const {start, prefix, single, version} = parse(cidr); | ||
if (!single) { // cidr | ||
// set network address to first address | ||
@@ -62,2 +62,3 @@ const ip = normalizeIp(stringifyIp({number: start, version}), {compress, hexify}); | ||
parsed.prefix = prefix; | ||
parsed.single = prefix === String(bits[parsed.version]); | ||
const {number, version} = parseIp(ip); | ||
@@ -64,0 +65,0 @@ const numBits = bits[version]; |
{ | ||
"name": "cidr-tools", | ||
"version": "7.0.6", | ||
"version": "7.0.7", | ||
"author": "silverwind <me@silverwind.io>", | ||
@@ -5,0 +5,0 @@ "description": "Tools to work with IPv4 and IPv6 CIDR", |
@@ -82,2 +82,4 @@ # cidr-tools | ||
- `end` BigInt: End number of the network. | ||
- `end` BigInt: Start of the network. | ||
- `single` Boolean: `true` when the network is a single IP. | ||
@@ -84,0 +86,0 @@ ## Related |
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
16578
376
94