libmime 5.2.1 → 5.3.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.
@@ -0,0 +1,37 @@
1
+ on:
2
+ push:
3
+ branches:
4
+ - master
5
+
6
+ permissions:
7
+ contents: write
8
+ pull-requests: write
9
+ id-token: write
10
+
11
+ name: release
12
+ jobs:
13
+ release-please:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: google-github-actions/release-please-action@v3
17
+ id: release
18
+ with:
19
+ release-type: node
20
+ package-name: ${{vars.NPM_MODULE_NAME}}
21
+ pull-request-title-pattern: 'chore${scope}: release ${version} [skip-ci]'
22
+ # The logic below handles the npm publication:
23
+ - uses: actions/checkout@v4
24
+ # these if statements ensure that a publication only occurs when
25
+ # a new release is created:
26
+ if: ${{ steps.release.outputs.release_created }}
27
+ - uses: actions/setup-node@v4
28
+ with:
29
+ node-version: 20
30
+ registry-url: 'https://registry.npmjs.org'
31
+ if: ${{ steps.release.outputs.release_created }}
32
+ - run: npm ci
33
+ if: ${{ steps.release.outputs.release_created }}
34
+ - run: npm publish --provenance --access public
35
+ env:
36
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
37
+ if: ${{ steps.release.outputs.release_created }}
@@ -8,13 +8,13 @@ jobs:
8
8
  test:
9
9
  strategy:
10
10
  matrix:
11
- node: [12.x, 14.x, 16.x, 18.x]
12
- os: [ubuntu-latest, macos-latest, windows-latest]
11
+ node: [16.x, 18.x, 20.x, 21.x]
12
+ os: [ubuntu-latest]
13
13
  runs-on: ${{ matrix.os }}
14
14
  steps:
15
15
  - uses: actions/checkout@v2
16
16
  - name: Use Node.js ${{ matrix.node }}
17
- uses: actions/setup-node@v1
17
+ uses: actions/setup-node@v4
18
18
  with:
19
19
  node-version: ${{ matrix.node }}
20
20
  - run: npm install
package/.ncurc.js ADDED
@@ -0,0 +1,9 @@
1
+ module.exports = {
2
+ upgrade: true,
3
+ reject: [
4
+ // 5x is esm only
5
+ 'chai',
6
+ // api changes in newer eslint
7
+ 'grunt-eslint'
8
+ ]
9
+ };
package/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # Changelog
2
2
 
3
+ ## [5.3.5](https://github.com/nodemailer/libmime/compare/v5.3.4...v5.3.5) (2024-04-12)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **deps:** Bumped deps ([0477e98](https://github.com/nodemailer/libmime/commit/0477e98d02d5af84f8be4b8e0856288175e913f9))
9
+
10
+ ## [5.3.4](https://github.com/nodemailer/libmime/compare/v5.3.3...v5.3.4) (2024-02-23)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **deploy:** fixed git repo url ([0f3e5f4](https://github.com/nodemailer/libmime/commit/0f3e5f4b3f5fabe91967cd9842ebe00622181796))
16
+ * **deploy:** fixed git repo url ([4d584ad](https://github.com/nodemailer/libmime/commit/4d584ad7dd51cf0ad60f756a5d7c9470cca30319))
17
+
18
+ ## [5.3.3](https://github.com/nodemailer/libmime/compare/v5.3.2...v5.3.3) (2024-02-23)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * **deploy:** fixed git repo url ([f8f788f](https://github.com/nodemailer/libmime/commit/f8f788fd5d3f1148fb2e880e37c76cec6741a852))
24
+
25
+ ## [5.3.2](https://github.com/nodemailer/libmime/compare/v5.3.1...v5.3.2) (2024-02-23)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **deploy:** fixed git repo url ([2161a43](https://github.com/nodemailer/libmime/commit/2161a43a87083ff99125b5335d3a2e1dee4c5663))
31
+
32
+ ## [5.3.1](https://github.com/nodemailer/libmime/compare/v5.3.0...v5.3.1) (2024-02-23)
33
+
34
+
35
+ ### Bug Fixes
36
+
37
+ * **deploy:** include package-lock.json ([8363bf4](https://github.com/nodemailer/libmime/commit/8363bf42c889e95fccf1c3f017db759434481bc1))
38
+
39
+ ## [5.3.0](https://github.com/nodemailer/libmime/compare/v5.2.1...v5.3.0) (2024-02-23)
40
+
41
+
42
+ ### Features
43
+
44
+ * **deploy:** added autopublish ([3e8109f](https://github.com/nodemailer/libmime/commit/3e8109f19bc7b9fb313467f61177ab08459ecf21))
45
+
3
46
  ## v5.2.1 2023-01-27
4
47
 
5
48
  - Fix base64 encoding for emoji bytes in encoded words
package/lib/charset.js CHANGED
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ const { Buffer } = require('node:buffer');
3
4
  const iconv = require('iconv-lite');
4
5
  const encodingJapanese = require('encoding-japanese');
5
6
  const charsets = require('./charsets');
@@ -0,0 +1,227 @@
1
+ 'use strict';
2
+
3
+ // https://nodejs.org/api/util.html#encodings-supported-by-default-with-full-icu-data
4
+ // NB! iso-8859-16 not supported
5
+ const CHARSETS = [
6
+ '866',
7
+ 'ansi_x3.4-1968',
8
+ 'arabic',
9
+ 'ascii',
10
+ 'asmo-708',
11
+ 'big5',
12
+ 'big5-hkscs',
13
+ 'chinese',
14
+ 'cn-big5',
15
+ 'cp1250',
16
+ 'cp1251',
17
+ 'cp1252',
18
+ 'cp1253',
19
+ 'cp1254',
20
+ 'cp1255',
21
+ 'cp1256',
22
+ 'cp1257',
23
+ 'cp1258',
24
+ 'cp819',
25
+ 'cp866',
26
+ 'csbig5',
27
+ 'cseuckr',
28
+ 'cseucpkdfmtjapanese',
29
+ 'csgb2312',
30
+ 'csibm866',
31
+ 'csiso2022jp',
32
+ 'csiso58gb231280',
33
+ 'csiso88596e',
34
+ 'csiso88596i',
35
+ 'csiso88598e',
36
+ 'csiso88598i',
37
+ 'csisolatin1',
38
+ 'csisolatin2',
39
+ 'csisolatin3',
40
+ 'csisolatin4',
41
+ 'csisolatin5',
42
+ 'csisolatin6',
43
+ 'csisolatin9',
44
+ 'csisolatinarabic',
45
+ 'csisolatincyrillic',
46
+ 'csisolatingreek',
47
+ 'csisolatinhebrew',
48
+ 'cskoi8r',
49
+ 'csksc56011987',
50
+ 'csmacintosh',
51
+ 'csshiftjis',
52
+ 'cyrillic',
53
+ 'dos-874',
54
+ 'ecma-114',
55
+ 'ecma-118',
56
+ 'elot_928',
57
+ 'euc-jp',
58
+ 'euc-kr',
59
+ 'gb18030',
60
+ 'gb2312',
61
+ 'gb_2312',
62
+ 'gb_2312-80',
63
+ 'gbk',
64
+ 'greek',
65
+ 'greek8',
66
+ 'hebrew',
67
+ 'ibm819',
68
+ 'ibm866',
69
+ 'iso-2022-jp',
70
+ 'iso-8859-1',
71
+ 'iso8859-1',
72
+ 'iso88591',
73
+ 'iso_8859-1',
74
+ 'iso_8859-1:1987',
75
+ 'iso-8859-10',
76
+ 'iso8859-10',
77
+ 'iso885910',
78
+ 'iso-8859-11',
79
+ 'iso8859-11',
80
+ 'iso885911',
81
+ 'iso-8859-13',
82
+ 'iso8859-13',
83
+ 'iso885913',
84
+ 'iso-8859-14',
85
+ 'iso8859-14',
86
+ 'iso885914',
87
+ 'iso-8859-15',
88
+ 'iso8859-15',
89
+ 'iso885915',
90
+ 'iso_8859-15',
91
+ 'iso-8859-2',
92
+ 'iso8859-2',
93
+ 'iso88592',
94
+ 'iso_8859-2',
95
+ 'iso_8859-2:1987',
96
+ 'iso-8859-3',
97
+ 'iso8859-3',
98
+ 'iso88593',
99
+ 'iso_8859-3',
100
+ 'iso_8859-3:1988',
101
+ 'iso-8859-4',
102
+ 'iso8859-4',
103
+ 'iso88594',
104
+ 'iso_8859-4',
105
+ 'iso_8859-4:1988',
106
+ 'iso-8859-5',
107
+ 'iso8859-5',
108
+ 'iso88595',
109
+ 'iso_8859-5',
110
+ 'iso_8859-5:1988',
111
+ 'iso-8859-6',
112
+ 'iso8859-6',
113
+ 'iso88596',
114
+ 'iso_8859-6',
115
+ 'iso_8859-6:1987',
116
+ 'iso-8859-6-e',
117
+ 'iso-8859-6-i',
118
+ 'iso-8859-7',
119
+ 'iso8859-7',
120
+ 'iso88597',
121
+ 'iso_8859-7',
122
+ 'iso_8859-7:1987',
123
+ 'iso-8859-8',
124
+ 'iso8859-8',
125
+ 'iso88598',
126
+ 'iso_8859-8',
127
+ 'iso_8859-8:1988',
128
+ 'iso-8859-8-e',
129
+ 'iso-8859-8-i',
130
+ 'iso-8859-9',
131
+ 'iso8859-9',
132
+ 'iso88599',
133
+ 'iso_8859-9',
134
+ 'iso_8859-9:1989',
135
+ 'iso-ir-100',
136
+ 'iso-ir-101',
137
+ 'iso-ir-109',
138
+ 'iso-ir-110',
139
+ 'iso-ir-126',
140
+ 'iso-ir-127',
141
+ 'iso-ir-138',
142
+ 'iso-ir-144',
143
+ 'iso-ir-148',
144
+ 'iso-ir-149',
145
+ 'iso-ir-157',
146
+ 'iso-ir-58',
147
+ 'koi',
148
+ 'koi8',
149
+ 'koi8-r',
150
+ 'koi8_r',
151
+ 'koi8-ru',
152
+ 'koi8-u',
153
+ 'korean',
154
+ 'ksc5601',
155
+ 'ksc_5601',
156
+ 'ks_c_5601-1987',
157
+ 'ks_c_5601-1989',
158
+ 'l1',
159
+ 'l2',
160
+ 'l3',
161
+ 'l4',
162
+ 'l5',
163
+ 'l6',
164
+ 'l9',
165
+ 'latin1',
166
+ 'latin2',
167
+ 'latin3',
168
+ 'latin4',
169
+ 'latin5',
170
+ 'latin6',
171
+ 'logical',
172
+ 'mac',
173
+ 'macintosh',
174
+ 'ms932',
175
+ 'ms_kanji',
176
+ 'shift_jis',
177
+ 'shift-jis',
178
+ 'sjis',
179
+ 'sun_eu_greek',
180
+ 'tis-620',
181
+ 'unicode-1-1-utf-8',
182
+ 'us-ascii',
183
+ 'utf-16',
184
+ 'utf-16be',
185
+ 'utf-16le',
186
+ 'utf-8',
187
+ 'utf8',
188
+ 'visual',
189
+ 'windows-1250',
190
+ 'windows-1251',
191
+ 'windows-1252',
192
+ 'windows-1253',
193
+ 'windows-1254',
194
+ 'windows-1255',
195
+ 'windows-1256',
196
+ 'windows-1257',
197
+ 'windows-1258',
198
+ 'windows-31j',
199
+ 'windows-874',
200
+ 'windows-949',
201
+ 'x-cp1250',
202
+ 'x-cp1251',
203
+ 'x-cp1252',
204
+ 'x-cp1253',
205
+ 'x-cp1254',
206
+ 'x-cp1255',
207
+ 'x-cp1256',
208
+ 'x-cp1257',
209
+ 'x-cp1258',
210
+ 'x-euc-jp',
211
+ 'x-gbk',
212
+ 'x-mac-cyrillic',
213
+ 'x-mac-roman',
214
+ 'x-mac-ukrainian',
215
+ 'x-sjis',
216
+ 'x-x-big5'
217
+ ];
218
+
219
+ const CHARSET_MAP = new Map(CHARSETS.map(charset => [charset.replace(/[-_]+/g, ''), charset]));
220
+
221
+ const getCharsetName = charset => {
222
+ let charsetKey = (charset || '').toString().toLowerCase().trim().replace(/[-_]+/g, '');
223
+
224
+ return CHARSET_MAP.get(charsetKey) || false;
225
+ };
226
+
227
+ module.exports.getCharsetName = getCharsetName;
package/lib/libmime.js CHANGED
@@ -1,6 +1,7 @@
1
1
  /* eslint no-control-regex: 0, no-div-regex: 0, quotes: 0 */
2
2
  'use strict';
3
3
 
4
+ const { Buffer } = require('node:buffer');
4
5
  const libcharset = require('./charset');
5
6
  const libbase64 = require('libbase64');
6
7
  const libqp = require('libqp');
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "libmime",
3
3
  "description": "Encode and decode quoted printable and base64 strings",
4
- "version": "5.2.1",
5
- "main": "lib/libmime",
6
- "homepage": "https://github.com/andris9/libmime",
4
+ "version": "5.3.5",
5
+ "main": "lib/libmime.js",
6
+ "homepage": "https://github.com/nodemailer/libmime",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git://github.com/andris9/libmime.git"
9
+ "url": "git+https://github.com/nodemailer/libmime.git"
10
10
  },
11
11
  "license": "MIT",
12
12
  "keywords": [
@@ -16,22 +16,23 @@
16
16
  ],
17
17
  "author": "Andris Reinman <andris@kreata.ee>",
18
18
  "scripts": {
19
- "test": "grunt"
19
+ "test": "grunt",
20
+ "update": "rm -rf node_modules package-lock.json && ncu -u && npm install"
20
21
  },
21
22
  "dependencies": {
22
- "encoding-japanese": "2.0.0",
23
+ "encoding-japanese": "2.1.0",
23
24
  "iconv-lite": "0.6.3",
24
- "libbase64": "1.2.1",
25
- "libqp": "2.0.1"
25
+ "libbase64": "1.3.0",
26
+ "libqp": "2.1.0"
26
27
  },
27
28
  "devDependencies": {
28
- "chai": "4.3.7",
29
+ "chai": "4.4.1",
29
30
  "eslint-config-nodemailer": "1.2.0",
30
- "eslint-config-prettier": "8.6.0",
31
- "grunt": "1.5.3",
31
+ "eslint-config-prettier": "9.1.0",
32
+ "grunt": "1.6.1",
32
33
  "grunt-cli": "1.4.3",
33
- "grunt-eslint": "24.0.1",
34
+ "grunt-eslint": "24.3.0",
34
35
  "grunt-mocha-test": "0.13.3",
35
- "mocha": "10.2.0"
36
+ "mocha": "10.4.0"
36
37
  }
37
38
  }