@upyo/smtp 0.2.0-dev.26 → 0.2.1-dev.28

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/dist/index.cjs CHANGED
@@ -24,6 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  const node_net = __toESM(require("node:net"));
25
25
  const node_tls = __toESM(require("node:tls"));
26
26
  const __upyo_core = __toESM(require("@upyo/core"));
27
+ const node_buffer = __toESM(require("node:buffer"));
27
28
 
28
29
  //#region src/config.ts
29
30
  /**
@@ -364,7 +365,7 @@ function generateMessageId() {
364
365
  function encodeHeaderValue(value) {
365
366
  if (!/^[\x20-\x7E]*$/.test(value)) {
366
367
  const utf8Bytes = new TextEncoder().encode(value);
367
- const base64 = btoa(String.fromCharCode(...utf8Bytes));
368
+ const base64 = node_buffer.Buffer.from(utf8Bytes).toString("base64");
368
369
  const maxEncodedLength = 75;
369
370
  const encodedWord = `=?UTF-8?B?${base64}?=`;
370
371
  if (encodedWord.length <= maxEncodedLength) return encodedWord;
@@ -409,7 +410,7 @@ function encodeQuotedPrintable(text) {
409
410
  return result;
410
411
  }
411
412
  function encodeBase64(data) {
412
- const base64 = btoa(String.fromCharCode(...data));
413
+ const base64 = node_buffer.Buffer.from(data).toString("base64");
413
414
  return base64.replace(/(.{76})/g, "$1\r\n").trim();
414
415
  }
415
416
 
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Socket } from "node:net";
2
2
  import { connect } from "node:tls";
3
3
  import { formatAddress } from "@upyo/core";
4
+ import { Buffer } from "node:buffer";
4
5
 
5
6
  //#region src/config.ts
6
7
  /**
@@ -341,7 +342,7 @@ function generateMessageId() {
341
342
  function encodeHeaderValue(value) {
342
343
  if (!/^[\x20-\x7E]*$/.test(value)) {
343
344
  const utf8Bytes = new TextEncoder().encode(value);
344
- const base64 = btoa(String.fromCharCode(...utf8Bytes));
345
+ const base64 = Buffer.from(utf8Bytes).toString("base64");
345
346
  const maxEncodedLength = 75;
346
347
  const encodedWord = `=?UTF-8?B?${base64}?=`;
347
348
  if (encodedWord.length <= maxEncodedLength) return encodedWord;
@@ -386,7 +387,7 @@ function encodeQuotedPrintable(text) {
386
387
  return result;
387
388
  }
388
389
  function encodeBase64(data) {
389
- const base64 = btoa(String.fromCharCode(...data));
390
+ const base64 = Buffer.from(data).toString("base64");
390
391
  return base64.replace(/(.{76})/g, "$1\r\n").trim();
391
392
  }
392
393
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@upyo/smtp",
3
- "version": "0.2.0-dev.26+8f57766a",
3
+ "version": "0.2.1-dev.28+d9e603b0",
4
4
  "description": "SMTP transport for Upyo email library",
5
5
  "keywords": [
6
6
  "email",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "sideEffects": false,
55
55
  "peerDependencies": {
56
- "@upyo/core": "0.2.0-dev.26+8f57766a"
56
+ "@upyo/core": "0.2.1-dev.28+d9e603b0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@dotenvx/dotenvx": "^1.47.3",