Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ip-address

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ip-address - npm Package Compare versions

Comparing version 5.9.0 to 5.9.1

.DS_Store

23

lib/ipv4.js

@@ -5,5 +5,4 @@ 'use strict';

var common = require('./common.js');
var padStart = require('lodash.padstart');
var repeat = require('lodash.repeat');
var sprintf = require('sprintf-js').sprintf;
var _ = require('lodash');

@@ -102,3 +101,3 @@ var constants = require('./v4/constants.js');

Address4.fromHex = function (hex) {
var padded = padStart(hex.replace(/:/g, ''), 8, '0');
var padded = _.padStart(hex.replace(/:/g, ''), 8, '0');
var groups = [];

@@ -196,3 +195,3 @@ var i;

return new BigInteger(
this.mask() + repeat(0, constants.BITS - this.subnetMask), 2
this.mask() + _.repeat(0, constants.BITS - this.subnetMask), 2
);

@@ -220,4 +219,4 @@ };

Address4.prototype.startAddressExclusive = function () {
var adjust = new BigInteger('1');
return Address4.fromBigInteger(this._startAddress().add(adjust));
var adjust = new BigInteger('1');
return Address4.fromBigInteger(this._startAddress().add(adjust));
};

@@ -232,5 +231,5 @@

Address4.prototype._endAddress = function () {
return new BigInteger(
this.mask() + repeat(1, constants.BITS - this.subnetMask), 2
);
return new BigInteger(
this.mask() + _.repeat(1, constants.BITS - this.subnetMask), 2
);
};

@@ -257,4 +256,4 @@

Address4.prototype.endAddressExclusive = function () {
var adjust = new BigInteger('1');
return Address4.fromBigInteger(this._endAddress().subtract(adjust));
var adjust = new BigInteger('1');
return Address4.fromBigInteger(this._endAddress().subtract(adjust));
};

@@ -313,5 +312,5 @@

Address4.prototype.binaryZeroPad = function () {
return padStart(this.bigInteger().toString(2), constants.BITS, '0');
return _.padStart(this.bigInteger().toString(2), constants.BITS, '0');
};
module.exports = Address4;
'use strict';
var BigInteger = require('jsbn').BigInteger;
var find = require('lodash.find');
var max = require('lodash.max');
var merge = require('lodash.merge');
var padStart = require('lodash.padstart');
var repeat = require('lodash.repeat');
var sprintf = require('sprintf-js').sprintf;
var _ = require('lodash');

@@ -94,5 +90,5 @@ var constants4 = require('./v4/constants.js');

merge(Address6.prototype, require('./v6/attributes.js'));
merge(Address6.prototype, require('./v6/html.js'));
merge(Address6.prototype, require('./v6/regular-expressions.js'));
_.merge(Address6.prototype, require('./v6/attributes.js'));
_.merge(Address6.prototype, require('./v6/html.js'));
_.merge(Address6.prototype, require('./v6/regular-expressions.js'));

@@ -111,3 +107,3 @@ /**

Address6.fromBigInteger = function (bigInteger) {
var hex = padStart(bigInteger.toString(16), 32, '0');
var hex = _.padStart(bigInteger.toString(16), 32, '0');
var groups = [];

@@ -325,3 +321,3 @@ var i;

return new BigInteger(
this.mask() + repeat(0, constants6.BITS - this.subnetMask), 2
this.mask() + _.repeat(0, constants6.BITS - this.subnetMask), 2
);

@@ -349,4 +345,4 @@ };

Address6.prototype.startAddressExclusive = function () {
var adjust = new BigInteger('1');
return Address6.fromBigInteger(this._startAddress().add(adjust));
var adjust = new BigInteger('1');
return Address6.fromBigInteger(this._startAddress().add(adjust));
};

@@ -362,3 +358,3 @@

return new BigInteger(
this.mask() + repeat(1, constants6.BITS - this.subnetMask), 2
this.mask() + _.repeat(1, constants6.BITS - this.subnetMask), 2
);

@@ -386,4 +382,4 @@ };

Address6.prototype.endAddressExclusive = function () {
var adjust = new BigInteger('1');
return Address6.fromBigInteger(this._endAddress().subtract(adjust));
var adjust = new BigInteger('1');
return Address6.fromBigInteger(this._endAddress().subtract(adjust));
};

@@ -421,3 +417,3 @@

return find(constants6.TYPES, isType) || 'Global unicast';
return _.find(constants6.TYPES, isType) || 'Global unicast';
};

@@ -458,3 +454,3 @@

return padStart(this.getBits(start, end).toString(16), length / 4, '0');
return _.padStart(this.getBits(start, end).toString(16), length / 4, '0');
};

@@ -545,3 +541,3 @@

zeroes.push([this.parsedAddress.length - zeroCounter,
this.parsedAddress.length - 1]);
this.parsedAddress.length - 1]);
}

@@ -554,3 +550,3 @@

if (zeroes.length > 0) {
var index = zeroLengths.indexOf(max(zeroLengths));
var index = zeroLengths.indexOf(_.max(zeroLengths));

@@ -589,3 +585,3 @@ groups = compact(this.parsedAddress, zeroes[index]);

Address6.prototype.binaryZeroPad = function () {
return padStart(this.bigInteger().toString(2), constants6.BITS, '0');
return _.padStart(this.bigInteger().toString(2), constants6.BITS, '0');
};

@@ -592,0 +588,0 @@

@@ -10,3 +10,3 @@ {

],
"version": "5.9.0",
"version": "5.9.1",
"author": "Beau Gunderson <beau@beaugunderson.com> (https://beaugunderson.com/)",

@@ -17,3 +17,3 @@ "license": "MIT",

"test": "mocha -R spec",
"docs": "documentation --github --output docs --format html ./ip-address.js",
"docs": "documentation build --github --output docs --format html ./ip-address.js",
"prepublishOnly": "browserify ./ip-address-globals.js > ./dist/ip-address-globals.js"

@@ -30,18 +30,14 @@ },

"jsbn": "1.1.0",
"lodash.find": "^4.6.0",
"lodash.max": "^4.0.1",
"lodash.merge": "^4.6.1",
"lodash.padstart": "^4.6.1",
"lodash.repeat": "^4.1.0",
"sprintf-js": "1.1.1"
"lodash": "^4.17.11",
"sprintf-js": "1.1.2"
},
"devDependencies": {
"browserify": "^16.2.0",
"chai": "^4.1.2",
"browserify": "^16.2.3",
"chai": "^4.2.0",
"codecov.io": "^0.1.6",
"documentation": "^4.0.0",
"documentation": "^11.0.0",
"istanbul": "^0.4.5",
"mocha": "^5.1.1",
"mochify": "^5.6.1"
"mocha": "^6.1.4",
"mochify": "^6.2.0"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc