Skip to content

Commit

Permalink
Revert "Inline jsmimeparser import"
Browse files Browse the repository at this point in the history
This reverts commit d04ba2d,
following implementation of retention of assets from old app versions.
  • Loading branch information
larabr committed Sep 18, 2024
1 parent 3f12e3f commit a64cd12
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/message/parseMail.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// NB: using `export type` is important to ensure we do not import the library unless parseMail (below) is called
export type { Attachment } from 'jsmimeparser';

/**
* Parse a mail into an object format, splitting, headers, html, text/plain and attachments.
* As jsmime is not a small library, and often unused, we'd nomarlly want to import it dynamically.
* However, due to a web-app deployment issue, we need to inline it for now.
* As jsmime is not a small library, we only want to import it if it's actually used.
*/
export { parseMail } from 'jsmimeparser';
export const parseMail = (mail: string | Uint8Array) => import('jsmimeparser').then(({ parseMail: jsmimeParseEmail }) => jsmimeParseEmail(mail));

// Mapping between mime types to the corresponding extensions.
// This is only used if the parsed attachment does not include a filename.
Expand Down

0 comments on commit a64cd12

Please sign in to comment.