MCPcopy Create free account
hub / github.com/continuedev/continue / parseSseLine

Function parseSseLine

packages/fetch/src/stream.ts:111–122  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

109}
110
111function parseSseLine(line: string): { done: boolean; data: any } {
112 if (line.startsWith("data:[DONE]") || line.startsWith("data: [DONE]")) {
113 return { done: true, data: undefined };
114 }
115 if (line.startsWith("data:")) {
116 return { done: false, data: parseDataLine(line) };
117 }
118 if (line.startsWith(": ping")) {
119 return { done: true, data: undefined };
120 }
121 return { done: false, data: undefined };
122}
123
124export async function* streamSse(response: Response): AsyncGenerator<any> {
125 let buffer = "";

Callers 1

streamSseFunction · 0.85

Calls 1

parseDataLineFunction · 0.85

Tested by

no test coverage detected