mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2026-10-09 09:59:45 +07:00
node_modules: update (#332)
Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
1 parent
c1dac70e3a
commit
6bf0a2f26a
95 files changed
+1102
-503
No files matched your search
+2
@@ -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
@@ -5,6 +5,8 @@ import { Transform } from '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 = [
|
||||
@@ -41,7 +43,9 @@ export function encode(buffer) {
|
||||
*/
|
||||
export 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;
|
||||
}
|
||||
@@ -95,6 +99,11 @@ export 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);
|
||||
|
||||
Reference in new issue
Block a user