(fromAddress: string)
| 24 | * Extract the email address from a "Name <email>" formatted string" |
| 25 | */ |
| 26 | export function extractEmailFromAddress(fromAddress: string): string | undefined { |
| 27 | const match = fromAddress.match(/<([^>]+)>/) |
| 28 | if (match) { |
| 29 | return match[1] |
| 30 | } |
| 31 | if (fromAddress.includes('@') && !fromAddress.includes('<')) { |
| 32 | return fromAddress.trim() |
| 33 | } |
| 34 | return undefined |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Get the personal email from address and reply-to |
no outgoing calls
no test coverage detected