Comparing version 3.0.7 to 3.0.8
@@ -16,6 +16,7 @@ "use strict"; | ||
this.address = address; | ||
this.addressStart = address.startAddress(); | ||
this.addressEnd = address.endAddress(); | ||
this.addressStart = address.startAddress(); | ||
this.addressEnd = address.endAddress(); | ||
this.addressStart.subnet = this.addressEnd.subnet = this.address.subnet; | ||
this.addressStart.subnetMask = this.addressEnd.subnetMask = this.address.subnetMask; | ||
this.size = new BigInteger(this.addressEnd.bigInteger().subtract(this.addressStart.bigInteger()).add(new BigInteger('1')).toString()); | ||
} | ||
@@ -22,0 +23,0 @@ |
{ | ||
"name": "ip-cidr", | ||
"version": "3.0.7", | ||
"version": "3.0.8", | ||
"description": "Module for working with CIDR (v4, v6)", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -34,3 +34,4 @@ "use strict"; | ||
assert.equal(cidr.addressStart.addressMinusSuffix, '2001:0db8:0000:0000:0000:0000:0000:0000', 'check the start'); | ||
assert.equal(cidr.addressEnd.addressMinusSuffix, '2001:0db8:0000:0000:0000:0000:0000:00ff', 'check the end'); | ||
assert.equal(cidr.addressEnd.addressMinusSuffix, '2001:0db8:0000:0000:0000:0000:0000:00ff', 'check the end'); | ||
assert.equal(cidr.toArray().length, cidr.size.toString(), 'check the size'); | ||
}); | ||
@@ -41,3 +42,3 @@ | ||
assert.equal(cidr.addressStart.addressMinusSuffix, validCIDRStart, 'check the start'); | ||
assert.equal(cidr.addressEnd.addressMinusSuffix, validCIDREnd, 'check the end'); | ||
assert.equal(cidr.addressEnd.addressMinusSuffix, validCIDREnd, 'check the end'); | ||
@@ -53,3 +54,3 @@ }); | ||
it('check as string', function () { | ||
const cidr = new IPCIDR(validCIDR); | ||
const cidr = new IPCIDR(validCIDR); | ||
assert.equal(IPCIDR.formatIP(cidr.address), validCIDRClear); | ||
@@ -56,0 +57,0 @@ }); |
Sorry, the diff of this file is too big to display
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
135407
3631