MCPcopy
hub / github.com/electerm/electerm / parseSseBody

Function parseSseBody

test/unit/mcp-widget.spec.js:65–70  ·  view source on GitHub ↗
(body)

Source from the content-addressed store, hash-verified

63
64// ── SSE helper (mirrors mcp.spec.js) ─────────────────────────────────────────
65function parseSseBody (body) {
66 const dataLine = (typeof body === 'string' ? body : JSON.stringify(body))
67 .split('\n').find(l => l.startsWith('data: '))
68 if (!dataLine) return null
69 return JSON.parse(dataLine.slice(6))
70}
71
72async function mcpPost (port, body, sid) {
73 const headers = {

Callers 1

mcpPostFunction · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected