* Encode a text body as base64 with RFC 2045 line wrapping (max 76 chars). * Using base64 lets us safely transport arbitrary UTF-8 (emoji, accented * characters, etc.) — `7bit` is only valid for strict 7-bit ASCII.
(content: string)
| 385 | * characters, etc.) — `7bit` is only valid for strict 7-bit ASCII. |
| 386 | */ |
| 387 | function encodeBodyBase64(content: string): string[] { |
| 388 | const base64 = Buffer.from(content, 'utf-8').toString('base64') |
| 389 | return base64.match(/.{1,76}/g) || [''] |
| 390 | } |
| 391 | |
| 392 | /** |
| 393 | * Render the inner part of a `multipart/alternative` section (text/plain |
no test coverage detected