The raw address string.
The parsed ParsedAddress. address is always present (possibly empty);
name and domain are present only when the input supplied them.
import { parseEmailAddress } from 'edgeport/util';
parseEmailAddress('Ada Lovelace <ada@example.com>');
// { name: 'Ada Lovelace', address: 'ada@example.com', local: 'ada', domain: 'example.com' }
parseEmailAddress('ops@example.com');
// { address: 'ops@example.com', local: 'ops', domain: 'example.com' }
Parses an email address in either the bare (
local@domain) or display-name (Display Name <local@domain>) form.Whitespace around the whole input, the display name, and the bracketed address is trimmed; a quoted display name (
"Doe, John" <j@x>) is unquoted. When the input has no angle brackets the entire trimmed string is treated as the address. The domain is split on the last@, so it is absent for an address that contains no@at all.