MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / streamToBuffer

Function streamToBuffer

packages/kaos/test/e2e/process-lifecycle.test.ts:10–16  ·  view source on GitHub ↗
(stream: NodeJS.ReadableStream)

Source from the content-addressed store, hash-verified

8// ── Helper ────────────────────────────────────────────────────────────
9
10async function streamToBuffer(stream: NodeJS.ReadableStream): Promise<Buffer> {
11 const chunks: Buffer[] = [];
12 for await (const chunk of stream) {
13 chunks.push(Buffer.from(chunk as Buffer));
14 }
15 return Buffer.concat(chunks);
16}
17
18// ── Tests ─────────────────────────────────────────────────────────────
19

Callers 1

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected