node_modules: update (#352)

Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
Dawid Dziurlaanddawidd6 authored and GitHub committed 2026-10-22 08:43:32 +02:00
1 parent 4026a70a6b
commit 47af4a10b5
53 files changed
+630 -217

No files matched your search

+35 -13
View File
@@ -117,9 +117,7 @@ function exceedsDomainLimits(domain) {
*/
function normalizeDomain(domain, toUnicode) {
// domainToASCII and domainToUnicode landed in Node 7, the bundled codec covers Node 6
if (typeof urlModule.domainToASCII === 'function' &&
typeof urlModule.domainToUnicode === 'function' &&
!URL_PARSER_UNSAFE.test(domain)) {
if (typeof urlModule.domainToASCII === 'function' && typeof urlModule.domainToUnicode === 'function' && !URL_PARSER_UNSAFE.test(domain)) {
// The U-label form is decoded from the A-label form rather than from the input:
// Deno's domainToASCII returns an empty string for a label it cannot decode, while
// its domainToUnicode returns the label with U+FFFD in place of the bad part
@@ -632,9 +630,7 @@ class MimeNode {
// the checks miss and the header ends up claiming a type it is not set up for
structured.value = (structured.value || '').toString().replace(/[\x00-\x1f\x7f]/g, '');
this._handleContentType(structured);
if (structured.value.match(/^text\/plain\b/) &&
typeof this.content === 'string' &&
/[\u0080-\uFFFF]/.test(this.content)) {
if (structured.value.match(/^text\/plain\b/) && typeof this.content === 'string' && /[\u0080-\uFFFF]/.test(this.content)) {
structured.params.charset = 'utf-8';
}
if (this.filename) {
@@ -675,7 +671,7 @@ class MimeNode {
}
break;
}
value = this._encodeHeaderValue(key, value);
value = this.encodeHeaderValue(key, value);
// skip empty lines
if (!(value || '').toString().trim()) {
return;
@@ -1293,8 +1289,7 @@ class MimeNode {
// where it came from. MimeNode is exported and subclassable, so the generator is
// not necessarily the one below. Stripping twice costs nothing, it is idempotent.
const declared = _stripBoundaryControls(structured.params.boundary || this.boundary || '');
this.boundary = structured.params.boundary =
declared || _stripBoundaryControls(this._generateBoundary());
this.boundary = structured.params.boundary = declared || _stripBoundaryControls(this._generateBoundary());
}
else {
this.boundary = false;
@@ -1312,13 +1307,19 @@ class MimeNode {
return _stripBoundaryControls(this.rootNode.boundaryPrefix + '-' + this.rootNode.baseBoundary) + '-Part_' + this._nodeId;
}
/**
* Encodes a header value for use in the generated rfc2822 email.
* Encodes a header value the way this node encodes it in the generated message:
* address headers are punycoded and mime encoded, message id headers get their
* angle brackets, a Date object is formatted and any other value is mime encoded
* when it holds non-ascii or control characters (using the node's `textEncoding`).
*
* @param key Header key
* The result is a single unfolded line without the key. Fold it before writing it
* into a message, `key + ': ' + value` folded at 76 characters is what the node does.
*
* @param key Header key, case insensitive
* @param value Header value
* @internal
* @returns Encoded header value
*/
_encodeHeaderValue(key, value) {
encodeHeaderValue(key, value) {
key = this._normalizeHeaderKey(key);
switch (key) {
// Structured headers
@@ -1383,6 +1384,27 @@ class MimeNode {
return this._encodeHeaderText(value);
}
}
/**
* Encodes a header value without a node at hand. Same as the instance method of a
* node created with the given options.
*
* @param key Header key, case insensitive
* @param value Header value
* @param [options] Encoding options
* @param [options.textEncoding] either 'Q' (the default) or 'B'
* @returns Encoded header value
*/
static encodeHeaderValue(key, value, options) {
return new MimeNode(false, { textEncoding: options?.textEncoding }).encodeHeaderValue(key, value);
}
/**
* Alias of encodeHeaderValue, kept for callers that used the method before it was public
*
* @internal
*/
_encodeHeaderValue(key, value) {
return this.encodeHeaderValue(key, value);
}
/**
* Rebuilds address object using punycode and other adjustments
*