MCPcopy Index your code
hub / github.com/simstudioai/sim / encodeBodyBase64

Function encodeBodyBase64

apps/sim/tools/gmail/utils.ts:387–390  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

385 * characters, etc.) — `7bit` is only valid for strict 7-bit ASCII.
386 */
387function 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

Callers 1

renderAlternativePartsFunction · 0.85

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected