mikromail 0.0.4 → 0.0.5

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/lib/MikroMail.js CHANGED
@@ -168,35 +168,6 @@ var import_node_tls = __toESM(require("tls"));
168
168
 
169
169
  // src/utils/index.ts
170
170
  var import_node_dns = require("dns");
171
- function encodeQuotedPrintable(text) {
172
- let result = text.replace(/\r?\n/g, "\r\n");
173
- result = result.replace(/=/g, "=3D");
174
- const utf8Bytes = new TextEncoder().encode(result);
175
- let encoded = "";
176
- let lineLength = 0;
177
- for (let i = 0; i < utf8Bytes.length; i++) {
178
- const byte = utf8Bytes[i];
179
- let chunk = "";
180
- if (byte >= 33 && byte <= 126 && byte !== 61 || byte === 32) {
181
- chunk = String.fromCharCode(byte);
182
- } else if (byte === 13 || byte === 10) {
183
- chunk = String.fromCharCode(byte);
184
- if (byte === 10) {
185
- lineLength = 0;
186
- }
187
- } else {
188
- const hex = byte.toString(16).toUpperCase();
189
- chunk = `=${hex.length < 2 ? `0${hex}` : hex}`;
190
- }
191
- if (lineLength + chunk.length > 75 && !(byte === 13 || byte === 10)) {
192
- encoded += "=\r\n";
193
- lineLength = 0;
194
- }
195
- encoded += chunk;
196
- lineLength += chunk.length;
197
- }
198
- return encoded;
199
- }
200
171
  function validateEmail(email) {
201
172
  try {
202
173
  const [localPart, domain] = email.split("@");
@@ -618,13 +589,13 @@ var SMTPClient = class {
618
589
  Content-Type: text/plain; charset=utf-8\r
619
590
  Content-Transfer-Encoding: quoted-printable\r
620
591
  \r
621
- ${encodeQuotedPrintable(text || "")}\r
592
+ ${text || ""}\r
622
593
  \r
623
594
  --${boundary}\r
624
595
  Content-Type: text/html; charset=utf-8\r
625
596
  Content-Transfer-Encoding: quoted-printable\r
626
597
  \r
627
- ${encodeQuotedPrintable(html || "")}\r
598
+ ${html || ""}\r
628
599
  \r
629
600
  --${boundary}--\r
630
601
  `;
package/lib/MikroMail.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  MikroMail
3
- } from "./chunk-TBZ7DVGE.mjs";
3
+ } from "./chunk-JNBOBHOL.mjs";
4
4
  import "./chunk-YVXB6HCK.mjs";
5
- import "./chunk-5JI6BRUL.mjs";
5
+ import "./chunk-NGYJ2CZH.mjs";
6
6
  import "./chunk-47VXJTWV.mjs";
7
7
  import "./chunk-UDLJWUFN.mjs";
8
8
  export {
package/lib/SMTPClient.js CHANGED
@@ -41,35 +41,6 @@ var import_node_tls = __toESM(require("tls"));
41
41
 
42
42
  // src/utils/index.ts
43
43
  var import_node_dns = require("dns");
44
- function encodeQuotedPrintable(text) {
45
- let result = text.replace(/\r?\n/g, "\r\n");
46
- result = result.replace(/=/g, "=3D");
47
- const utf8Bytes = new TextEncoder().encode(result);
48
- let encoded = "";
49
- let lineLength = 0;
50
- for (let i = 0; i < utf8Bytes.length; i++) {
51
- const byte = utf8Bytes[i];
52
- let chunk = "";
53
- if (byte >= 33 && byte <= 126 && byte !== 61 || byte === 32) {
54
- chunk = String.fromCharCode(byte);
55
- } else if (byte === 13 || byte === 10) {
56
- chunk = String.fromCharCode(byte);
57
- if (byte === 10) {
58
- lineLength = 0;
59
- }
60
- } else {
61
- const hex = byte.toString(16).toUpperCase();
62
- chunk = `=${hex.length < 2 ? `0${hex}` : hex}`;
63
- }
64
- if (lineLength + chunk.length > 75 && !(byte === 13 || byte === 10)) {
65
- encoded += "=\r\n";
66
- lineLength = 0;
67
- }
68
- encoded += chunk;
69
- lineLength += chunk.length;
70
- }
71
- return encoded;
72
- }
73
44
  function validateEmail(email) {
74
45
  try {
75
46
  const [localPart, domain] = email.split("@");
@@ -474,13 +445,13 @@ var SMTPClient = class {
474
445
  Content-Type: text/plain; charset=utf-8\r
475
446
  Content-Transfer-Encoding: quoted-printable\r
476
447
  \r
477
- ${encodeQuotedPrintable(text || "")}\r
448
+ ${text || ""}\r
478
449
  \r
479
450
  --${boundary}\r
480
451
  Content-Type: text/html; charset=utf-8\r
481
452
  Content-Transfer-Encoding: quoted-printable\r
482
453
  \r
483
- ${encodeQuotedPrintable(html || "")}\r
454
+ ${html || ""}\r
484
455
  \r
485
456
  --${boundary}--\r
486
457
  `;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SMTPClient
3
- } from "./chunk-5JI6BRUL.mjs";
3
+ } from "./chunk-NGYJ2CZH.mjs";
4
4
  import "./chunk-UDLJWUFN.mjs";
5
5
  export {
6
6
  SMTPClient
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-YVXB6HCK.mjs";
4
4
  import {
5
5
  SMTPClient
6
- } from "./chunk-5JI6BRUL.mjs";
6
+ } from "./chunk-NGYJ2CZH.mjs";
7
7
  import {
8
8
  verifyEmailDomain
9
9
  } from "./chunk-UDLJWUFN.mjs";
@@ -1,5 +1,4 @@
1
1
  import {
2
- encodeQuotedPrintable,
3
2
  validateEmail
4
3
  } from "./chunk-UDLJWUFN.mjs";
5
4
 
@@ -383,13 +382,13 @@ var SMTPClient = class {
383
382
  Content-Type: text/plain; charset=utf-8\r
384
383
  Content-Transfer-Encoding: quoted-printable\r
385
384
  \r
386
- ${encodeQuotedPrintable(text || "")}\r
385
+ ${text || ""}\r
387
386
  \r
388
387
  --${boundary}\r
389
388
  Content-Type: text/html; charset=utf-8\r
390
389
  Content-Transfer-Encoding: quoted-printable\r
391
390
  \r
392
- ${encodeQuotedPrintable(html || "")}\r
391
+ ${html || ""}\r
393
392
  \r
394
393
  --${boundary}--\r
395
394
  `;
package/lib/index.js CHANGED
@@ -168,35 +168,6 @@ var import_node_tls = __toESM(require("tls"));
168
168
 
169
169
  // src/utils/index.ts
170
170
  var import_node_dns = require("dns");
171
- function encodeQuotedPrintable(text) {
172
- let result = text.replace(/\r?\n/g, "\r\n");
173
- result = result.replace(/=/g, "=3D");
174
- const utf8Bytes = new TextEncoder().encode(result);
175
- let encoded = "";
176
- let lineLength = 0;
177
- for (let i = 0; i < utf8Bytes.length; i++) {
178
- const byte = utf8Bytes[i];
179
- let chunk = "";
180
- if (byte >= 33 && byte <= 126 && byte !== 61 || byte === 32) {
181
- chunk = String.fromCharCode(byte);
182
- } else if (byte === 13 || byte === 10) {
183
- chunk = String.fromCharCode(byte);
184
- if (byte === 10) {
185
- lineLength = 0;
186
- }
187
- } else {
188
- const hex = byte.toString(16).toUpperCase();
189
- chunk = `=${hex.length < 2 ? `0${hex}` : hex}`;
190
- }
191
- if (lineLength + chunk.length > 75 && !(byte === 13 || byte === 10)) {
192
- encoded += "=\r\n";
193
- lineLength = 0;
194
- }
195
- encoded += chunk;
196
- lineLength += chunk.length;
197
- }
198
- return encoded;
199
- }
200
171
  function validateEmail(email) {
201
172
  try {
202
173
  const [localPart, domain] = email.split("@");
@@ -618,13 +589,13 @@ var SMTPClient = class {
618
589
  Content-Type: text/plain; charset=utf-8\r
619
590
  Content-Transfer-Encoding: quoted-printable\r
620
591
  \r
621
- ${encodeQuotedPrintable(text || "")}\r
592
+ ${text || ""}\r
622
593
  \r
623
594
  --${boundary}\r
624
595
  Content-Type: text/html; charset=utf-8\r
625
596
  Content-Transfer-Encoding: quoted-printable\r
626
597
  \r
627
- ${encodeQuotedPrintable(html || "")}\r
598
+ ${html || ""}\r
628
599
  \r
629
600
  --${boundary}--\r
630
601
  `;
package/lib/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  MikroMail
3
- } from "./chunk-TBZ7DVGE.mjs";
3
+ } from "./chunk-JNBOBHOL.mjs";
4
4
  import "./chunk-YVXB6HCK.mjs";
5
- import "./chunk-5JI6BRUL.mjs";
5
+ import "./chunk-NGYJ2CZH.mjs";
6
6
  import "./chunk-47VXJTWV.mjs";
7
7
  import "./chunk-UDLJWUFN.mjs";
8
8
  export {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mikromail",
3
3
  "description": "Lightweight replacement for Nodemailer, supporting HTML, international symbols, and more.",
4
- "version": "0.0.4",
4
+ "version": "0.0.5",
5
5
  "author": "Mikael Vesavuori",
6
6
  "license": "MIT",
7
7
  "keywords": [