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

Function parse

src/lib/mail-reader.js:27–36  ·  view source on GitHub ↗
(bodyParts)

Source from the content-addressed store, hash-verified

25
26// parse the body parts and handle the results for the individual mime nodes
27export function parse(bodyParts) {
28 for (const bodyPart of bodyParts) {
29 const node = parseMIME(bodyPart.raw);
30 delete bodyPart.raw; // part has been parsed, we can remove the raw attribute
31 bodyPart.content = []; // holds subparts, e.g. for encrypted and/or signed nodes
32 // traverse through the parsed result
33 walkMimeTree(node, bodyPart);
34 }
35 return bodyParts;
36}
37
38// functions that return true/false if they were able to handle a certain kind of body part
39const mimeTreeMatchers = [matchSubject, matchEncrypted, matchSigned, matchAttachment, matchText, matchHtml];

Callers

nothing calls this directly

Calls 2

parseMIMEFunction · 0.85
walkMimeTreeFunction · 0.85

Tested by

no test coverage detected