MCPcopy Create free account
hub / github.com/mailvelope/mailvelope / parseAddressLoose

Function parseAddressLoose

src/lib/email.js:45–55  ·  view source on GitHub ↗
(address)

Source from the content-addressed store, hash-verified

43// Never returns null. email is '' for invalid input. Used by callers that need
44// the parsed name even when the address is invalid (e.g. OpenPGP user IDs).
45export function parseAddressLoose(address) {
46 try {
47 const emailAddress = goog.format.EmailAddress.parse(address);
48 return {
49 email: emailAddress.isValid() ? emailAddress.getAddress() : '',
50 name: emailAddress.getName() || ''
51 };
52 } catch {
53 return {email: '', name: ''};
54 }
55}
56
57export function parseAddressList(text) {
58 if (!text) {

Callers 2

email.test.jsFile · 0.90
parseUserIdFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected