MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / readJson

Function readJson

tools/model-gateway/server.mjs:726–733  ·  view source on GitHub ↗
(req)

Source from the content-addressed store, hash-verified

724}
725
726async function readJson(req) {
727 const chunks = []
728 for await (const chunk of req) {
729 chunks.push(chunk)
730 }
731 const text = Buffer.concat(chunks).toString('utf8')
732 return text ? JSON.parse(text) : {}
733}
734
735function writeSse(res, event, data) {
736 res.write(`event: ${event}\n`)

Callers 1

startGatewayServerFunction · 0.70

Calls 2

pushMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected