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

Function encodeSSEEnvelope

apps/sim/lib/copilot/request/session/sse.ts:5–7  ·  view source on GitHub ↗
(envelope: unknown)

Source from the content-addressed store, hash-verified

3const encoder = new TextEncoder()
4
5export function encodeSSEEnvelope(envelope: unknown): Uint8Array {
6 return encoder.encode(`data: ${JSON.stringify(envelope)}\n\n`)
7}
8
9export function encodeSSEComment(comment: string): Uint8Array {
10 return encoder.encode(`: ${comment}\n\n`)

Callers 2

enqueueMethod · 0.90
enqueueEventFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected