MCPcopy
hub / github.com/mailvelope/mailvelope / parseEmail

Function parseEmail

src/content-scripts/providerSpecific.js:350–359  ·  view source on GitHub ↗

* Extract emails from list of elements * @param {NodeList } elements - A list of HTML elements to iteralte over * @param {Function} extract - extract function * @return {Array} The recipient objects in fhe form { email: 'jon@example.com' }

(elements, extract)

Source from the content-addressed store, hash-verified

348 * @return {Array} The recipient objects in fhe form { email: 'jon@example.com' }
349 */
350function parseEmail(elements, extract) {
351 const emails = [];
352 for (const element of elements) {
353 const parsed = parseAddressSafe(extract(element));
354 if (parsed) {
355 emails.push(parsed.email);
356 }
357 }
358 return toRecipients(emails);
359}
360
361/**
362 * Maps an array of email addresses to an array of recipient objects.

Callers 2

getTextFunction · 0.85
getAttrFunction · 0.85

Calls 3

parseAddressSafeFunction · 0.90
toRecipientsFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected