@@ -6,7 +6,6 @@ const encoder = new TextEncoder();
66const decoder = new TextDecoder ( ) ;
77
88// from https://en.wikipedia.org/wiki/MIME#Multipart_messages
9- // eslint-disable-next-line spellcheck/spell-checker
109const example = `MIME-Version: 1.0
1110Subject: =?iso-8859-1?Q?=A1Hola,_se=F1or!?=
1211Content-Type: multipart/mixed; boundary=frontier
@@ -39,7 +38,6 @@ Content-Type: multipart/related;
3938------MultipartBoundary--NYswbLinUCqE8KaJecg8DEV6giqFeyGLtHeT0qLB4h------
4039` ;
4140
42- // eslint-disable-next-line @typescript-eslint/require-await
4341async function * stringToStream (
4442 file : string ,
4543) : AsyncIterableIterator < Uint8Array > {
@@ -62,7 +60,6 @@ describe("parseMhtml()", () => {
6260 const expectedHeaders = [
6361 {
6462 "MIME-Version" : "1.0" ,
65- // eslint-disable-next-line spellcheck/spell-checker
6663 Subject : "¡Hola, señor!" ,
6764 "Content-Type" : "multipart/mixed; boundary=frontier" ,
6865 } ,
@@ -86,7 +83,6 @@ describe("parseMhtml()", () => {
8683 } ) ;
8784
8885 test ( "other headers" , async ( ) => {
89- // eslint-disable-next-line spellcheck/spell-checker
9086 const content = `MIME-Version: 1.0
9187From: this is a wrapped: header
9288 with an extra delimiter in: both sections
@@ -125,15 +121,13 @@ This is a message with multiple parts in MIME format.
125121 const headers = files . map ( ( { headers } ) => Object . fromEntries ( headers ) ) ;
126122 const expectedHeaders = [
127123 {
128- // eslint-disable-next-line spellcheck/spell-checker
129124 "Content-Type" : `multipart/related;type="text/html";boundary="----MultipartBoundary--NYswbLinUCqE8KaJecg8DEV6giqFeyGLtHeT0qLB4h----"` ,
130125 Date : "Sat, 16 Apr 2022 17:48:31 -0000" ,
131126 From : "<Saved by Blink>" ,
132127 "MIME-Version" : "1.0" ,
133128 "Snapshot-Content-Location" :
134129 "https://www.newyorker.com/culture/cultural-comment/what-the-twilight-zone-reveals-about-todays-prestige-tv" ,
135130 Subject :
136- // eslint-disable-next-line spellcheck/spell-checker
137131 "What “The Twilight Zone” Reveals About Today’s Prestige TV | The New Yorker" ,
138132 } ,
139133 ] ;
@@ -144,12 +138,10 @@ This is a message with multiple parts in MIME format.
144138 } ) ;
145139
146140 test ( "fails non-ascii in q-encoding" , async ( ) => {
147- // eslint-disable-next-line spellcheck/spell-checker
148141 const content = `MIME-Version: 1.0
149142Subject: =?iso-8859-1?Q?=A1Hola,\xffse=F1or!?=
150143` ;
151144 const parser = parseMhtml ( stringToStream ( content ) ) ;
152- // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression,@typescript-eslint/await-thenable
153145 await expect ( consume ( parser ) ) . rejects . toThrow (
154146 "got non-ascii character when decoding q-quoted word" ,
155147 ) ;
@@ -237,7 +229,6 @@ This is a message with multiple parts in MIME format.
237229Subject: =?utf-8?Q?a=ZZb?=
238230` ;
239231 const parser = parseMhtml ( stringToStream ( content ) ) ;
240- // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression,@typescript-eslint/await-thenable
241232 await expect ( consume ( parser ) ) . rejects . toThrow (
242233 "got invalid hex escape when decoding q-quoted word" ,
243234 ) ;
@@ -246,7 +237,6 @@ Subject: =?utf-8?Q?a=ZZb?=
246237 test ( "fails without empty header delimiter" , async ( ) => {
247238 const content = `MIME-Version: 1.0` ;
248239 const parser = parseMhtml ( stringToStream ( content ) ) ;
249- // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression,@typescript-eslint/await-thenable
250240 await expect ( consume ( parser ) ) . rejects . toThrow (
251241 "didn't find an empty line to signify the end of header parsing" ,
252242 ) ;
@@ -258,7 +248,6 @@ invalid header
258248
259249` ;
260250 const parser = parseMhtml ( stringToStream ( content ) ) ;
261- // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression,@typescript-eslint/await-thenable
262251 await expect ( consume ( parser ) ) . rejects . toThrow (
263252 "header line didn't have key-value delimiter" ,
264253 ) ;
@@ -269,7 +258,6 @@ invalid header
269258
270259` ;
271260 const parser = parseMhtml ( stringToStream ( content ) ) ;
272- // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression,@typescript-eslint/await-thenable
273261 await expect ( consume ( parser ) ) . rejects . toThrow (
274262 "first headers didn't contain a content type" ,
275263 ) ;
@@ -281,7 +269,6 @@ Content-Type: text/plain; boundary=frontier
281269
282270` ;
283271 const parser = parseMhtml ( stringToStream ( content ) ) ;
284- // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression,@typescript-eslint/await-thenable
285272 await expect ( consume ( parser ) ) . rejects . toThrow (
286273 "first content type header didn't contain" ,
287274 ) ;
@@ -293,7 +280,6 @@ Content-Type: multipart/mixed
293280
294281` ;
295282 const parser = parseMhtml ( stringToStream ( content ) ) ;
296- // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression,@typescript-eslint/await-thenable
297283 await expect ( consume ( parser ) ) . rejects . toThrow (
298284 "first content type header didn't contain" ,
299285 ) ;
@@ -306,7 +292,6 @@ Content-Type: multipart/mixed; boundary=frontier
306292
307293` ;
308294 const parser = parseMhtml ( stringToStream ( content ) ) ;
309- // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression,@typescript-eslint/await-thenable
310295 await expect ( consume ( parser ) ) . rejects . toThrow (
311296 "unhandled encoding type: unknown" ,
312297 ) ;
@@ -319,7 +304,6 @@ Content-Type: multipart/mixed; boundary=frontier
319304This is a message with multiple parts in MIME format.
320305` ;
321306 const parser = parseMhtml ( stringToStream ( content ) ) ;
322- // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression,@typescript-eslint/await-thenable
323307 await expect ( consume ( parser ) ) . rejects . toThrow (
324308 "stream didn't end with the appropriate termination boundary" ,
325309 ) ;
0 commit comments