node_modules: update (#332)

Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
Dawid Dziurlaanddawidd6 authored and GitHub committed 2026-10-01 09:48:38 +02:00
1 parent c1dac70e3a
commit 6bf0a2f26a
95 files changed
+1102 -503

No files matched your search

+2
View File
@@ -15,6 +15,8 @@ export interface QPEncoderOptions {
/** Maximum length for lines, set to false to disable wrapping */
lineLength?: number | false | undefined;
}
/** The name @types/nodemailer used for QPEncoderOptions */
export type EncoderOptions = QPEncoderOptions;
/**
* Creates a transform stream for encoding data to Quoted-Printable encoding
*
+10 -1
View File
@@ -10,6 +10,8 @@ const node_stream_1 = require("node:stream");
* @param buffer Buffer to convert
* @returns Quoted-Printable encoded string
*/
// the shortest line wrap() can make progress with: a complete =XX sequence and the soft break
const MIN_LINE_LENGTH = 4;
// usable characters that do not need encoding
// https://tools.ietf.org/html/rfc2045#section-6.7
const QP_RANGES = [
@@ -46,7 +48,9 @@ function encode(buffer) {
*/
function wrap(str, lineLength) {
str = (str || '').toString();
lineLength = lineLength || 76;
// a line has to hold a complete =XX sequence plus the soft break, shorter lengths
// (or a negative one) would loop without consuming input
lineLength = Math.max(Number(lineLength) || 76, MIN_LINE_LENGTH);
if (str.length <= lineLength) {
return str;
}
@@ -100,6 +104,11 @@ function wrap(str, lineLength) {
}
}
}
if (!line.length) {
// the trimming above emptied the line, which only happens for an incomplete
// escape at the very end of the input. Take it as is rather than loop on it
line = str.substr(pos, lineLength);
}
if (pos + line.length < len && line.substr(-1) !== '\n') {
if (line.length === lineLength && line.match(/[=][\da-f]{2}$/i)) {
line = line.substr(0, line.length - 3);