From f694c0e2f44d12deabcab972cd140df843e1ae4f Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 27 Oct 2026 03:53:24 +0000 Subject: [PATCH] chore: Update dist --- THIRD-PARTY | 2 +- dist/index.js | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/THIRD-PARTY b/THIRD-PARTY index 48833082..efec133f 100644 --- a/THIRD-PARTY +++ b/THIRD-PARTY @@ -1485,7 +1485,7 @@ Apache-2.0 The following npm package may be included in this product: - - ip-address@10.7.2 + - ip-address@10.7.5 This package contains the following license: diff --git a/dist/index.js b/dist/index.js index 0cd43483..4c5bb143 100644 --- a/dist/index.js +++ b/dist/index.js @@ -49769,10 +49769,10 @@ var require_common2 = __commonJS({ } function testBit(binaryValue, position) { const { length } = binaryValue; - if (position > length) { + if (position >= length) { return false; } - const positionInString = length - position; + const positionInString = length - position - 1; return binaryValue.substring(positionInString, positionInString + 1) === "1"; } } @@ -50030,6 +50030,10 @@ var require_ipv4 = __commonJS({ * address.correctForm(); // '192.0.2.42' */ static fromArpa(arpaFormAddress) { + const longest = constants4.GROUPS * 4 - 1 + "/32".length + ".in-addr.arpa.".length; + if (arpaFormAddress.length > longest) { + throw new address_error_1.AddressError(`in-addr.arpa names are at most ${longest} characters.`); + } const leader = arpaFormAddress.replace(/(\.in-addr\.arpa)?\.?$/i, ""); const address = leader.split(".").reverse().join("."); return new _Address4(address); @@ -50713,10 +50717,10 @@ var require_ipv6 = __commonJS({ if (/\//.test(address)) { throw new address_error_1.AddressError("Invalid subnet mask."); } - const zone = constants6.RE_ZONE_STRING.exec(address); - if (zone) { - this.zone = zone[0]; - address = address.replace(constants6.RE_ZONE_STRING, ""); + const zoneStart = address.indexOf("%"); + if (zoneStart !== -1 && /^.*$/.test(address.slice(zoneStart))) { + this.zone = address.slice(zoneStart); + address = address.slice(0, zoneStart); } const longest = this.groups * 5 + 5; if (address.length > longest) {