* Decodes base64url-encoded content from the Gmail API. * Uses Buffer to correctly handle multi-byte UTF-8 characters.
(data: string)
| 144 | * Uses Buffer to correctly handle multi-byte UTF-8 characters. |
| 145 | */ |
| 146 | function decodeBase64Url(data: string): string { |
| 147 | return Buffer.from(data, 'base64url').toString('utf-8') |
| 148 | } |
| 149 | |
| 150 | /** |
| 151 | * Extracts the plain text body from a Gmail message payload. |