libmime 5.1.0 → 5.2.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## v5.2.1 2023-01-27
4
+
5
+ - Fix base64 encoding for emoji bytes in encoded words
6
+
7
+ ## v5.2.0 2022-12-08
8
+
9
+ - Bumped libqp to get rid of `new Buffer` warnings
10
+
3
11
  ## v5.1.0 2022-04-28
4
12
 
5
13
  - Bumped deps
package/lib/libmime.js CHANGED
@@ -148,6 +148,12 @@ class Libmime {
148
148
  let chr = encodedStr.charAt(i);
149
149
  // check if we can add this character to the existing string
150
150
  // without breaking byte length limit
151
+
152
+ if (/[\ud83c\ud83d\ud83e]/.test(chr) && i < len - 1) {
153
+ // composite emoji byte, so add the next byte as well
154
+ chr += encodedStr.charAt(++i);
155
+ }
156
+
151
157
  if (Buffer.byteLength(lpart + chr) <= maxLength || i === 0) {
152
158
  lpart += chr;
153
159
  } else {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "libmime",
3
3
  "description": "Encode and decode quoted printable and base64 strings",
4
- "version": "5.1.0",
4
+ "version": "5.2.1",
5
5
  "main": "lib/libmime",
6
6
  "homepage": "https://github.com/andris9/libmime",
7
7
  "repository": {
@@ -22,16 +22,16 @@
22
22
  "encoding-japanese": "2.0.0",
23
23
  "iconv-lite": "0.6.3",
24
24
  "libbase64": "1.2.1",
25
- "libqp": "1.1.0"
25
+ "libqp": "2.0.1"
26
26
  },
27
27
  "devDependencies": {
28
- "chai": "4.3.6",
28
+ "chai": "4.3.7",
29
29
  "eslint-config-nodemailer": "1.2.0",
30
- "eslint-config-prettier": "8.5.0",
31
- "grunt": "1.5.2",
30
+ "eslint-config-prettier": "8.6.0",
31
+ "grunt": "1.5.3",
32
32
  "grunt-cli": "1.4.3",
33
- "grunt-eslint": "24.0.0",
33
+ "grunt-eslint": "24.0.1",
34
34
  "grunt-mocha-test": "0.13.3",
35
- "mocha": "9.2.2"
35
+ "mocha": "10.2.0"
36
36
  }
37
37
  }