MCPcopy Index your code
hub / github.com/mailvelope/mailvelope / parseMessage

Function parseMessage

src/modules/mime.js:19–27  ·  view source on GitHub ↗
(raw, encoding)

Source from the content-addressed store, hash-verified

17 * @return {Object<message, attachments>} parsed content separated in message and attachments
18 */
19export function parseMessage(raw, encoding) {
20 // ASCII header bytes are identical under the binary-string / Unicode-string interpretations,
21 // so this header-detection regex works directly on the raw binary string.
22 if (/^\s*(MIME-Version|Content-Type|Content-Class|Content-Transfer-Encoding|Content-ID|Content-Description|Content-Disposition|Content-Language|From|Date):/.test(raw)) {
23 return parseMIME(raw, encoding);
24 } else {
25 return parseInline(raw, encoding);
26 }
27}
28
29async function parseMIME(raw, encoding) {
30 let message = '';

Callers 4

mime.test.jsFile · 0.90
pgpModel.test.jsFile · 0.90
decryptArmoredMethod · 0.90
decryptMethod · 0.90

Calls 2

parseMIMEFunction · 0.85
parseInlineFunction · 0.85

Tested by

no test coverage detected