MCPcopy Create free account
hub / github.com/electric-sql/electric / readBody

Function readBody

packages/agents-runtime/src/create-handler.ts:829–838  ·  view source on GitHub ↗
(req: IncomingMessage)

Source from the content-addressed store, hash-verified

827}
828
829function readBody(req: IncomingMessage): Promise<Uint8Array> {
830 return new Promise((resolve, reject) => {
831 const chunks: Array<Buffer> = []
832 req.on(`data`, (chunk: Buffer | string) => {
833 chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk))
834 })
835 req.on(`end`, () => resolve(Buffer.concat(chunks)))
836 req.on(`error`, reject)
837 })
838}

Callers 1

toFetchRequestFunction · 0.70

Calls 5

resolveFunction · 0.85
concatMethod · 0.80
onMethod · 0.45
pushMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected