From 56759bb4237315aa308bd6f0a6dcf0bfea7fd769 Mon Sep 17 00:00:00 2001 From: Benedikt Schaber Date: Fri, 27 Jan 2023 17:07:36 +0100 Subject: [PATCH] deno fmt --- client/basic/client.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/client/basic/client.ts b/client/basic/client.ts index 21a54a9..3f4bc3c 100644 --- a/client/basic/client.ts +++ b/client/basic/client.ts @@ -83,24 +83,24 @@ export class SMTPClient { this.#connection.writeCmd( `Content-Type: ${attachment.contentType}; name=${attachment.filename}`, ); - + if (attachment.contentID) { this.#connection.writeCmd( `Content-ID: <${attachment.contentID}>`, ); } - + this.#connection.writeCmd( `Content-Disposition: ${ attachment.contentDisposition || "attachment" }; filename=${attachment.filename}`, ); - + if (attachment.encoding === "base64") { this.#connection.writeCmd( "Content-Transfer-Encoding: base64\r\n", ); - + for ( let line = 0; line < Math.ceil(attachment.content.length / 75); @@ -110,16 +110,16 @@ export class SMTPClient { line * 75, (line + 1) * 75, ); - + this.#connection.writeCmd(lineOfBase64); } - + this.#connection.writeCmd("\r\n"); } else if (attachment.encoding === "text") { this.#connection.writeCmd( "Content-Transfer-Encoding: quoted-printable\r\n", ); - + this.#connection.writeCmd(attachment.content + "\r\n"); } } @@ -287,20 +287,20 @@ export class SMTPClient { content.relatedAttachments.map((v) => v.content).join("\n"), new RegExp("--related([0-9]+)", "g"), ); - + const relatedBoundary = `related${boundaryAddRel}`; this.#connection.writeCmd( `Content-Type: multipart/related; boundary=${relatedBoundary}\r\n; type=${content.mimeType}`, ); - + this.#connection.writeCmd(`--${relatedBoundary}`); this.encodeContent(content); - + for (let i = 0; i < content.relatedAttachments.length; i++) { this.#connection.writeCmd(`--${relatedBoundary}`); this.encodeAttachment(content.relatedAttachments[i]); } - + this.#connection.writeCmd(`--${relatedBoundary}--\r\n`); }