MCPcopy
hub / github.com/7836246/cursor2api / writeSSE

Function writeSSE

src/handler.ts:2149–2153  ·  view source on GitHub ↗
(res: Response, event: string, data: unknown)

Source from the content-addressed store, hash-verified

2147// ==================== SSE 工具函数 ====================
2148
2149function writeSSE(res: Response, event: string, data: unknown): void {
2150 res.write(`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`);
2151 // @ts-expect-error flush exists on ServerResponse when compression is used
2152 if (typeof res.flush === 'function') res.flush();
2153}

Callers 5

handleMockIdentityStreamFunction · 0.85
writeAnthropicTextDeltaFunction · 0.85
handleDirectTextStreamFunction · 0.85
handleStreamFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected