@mavogel/awscdk-rootmail 0.1.51 → 0.1.53

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.
Files changed (63) hide show
  1. package/.jsii +10 -10
  2. package/lib/rootmail.js +1 -1
  3. package/lib/ses-receive.js +1 -1
  4. package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-cjs/index.js +1 -1
  5. package/node_modules/@aws-sdk/client-cloudwatch-logs/package.json +1 -1
  6. package/node_modules/@aws-sdk/client-route-53/dist-cjs/index.js +1 -1
  7. package/node_modules/@aws-sdk/client-route-53/package.json +1 -1
  8. package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +1 -1
  9. package/node_modules/@aws-sdk/client-s3/package.json +2 -2
  10. package/node_modules/@aws-sdk/client-ses/dist-cjs/index.js +1 -1
  11. package/node_modules/@aws-sdk/client-ses/package.json +1 -1
  12. package/node_modules/@aws-sdk/client-ssm/dist-cjs/index.js +1 -1
  13. package/node_modules/@aws-sdk/client-ssm/package.json +1 -1
  14. package/node_modules/@zone-eu/mailsplit/package.json +10 -5
  15. package/node_modules/libmime/CHANGELOG.md +7 -0
  16. package/node_modules/libmime/package.json +10 -6
  17. package/node_modules/libqp/CHANGELOG.md +7 -0
  18. package/node_modules/libqp/README.md +1 -1
  19. package/node_modules/libqp/dist/cjs/libqp.d.ts +8 -2
  20. package/node_modules/libqp/dist/cjs/libqp.js +159 -12
  21. package/node_modules/libqp/dist/esm/libqp.d.ts +8 -2
  22. package/node_modules/libqp/dist/esm/libqp.js +159 -12
  23. package/node_modules/libqp/lib/libqp.js +1 -1
  24. package/node_modules/libqp/package.json +14 -8
  25. package/node_modules/linkify-it/README.md +49 -86
  26. package/node_modules/linkify-it/build/index.cjs.js +636 -825
  27. package/node_modules/linkify-it/build/index.cjs.js.map +1 -0
  28. package/node_modules/linkify-it/build/index.d.ts +236 -0
  29. package/node_modules/linkify-it/build/index.mjs +538 -0
  30. package/node_modules/linkify-it/build/index.mjs.map +1 -0
  31. package/node_modules/linkify-it/package.json +23 -20
  32. package/node_modules/mailparser/CHANGELOG.md +14 -0
  33. package/node_modules/mailparser/dist/cjs/mail-parser.js +34 -14
  34. package/node_modules/mailparser/dist/esm/mail-parser.js +34 -14
  35. package/node_modules/mailparser/package.json +11 -7
  36. package/node_modules/nodemailer/CHANGELOG.md +13 -0
  37. package/node_modules/nodemailer/README.md +4 -0
  38. package/node_modules/nodemailer/dist/cjs/fetch/cookies.js +4 -1
  39. package/node_modules/nodemailer/dist/cjs/package-info.d.ts +1 -1
  40. package/node_modules/nodemailer/dist/cjs/package-info.js +1 -1
  41. package/node_modules/nodemailer/dist/cjs/smtp-connection/index.d.ts +3 -0
  42. package/node_modules/nodemailer/dist/cjs/smtp-connection/index.js +11 -3
  43. package/node_modules/nodemailer/dist/esm/fetch/cookies.js +4 -1
  44. package/node_modules/nodemailer/dist/esm/package-info.d.ts +1 -1
  45. package/node_modules/nodemailer/dist/esm/package-info.js +1 -1
  46. package/node_modules/nodemailer/dist/esm/smtp-connection/index.d.ts +3 -0
  47. package/node_modules/nodemailer/dist/esm/smtp-connection/index.js +11 -3
  48. package/node_modules/nodemailer/package.json +11 -6
  49. package/node_modules/uc.micro/README.md +18 -1
  50. package/node_modules/uc.micro/build/index.cjs.js +13 -18
  51. package/node_modules/uc.micro/build/index.d.ts +6 -0
  52. package/node_modules/uc.micro/build/index.mjs +8 -0
  53. package/node_modules/uc.micro/package.json +12 -17
  54. package/package.json +11 -11
  55. package/node_modules/linkify-it/index.mjs +0 -646
  56. package/node_modules/linkify-it/lib/re.mjs +0 -193
  57. package/node_modules/uc.micro/categories/Cc/regex.mjs +0 -1
  58. package/node_modules/uc.micro/categories/Cf/regex.mjs +0 -1
  59. package/node_modules/uc.micro/categories/P/regex.mjs +0 -1
  60. package/node_modules/uc.micro/categories/S/regex.mjs +0 -1
  61. package/node_modules/uc.micro/categories/Z/regex.mjs +0 -1
  62. package/node_modules/uc.micro/index.mjs +0 -8
  63. package/node_modules/uc.micro/properties/Any/regex.mjs +0 -1
package/.jsii CHANGED
@@ -8,17 +8,17 @@
8
8
  ]
9
9
  },
10
10
  "bundled": {
11
- "@aws-sdk/client-cloudwatch-logs": "^3.1169.0",
12
- "@aws-sdk/client-route-53": "^3.1169.0",
13
- "@aws-sdk/client-s3": "^3.1169.0",
14
- "@aws-sdk/client-ses": "^3.1169.0",
15
- "@aws-sdk/client-ssm": "^3.1169.0",
11
+ "@aws-sdk/client-cloudwatch-logs": "^3.1170.0",
12
+ "@aws-sdk/client-route-53": "^3.1170.0",
13
+ "@aws-sdk/client-s3": "^3.1170.0",
14
+ "@aws-sdk/client-ses": "^3.1170.0",
15
+ "@aws-sdk/client-ssm": "^3.1170.0",
16
16
  "cdk-nag": "^3.0.1",
17
- "mailparser": "^3.14.3",
17
+ "mailparser": "^3.14.5",
18
18
  "uuid": "^14.0.3"
19
19
  },
20
20
  "dependencies": {
21
- "@mavogel/mvc-projen": "^0.0.76",
21
+ "@mavogel/mvc-projen": "^0.0.79",
22
22
  "aws-cdk-lib": "^2.263.0",
23
23
  "constructs": "^10.5.1"
24
24
  },
@@ -9167,7 +9167,7 @@
9167
9167
  "stability": "experimental"
9168
9168
  },
9169
9169
  "homepage": "https://github.com/mavogel/awscdk-rootmail",
9170
- "jsiiVersion": "5.9.58 (build 68a8fa1)",
9170
+ "jsiiVersion": "5.9.60 (build 50865f3)",
9171
9171
  "keywords": [
9172
9172
  "aws",
9173
9173
  "cdk",
@@ -9620,6 +9620,6 @@
9620
9620
  "symbolId": "src/ses-receive:SESReceiveProps"
9621
9621
  }
9622
9622
  },
9623
- "version": "0.1.51",
9624
- "fingerprint": "nAlAf9cT+GTRP0EJ46+uy4OwGlPL61EnmFp7f7luaxY="
9623
+ "version": "0.1.53",
9624
+ "fingerprint": "oiUFBXp1lxzRqsSedxdCufjbt9qG5imMRxK3G+IP5Yc="
9625
9625
  }
package/lib/rootmail.js CHANGED
@@ -11,7 +11,7 @@ const ses_receive_1 = require("./ses-receive");
11
11
  * Rootmail construct
12
12
  */
13
13
  class Rootmail extends constructs_1.Construct {
14
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@mavogel/awscdk-rootmail.Rootmail", version: "0.1.51" };
14
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@mavogel/awscdk-rootmail.Rootmail", version: "0.1.53" };
15
15
  /**
16
16
  * The name parameter in SSM to store the domain name server.
17
17
  */
@@ -11,7 +11,7 @@ const ses_receipt_ruleset_activation_1 = require("./ses-receipt-ruleset-activati
11
11
  * SES Receive construct
12
12
  */
13
13
  class SESReceive extends constructs_1.Construct {
14
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@mavogel/awscdk-rootmail.SESReceive", version: "0.1.51" };
14
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@mavogel/awscdk-rootmail.SESReceive", version: "0.1.53" };
15
15
  constructor(scope, id, props) {
16
16
  super(scope, id);
17
17
  const filteredEmailSubjects = props.filteredEmailSubjects || [];
@@ -70,7 +70,7 @@ const commonParams = {
70
70
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
71
71
  };
72
72
 
73
- var version = "3.1168.0";
73
+ var version = "3.1169.0";
74
74
  var packageInfo = {
75
75
  version: version};
76
76
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-cloudwatch-logs",
3
- "version": "3.1169.0",
3
+ "version": "3.1170.0",
4
4
  "description": "AWS SDK for JavaScript Cloudwatch Logs Client for Node.js, Browser and React Native",
5
5
  "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloudwatch-logs",
6
6
  "license": "Apache-2.0",
@@ -70,7 +70,7 @@ const commonParams = {
70
70
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
71
71
  };
72
72
 
73
- var version = "3.1168.0";
73
+ var version = "3.1169.0";
74
74
  var packageInfo = {
75
75
  version: version};
76
76
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-route-53",
3
- "version": "3.1169.0",
3
+ "version": "3.1170.0",
4
4
  "description": "AWS SDK for JavaScript Route 53 Client for Node.js, Browser and React Native",
5
5
  "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-route-53",
6
6
  "license": "Apache-2.0",
@@ -4779,7 +4779,7 @@ var WriteGetObjectResponse$ = [9, n0, _WGOR,
4779
4779
  class CreateSessionCommand extends command(_ep4, _mw0, "CreateSession", CreateSession$) {
4780
4780
  }
4781
4781
 
4782
- var version = "3.1168.0";
4782
+ var version = "3.1169.0";
4783
4783
  var packageInfo = {
4784
4784
  version: version};
4785
4785
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-s3",
3
- "version": "3.1169.0",
3
+ "version": "3.1170.0",
4
4
  "description": "AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",
5
5
  "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3",
6
6
  "license": "Apache-2.0",
@@ -67,7 +67,7 @@
67
67
  "tslib": "^2.6.2"
68
68
  },
69
69
  "devDependencies": {
70
- "@aws-sdk/signature-v4-crt": "3.1169.0",
70
+ "@aws-sdk/signature-v4-crt": "3.1170.0",
71
71
  "@smithy/snapshot-testing": "^2.4.0",
72
72
  "@tsconfig/node20": "20.1.8",
73
73
  "@types/node": "^20.14.8",
@@ -69,7 +69,7 @@ const commonParams = {
69
69
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
70
70
  };
71
71
 
72
- var version = "3.1168.0";
72
+ var version = "3.1169.0";
73
73
  var packageInfo = {
74
74
  version: version};
75
75
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-ses",
3
- "version": "3.1169.0",
3
+ "version": "3.1170.0",
4
4
  "description": "AWS SDK for JavaScript Ses Client for Node.js, Browser and React Native",
5
5
  "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-ses",
6
6
  "license": "Apache-2.0",
@@ -69,7 +69,7 @@ const commonParams = {
69
69
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
70
70
  };
71
71
 
72
- var version = "3.1168.0";
72
+ var version = "3.1169.0";
73
73
  var packageInfo = {
74
74
  version: version};
75
75
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-ssm",
3
- "version": "3.1169.0",
3
+ "version": "3.1170.0",
4
4
  "description": "AWS SDK for JavaScript Ssm Client for Node.js, Browser and React Native",
5
5
  "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-ssm",
6
6
  "license": "Apache-2.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zone-eu/mailsplit",
3
- "version": "5.4.30",
3
+ "version": "5.4.31",
4
4
  "description": "Split email messages into an object stream",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -25,8 +25,8 @@
25
25
  "license": "(MIT OR EUPL-1.1+)",
26
26
  "dependencies": {
27
27
  "libbase64": "1.4.1",
28
- "libmime": "5.6.4",
29
- "libqp": "3.0.1"
28
+ "libmime": "5.6.5",
29
+ "libqp": "3.0.2"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@eslint/js": "10.0.1",
@@ -34,10 +34,10 @@
34
34
  "@types/libqp": "1.1.3",
35
35
  "@types/node": "26.6.6",
36
36
  "c8": "12.0.0",
37
- "eslint": "10.14.0",
37
+ "eslint": "10.15.0",
38
38
  "eslint-config-prettier": "10.1.8",
39
39
  "globals": "17.14.0",
40
- "prettier": "3.9.10",
40
+ "prettier": "3.10.1",
41
41
  "random-message": "1.1.0",
42
42
  "typescript": "7.0.2"
43
43
  },
@@ -49,5 +49,10 @@
49
49
  "repository": {
50
50
  "type": "git",
51
51
  "url": "https://github.com/zone-eu/mailsplit.git"
52
+ },
53
+ "overrides": {
54
+ "glob": "14.0.6",
55
+ "minimatch": "11.0.8",
56
+ "mkdirp": "0.5.6"
52
57
  }
53
58
  }
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [5.6.5](https://github.com/nodemailer/libmime/compare/v5.6.4...v5.6.5) (2026-11-15)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * update dependencies ([7b69694](https://github.com/nodemailer/libmime/commit/7b69694bc163d9d3c5d670ffa41ebae16c33ccc9))
9
+
3
10
  ## [5.6.4](https://github.com/nodemailer/libmime/compare/v5.6.3...v5.6.4) (2026-11-04)
4
11
 
5
12
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "libmime",
3
3
  "description": "Encode and decode quoted printable and base64 strings",
4
- "version": "5.6.4",
4
+ "version": "5.6.5",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/libmime.js",
7
7
  "types": "./dist/cjs/libmime.d.ts",
@@ -67,21 +67,25 @@
67
67
  "encoding-japanese": "2.5.0",
68
68
  "iconv-lite": "0.7.3",
69
69
  "libbase64": "1.4.1",
70
- "libqp": "3.0.1"
70
+ "libqp": "3.0.2"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@types/node": "20.19.43",
74
74
  "c8": "12.0.0",
75
- "eslint": "10.14.0",
75
+ "eslint": "10.15.0",
76
76
  "eslint-config-prettier": "10.1.8",
77
77
  "globals": "17.14.0",
78
- "nodemailer": "10.3.1",
79
- "prettier": "3.9.10",
78
+ "nodemailer": "10.6.0",
79
+ "prettier": "3.10.1",
80
80
  "tsx": "4.23.15",
81
81
  "typescript": "6.0.3",
82
- "typescript-eslint": "8.72.1"
82
+ "typescript-eslint": "8.72.2"
83
83
  },
84
84
  "engines": {
85
85
  "node": ">=20.0.0"
86
+ },
87
+ "overrides": {
88
+ "glob": "14.0.6",
89
+ "minimatch": "11.0.8"
86
90
  }
87
91
  }
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.0.2](https://github.com/nodemailer/libqp/compare/v3.0.1...v3.0.2) (2026-11-15)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **decoder:** decode the input as it arrives instead of buffering it until the end ([#8](https://github.com/nodemailer/libqp/issues/8)) ([872ef59](https://github.com/nodemailer/libqp/commit/872ef59fc2efe59768ad43536600d29c1f590794))
9
+
3
10
  ## [3.0.1](https://github.com/nodemailer/libqp/compare/v3.0.0...v3.0.1) (2026-10-18)
4
11
 
5
12
 
@@ -129,7 +129,7 @@ Where
129
129
 
130
130
  - **options** is the optional stream options object
131
131
 
132
- The Decoder collects its input and decodes it once the input ends, so escape sequences and soft line breaks split between chunks are decoded correctly.
132
+ The Decoder decodes its input byte by byte as it arrives and holds back only what the following input can still change: whitespace that may end a line, a `=` that may start a soft line break, and an escape sequence that is not complete yet. Escape sequences and soft line breaks split between chunks or lines are decoded the same as with `decode()` of the whole input.
133
133
 
134
134
  **Example**
135
135
 
@@ -52,8 +52,14 @@ export declare class Encoder extends Transform {
52
52
  }
53
53
  /**
54
54
  * Creates a transform stream for decoding Quoted-Printable encoded strings.
55
- * The input is not actually processed as a stream but concatted and processed as a single input,
56
- * so escapes and soft line breaks split across chunks decode the same as unsplit input
55
+ *
56
+ * Decodes byte by byte as the input arrives, in the three steps of decode(), each run as a small
57
+ * state machine: whitespace in front of a line break is removed, then soft line breaks, then
58
+ * escapes are decoded. Across chunks it carries only what the next bytes can still change: a run
59
+ * of whitespace that may turn out to end a line, a "=" (or "=" and a CR) that may start a soft
60
+ * line break, and a "=" (or "=" and a hex digit) that may start an escape. Escapes and soft line
61
+ * breaks split across chunks or lines decode the same as unsplit input ("==\nA=\nB" is the single
62
+ * byte 0xAB), and the output equals decode() of the whole input however the input is split.
57
63
  */
58
64
  export declare class Decoder extends Transform {
59
65
  options: DecoderOptions;
@@ -325,10 +325,20 @@ class Encoder extends node_stream_1.Transform {
325
325
  }
326
326
  }
327
327
  exports.Encoder = Encoder;
328
+ /** The size the Decoder's buffer for a pending whitespace run starts at */
329
+ const BLANKS_START = 64;
330
+ /** A whitespace run buffer up to this size is kept for the next run, a larger one is dropped */
331
+ const BLANKS_KEEP = 64 * 1024;
328
332
  /**
329
333
  * Creates a transform stream for decoding Quoted-Printable encoded strings.
330
- * The input is not actually processed as a stream but concatted and processed as a single input,
331
- * so escapes and soft line breaks split across chunks decode the same as unsplit input
334
+ *
335
+ * Decodes byte by byte as the input arrives, in the three steps of decode(), each run as a small
336
+ * state machine: whitespace in front of a line break is removed, then soft line breaks, then
337
+ * escapes are decoded. Across chunks it carries only what the next bytes can still change: a run
338
+ * of whitespace that may turn out to end a line, a "=" (or "=" and a CR) that may start a soft
339
+ * line break, and a "=" (or "=" and a hex digit) that may start an escape. Escapes and soft line
340
+ * breaks split across chunks or lines decode the same as unsplit input ("==\nA=\nB" is the single
341
+ * byte 0xAB), and the output equals decode() of the whole input however the input is split.
332
342
  */
333
343
  class Decoder extends node_stream_1.Transform {
334
344
  /**
@@ -340,7 +350,14 @@ class Decoder extends node_stream_1.Transform {
340
350
  this.options = opts;
341
351
  this.inputBytes = 0;
342
352
  this.outputBytes = 0;
343
- this.qpChunks = [];
353
+ this._blanks = Buffer.alloc(0);
354
+ this._blankCount = 0;
355
+ this._soft = 0;
356
+ this._escape = 0;
357
+ this._escapeHigh = 0;
358
+ this._out = Buffer.alloc(0);
359
+ this._outPos = 0;
360
+ this._left = 0;
344
361
  }
345
362
  /** @internal */
346
363
  _transform(chunk, encoding, done) {
@@ -348,23 +365,153 @@ class Decoder extends node_stream_1.Transform {
348
365
  return done();
349
366
  }
350
367
  const buf = toBuffer(chunk, encoding);
351
- // kept as a binary string, so joining the chunks is the only copy made before decoding
352
- this.qpChunks.push(buf.toString('binary'));
353
368
  this.inputBytes += buf.length;
369
+ // all output comes from input bytes: those of this chunk and those held back before it, at
370
+ // most four bytes of a soft line break and an escape, and whitespace (room made when it is kept)
371
+ this._begin(buf.length + 4);
372
+ for (let i = 0; i < buf.length; i++) {
373
+ this._left = buf.length - i;
374
+ this._trim(buf[i]);
375
+ }
376
+ this._left = 0;
377
+ this._end();
354
378
  done();
355
379
  }
356
380
  /** @internal */
357
381
  _flush(done) {
358
- if (this.inputBytes) {
359
- const input = this.qpChunks.join('');
360
- // the chunks are not needed anymore, release them before decoding allocates more
361
- this.qpChunks = [];
362
- const buf = decode(input);
363
- this.outputBytes += buf.length;
364
- this.push(buf);
382
+ this._begin(4);
383
+ // whitespace at the end of the input is removed
384
+ this._dropBlanks();
385
+ if (this._soft === 2) {
386
+ // "=" and a CR at the end are no soft line break
387
+ this._unescape(0x3d);
388
+ this._unescape(0x0d);
389
+ }
390
+ // a "=" at the end is a soft line break and is removed
391
+ this._soft = 0;
392
+ if (this._escape >= 1) {
393
+ this._emit(0x3d);
365
394
  }
395
+ if (this._escape === 2) {
396
+ this._emit(this._escapeHigh);
397
+ }
398
+ this._escape = 0;
399
+ this._end();
366
400
  done();
367
401
  }
402
+ /** Step 1, whitespace in front of a line break @internal */
403
+ _trim(byte) {
404
+ if (byte === 0x20 || byte === 0x09) {
405
+ if (this._blankCount === this._blanks.length) {
406
+ const blanks = Buffer.allocUnsafe(Math.max(BLANKS_START, this._blanks.length * 2));
407
+ this._blanks.copy(blanks, 0, 0, this._blankCount);
408
+ this._blanks = blanks;
409
+ }
410
+ this._blanks[this._blankCount++] = byte;
411
+ return;
412
+ }
413
+ if (this._blankCount) {
414
+ if (byte !== 0x0a && byte !== 0x0d) {
415
+ // not at the end of a line: the whitespace is kept. Its first byte completes what a
416
+ // "=" in front of it started; after that no soft line break or escape is pending, and
417
+ // the rest passes through both steps unchanged
418
+ this._reserve(this._blankCount);
419
+ this._soften(this._blanks[0]);
420
+ this._outPos += this._blanks.copy(this._out, this._outPos, 1, this._blankCount);
421
+ }
422
+ this._dropBlanks();
423
+ }
424
+ this._soften(byte);
425
+ }
426
+ /** Ends the pending whitespace run, keeping a small buffer for the next one @internal */
427
+ _dropBlanks() {
428
+ this._blankCount = 0;
429
+ if (this._blanks.length > BLANKS_KEEP) {
430
+ this._blanks = Buffer.alloc(0);
431
+ }
432
+ }
433
+ /** Step 2, soft line breaks: "=" followed by LF or CR LF @internal */
434
+ _soften(byte) {
435
+ if (this._soft === 1) {
436
+ if (byte === 0x0a) {
437
+ this._soft = 0;
438
+ return;
439
+ }
440
+ if (byte === 0x0d) {
441
+ this._soft = 2;
442
+ return;
443
+ }
444
+ this._soft = 0;
445
+ this._unescape(0x3d);
446
+ }
447
+ else if (this._soft === 2) {
448
+ this._soft = 0;
449
+ if (byte === 0x0a) {
450
+ return;
451
+ }
452
+ this._unescape(0x3d);
453
+ this._unescape(0x0d);
454
+ }
455
+ if (byte === 0x3d) {
456
+ this._soft = 1;
457
+ return;
458
+ }
459
+ this._unescape(byte);
460
+ }
461
+ /** Step 3, escapes: "=" followed by two hex digits @internal */
462
+ _unescape(byte) {
463
+ if (this._escape === 1) {
464
+ if (hexValue(byte) >= 0) {
465
+ this._escape = 2;
466
+ this._escapeHigh = byte;
467
+ return;
468
+ }
469
+ this._escape = 0;
470
+ this._emit(0x3d);
471
+ }
472
+ else if (this._escape === 2) {
473
+ this._escape = 0;
474
+ const low = hexValue(byte);
475
+ if (low >= 0) {
476
+ this._emit(hexValue(this._escapeHigh) * 16 + low);
477
+ return;
478
+ }
479
+ this._emit(0x3d);
480
+ this._emit(this._escapeHigh);
481
+ }
482
+ if (byte === 0x3d) {
483
+ this._escape = 1;
484
+ return;
485
+ }
486
+ this._emit(byte);
487
+ }
488
+ /** @internal */
489
+ _begin(size) {
490
+ this._out = Buffer.allocUnsafe(size);
491
+ this._outPos = 0;
492
+ }
493
+ /** Makes room for `size` more bytes besides the rest of the current chunk @internal */
494
+ _reserve(size) {
495
+ const needed = this._outPos + size + this._left + 4;
496
+ if (needed > this._out.length) {
497
+ const out = Buffer.allocUnsafe(Math.max(this._out.length * 2, needed));
498
+ this._out.copy(out, 0, 0, this._outPos);
499
+ this._out = out;
500
+ }
501
+ }
502
+ /** @internal */
503
+ _emit(byte) {
504
+ this._out[this._outPos++] = byte;
505
+ }
506
+ /** @internal */
507
+ _end() {
508
+ if (this._outPos) {
509
+ this.outputBytes += this._outPos;
510
+ this.push(this._out.subarray(0, this._outPos));
511
+ }
512
+ this._out = Buffer.alloc(0);
513
+ this._outPos = 0;
514
+ }
368
515
  }
369
516
  exports.Decoder = Decoder;
370
517
  const libqp = {
@@ -52,8 +52,14 @@ export declare class Encoder extends Transform {
52
52
  }
53
53
  /**
54
54
  * Creates a transform stream for decoding Quoted-Printable encoded strings.
55
- * The input is not actually processed as a stream but concatted and processed as a single input,
56
- * so escapes and soft line breaks split across chunks decode the same as unsplit input
55
+ *
56
+ * Decodes byte by byte as the input arrives, in the three steps of decode(), each run as a small
57
+ * state machine: whitespace in front of a line break is removed, then soft line breaks, then
58
+ * escapes are decoded. Across chunks it carries only what the next bytes can still change: a run
59
+ * of whitespace that may turn out to end a line, a "=" (or "=" and a CR) that may start a soft
60
+ * line break, and a "=" (or "=" and a hex digit) that may start an escape. Escapes and soft line
61
+ * breaks split across chunks or lines decode the same as unsplit input ("==\nA=\nB" is the single
62
+ * byte 0xAB), and the output equals decode() of the whole input however the input is split.
57
63
  */
58
64
  export declare class Decoder extends Transform {
59
65
  options: DecoderOptions;