ip-address
Advanced tools
Comparing version 5.9.0 to 5.9.1
@@ -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
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 5 instances in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
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
2382067
3
47
22242
2
90
7
+ Addedlodash@^4.17.11
+ Addedlodash@4.17.21(transitive)
+ Addedsprintf-js@1.1.2(transitive)
- Removedlodash.find@^4.6.0
- Removedlodash.max@^4.0.1
- Removedlodash.merge@^4.6.1
- Removedlodash.padstart@^4.6.1
- Removedlodash.repeat@^4.1.0
- Removedlodash.find@4.6.0(transitive)
- Removedlodash.max@4.0.1(transitive)
- Removedlodash.merge@4.6.2(transitive)
- Removedlodash.padstart@4.6.1(transitive)
- Removedlodash.repeat@4.1.0(transitive)
- Removedsprintf-js@1.1.1(transitive)
Updatedsprintf-js@1.1.2