arn-rawmime 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arn-rawmime",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "A lightweight, dependency-free raw MIME email builder with DKIM support.",
5
5
  "author": "ARNDESK",
6
6
  "type": "module",
@@ -60,6 +60,7 @@ export class MimeMessage {
60
60
  data: string | Buffer;
61
61
  encoding?: "quoted-printable" | "base64" | "7bit" | "8bit";
62
62
  charset?: "UTF-8" | "ISO-8859-1" | "US-ASCII" | (string & {});
63
+ autoMinify?: boolean;
63
64
  }): void;
64
65
 
65
66
  /**
@@ -475,8 +475,12 @@ class MimeMessage {
475
475
  }
476
476
 
477
477
  // Default encoding is now 'quoted-printable'
478
- addText({ data, encoding = "quoted-printable", charset = "UTF-8" }) {
479
- this._addBodyPart(data, "text/plain", encoding, charset);
478
+ addText({ data, encoding = "quoted-printable", charset = "UTF-8", autoMinify = false }) {
479
+ let finalData = data;
480
+ if (autoMinify && typeof finalData === "string") {
481
+ finalData = finalData.replace(/\s+/g, " ").trim();
482
+ }
483
+ this._addBodyPart(finalData, "text/plain", encoding, charset);
480
484
  }
481
485
 
482
486
  /**