MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / parseSseDataText

Function parseSseDataText

test/providers/codex/native_api_server.test.ts:35–49  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

33}
34
35function parseSseDataText(text: string): any[] {
36 const blocks = text.split('\n\n').map((entry) => entry.trim()).filter(Boolean);
37 const parsed: any[] = [];
38 for (const block of blocks) {
39 if (block === 'data: [DONE]') {
40 continue;
41 }
42 const dataLine = block.split('\n').find((line) => line.startsWith('data: '));
43 if (!dataLine) {
44 continue;
45 }
46 parsed.push(JSON.parse(dataLine.slice(6)));
47 }
48 return parsed;
49}
50
51test('CodexNativeApiServer exposes /v1/models with runtime metadata', async () => {
52 const runtime = new CodexNativeRuntime({

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected