@@ -32676,9 +32676,8 @@ var require_side_channel_list = __commonJS({
3267632676 }
3267732677 },
3267832678 "delete": function(key) {
32679- var root = $o && $o.next;
3268032679 var deletedNode = listDelete($o, key);
32681- if (deletedNode && root && root === deletedNode ) {
32680+ if (deletedNode && $o && !$o.next ) {
3268232681 $o = void 0;
3268332682 }
3268432683 return !!deletedNode;
@@ -34321,9 +34320,9 @@ var require_parse = __commonJS({
3432134320 var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit;
3432234321 var parts = cleanStr.split(
3432334322 options.delimiter,
34324- options.throwOnLimitExceeded ? limit + 1 : limit
34323+ options.throwOnLimitExceeded && typeof limit !== "undefined" ? limit + 1 : limit
3432534324 );
34326- if (options.throwOnLimitExceeded && parts.length > limit) {
34325+ if (options.throwOnLimitExceeded && typeof limit !== "undefined" && parts.length > limit) {
3432734326 throw new RangeError("Parameter limit exceeded. Only " + limit + " parameter" + (limit === 1 ? "" : "s") + " allowed.");
3432834327 }
3432934328 var skipIndex = -1;
@@ -38371,10 +38370,8 @@ var require_content_disposition = __commonJS({
3837138370 "use strict";
3837238371 module.exports = contentDisposition;
3837338372 module.exports.parse = parse4;
38374- var basename10 = __require("path").basename ;
38373+ var utf8Decoder = new TextDecoder("utf-8") ;
3837538374 var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
38376- var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/;
38377- var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g;
3837838375 var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g;
3837938376 var QESC_REGEXP = /\\([\u0000-\u007f])/g;
3838038377 var QUOTE_REGEXP = /([\\"])/g;
@@ -38410,7 +38407,7 @@ var require_content_disposition = __commonJS({
3841038407 var isQuotedString = TEXT_REGEXP.test(name);
3841138408 var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name) : basename10(fallback);
3841238409 var hasFallback = typeof fallbackName === "string" && fallbackName !== name;
38413- if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test (name)) {
38410+ if (hasFallback || !isQuotedString || hasHexEscape (name)) {
3841438411 params["filename*"] = name;
3841538412 }
3841638413 if (isQuotedString || hasFallback) {
@@ -38437,26 +38434,32 @@ var require_content_disposition = __commonJS({
3843738434 return string3;
3843838435 }
3843938436 function decodefield(str2) {
38440- var match = EXT_VALUE_REGEXP.exec(str2);
38437+ const match = EXT_VALUE_REGEXP.exec(str2);
3844138438 if (!match) {
3844238439 throw new TypeError("invalid extended field value");
3844338440 }
38444- var charset = match[1].toLowerCase();
38445- var encoded = match[2];
38446- var value;
38447- var binary2 = encoded.replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode);
38441+ const charset = match[1].toLowerCase();
38442+ const encoded = match[2];
3844838443 switch (charset) {
38449- case "iso-8859-1":
38450- value = getlatin1(binary2);
38451- break;
38444+ case "iso-8859-1": {
38445+ const binary2 = decodeHexEscapes(encoded);
38446+ return getlatin1(binary2);
38447+ }
3845238448 case "utf-8":
38453- case "utf8":
38454- value = Buffer.from(binary2, "binary").toString("utf8");
38455- break;
38456- default:
38457- throw new TypeError("unsupported charset in extended field");
38449+ case "utf8": {
38450+ try {
38451+ return decodeURIComponent(encoded);
38452+ } catch {
38453+ const binary2 = decodeHexEscapes(encoded);
38454+ const bytes = new Uint8Array(binary2.length);
38455+ for (let idx = 0; idx < binary2.length; idx++) {
38456+ bytes[idx] = binary2.charCodeAt(idx);
38457+ }
38458+ return utf8Decoder.decode(bytes);
38459+ }
38460+ }
3845838461 }
38459- return value ;
38462+ throw new TypeError("unsupported charset in extended field") ;
3846038463 }
3846138464 function getlatin1(val) {
3846238465 return String(val).replace(NON_LATIN1_REGEXP, "?");
@@ -38506,9 +38509,6 @@ var require_content_disposition = __commonJS({
3850638509 }
3850738510 return new ContentDisposition(type2, params);
3850838511 }
38509- function pdecode(str2, hex) {
38510- return String.fromCharCode(parseInt(hex, 16));
38511- }
3851238512 function pencode(char) {
3851338513 return "%" + String(char).charCodeAt(0).toString(16).toUpperCase();
3851438514 }
@@ -38525,6 +38525,51 @@ var require_content_disposition = __commonJS({
3852538525 this.type = type2;
3852638526 this.parameters = parameters;
3852738527 }
38528+ function basename10(path3) {
38529+ const normalized = path3.replaceAll("\\", "/");
38530+ let end = normalized.length;
38531+ while (end > 0 && normalized[end - 1] === "/") {
38532+ end--;
38533+ }
38534+ if (end === 0) {
38535+ return "";
38536+ }
38537+ let start = end - 1;
38538+ while (start >= 0 && normalized[start] !== "/") {
38539+ start--;
38540+ }
38541+ return normalized.slice(start + 1, end);
38542+ }
38543+ function isHexDigit(char) {
38544+ const code = char.charCodeAt(0);
38545+ return code >= 48 && code <= 57 || // 0-9
38546+ code >= 65 && code <= 70 || // A-F
38547+ code >= 97 && code <= 102;
38548+ }
38549+ function hasHexEscape(str2) {
38550+ const maxIndex = str2.length - 3;
38551+ let lastIndex = -1;
38552+ while ((lastIndex = str2.indexOf("%", lastIndex + 1)) !== -1 && lastIndex <= maxIndex) {
38553+ if (isHexDigit(str2[lastIndex + 1]) && isHexDigit(str2[lastIndex + 2])) {
38554+ return true;
38555+ }
38556+ }
38557+ return false;
38558+ }
38559+ function decodeHexEscapes(str2) {
38560+ const firstEscape = str2.indexOf("%");
38561+ if (firstEscape === -1) return str2;
38562+ let result = str2.slice(0, firstEscape);
38563+ for (let idx = firstEscape; idx < str2.length; idx++) {
38564+ if (str2[idx] === "%" && idx + 2 < str2.length && isHexDigit(str2[idx + 1]) && isHexDigit(str2[idx + 2])) {
38565+ result += String.fromCharCode(Number.parseInt(str2[idx + 1] + str2[idx + 2], 16));
38566+ idx += 2;
38567+ } else {
38568+ result += str2[idx];
38569+ }
38570+ }
38571+ return result;
38572+ }
3852838573 }
3852938574});
3853038575
@@ -40392,7 +40437,7 @@ var require_main = __commonJS({
4039240437 lastError = e;
4039340438 }
4039440439 }
40395- _log(`injecting env (${keysCount}) from ${shortPaths.join(",")} ${dim(`// tip: ${_getRandomTip()}`)}`);
40440+ _log(`injected env (${keysCount}) from ${shortPaths.join(",")} ${dim(`// tip: ${_getRandomTip()}`)}`);
4039640441 }
4039740442 if (lastError) {
4039840443 return { parsed: parsedAll, error: lastError };
0 commit comments