updated npm modules
This commit is contained in:
37
node_modules/ipaddr.js/lib/ipaddr.js
generated
vendored
37
node_modules/ipaddr.js/lib/ipaddr.js
generated
vendored
@@ -229,6 +229,24 @@
|
||||
return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, '::');
|
||||
};
|
||||
|
||||
IPv6.prototype.toRFC5952String = function() {
|
||||
var bestMatchIndex, bestMatchLength, match, regex, string;
|
||||
regex = /((^|:)(0(:|$)){2,})/g;
|
||||
string = this.toNormalizedString();
|
||||
bestMatchIndex = 0;
|
||||
bestMatchLength = -1;
|
||||
while ((match = regex.exec(string))) {
|
||||
if (match[0].length > bestMatchLength) {
|
||||
bestMatchIndex = match.index;
|
||||
bestMatchLength = match[0].length;
|
||||
}
|
||||
}
|
||||
if (bestMatchLength < 0) {
|
||||
return string;
|
||||
}
|
||||
return string.substring(0, bestMatchIndex) + '::' + string.substring(bestMatchIndex + bestMatchLength);
|
||||
};
|
||||
|
||||
IPv6.prototype.toByteArray = function() {
|
||||
var bytes, k, len, part, ref;
|
||||
bytes = [];
|
||||
@@ -260,6 +278,25 @@
|
||||
return addr + suffix;
|
||||
};
|
||||
|
||||
IPv6.prototype.toFixedLengthString = function() {
|
||||
var addr, part, suffix;
|
||||
addr = ((function() {
|
||||
var k, len, ref, results;
|
||||
ref = this.parts;
|
||||
results = [];
|
||||
for (k = 0, len = ref.length; k < len; k++) {
|
||||
part = ref[k];
|
||||
results.push(part.toString(16).padStart(4, '0'));
|
||||
}
|
||||
return results;
|
||||
}).call(this)).join(":");
|
||||
suffix = '';
|
||||
if (this.zoneId) {
|
||||
suffix = '%' + this.zoneId;
|
||||
}
|
||||
return addr + suffix;
|
||||
};
|
||||
|
||||
IPv6.prototype.match = function(other, cidrRange) {
|
||||
var ref;
|
||||
if (cidrRange === void 0) {
|
||||
|
||||
4
node_modules/ipaddr.js/lib/ipaddr.js.d.ts
generated
vendored
4
node_modules/ipaddr.js/lib/ipaddr.js.d.ts
generated
vendored
@@ -2,8 +2,8 @@
|
||||
|
||||
declare module "ipaddr.js" {
|
||||
|
||||
type IPv4Range = 'unspecified' | 'broadcast' | 'multicast' | 'linkLocal' | 'loopback' | 'carrierGradeNat' | 'private' | 'reserved';
|
||||
type IPv6Range = 'unspecified' | 'linkLocal' | 'multicast' | 'loopback' | 'uniqueLocal' | 'ipv4Mapped' | 'rfc6145' | 'rfc6052' | '6to4' | 'teredo' | 'reserved';
|
||||
type IPv4Range = 'unicast' | 'unspecified' | 'broadcast' | 'multicast' | 'linkLocal' | 'loopback' | 'carrierGradeNat' | 'private' | 'reserved';
|
||||
type IPv6Range = 'unicast' | 'unspecified' | 'linkLocal' | 'multicast' | 'loopback' | 'uniqueLocal' | 'ipv4Mapped' | 'rfc6145' | 'rfc6052' | '6to4' | 'teredo' | 'reserved';
|
||||
|
||||
interface RangeList<T> {
|
||||
[name: string]: [T, number] | [T, number][];
|
||||
|
||||
Reference in New Issue
Block a user