(rawValue)
| 223 | } |
| 224 | |
| 225 | function normalizeMailAddress(rawValue) { |
| 226 | if (!rawValue) return ''; |
| 227 | if (typeof rawValue === 'string') { |
| 228 | return rawValue.trim(); |
| 229 | } |
| 230 | if (typeof rawValue === 'object') { |
| 231 | return firstNonEmptyString([ |
| 232 | rawValue.emailAddress?.address, |
| 233 | rawValue.address, |
| 234 | rawValue.email, |
| 235 | rawValue.sender, |
| 236 | rawValue.from, |
| 237 | ]); |
| 238 | } |
| 239 | return ''; |
| 240 | } |
| 241 | |
| 242 | function stripHtmlTags(text) { |
| 243 | return String(text || '').replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim(); |
no test coverage detected