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

Function streamToString

packages/kaos/test/e2e/exec-edge-cases.test.ts:22–28  ·  view source on GitHub ↗
(stream: NodeJS.ReadableStream)

Source from the content-addressed store, hash-verified

20// ── Helpers ───────────────────────────────────────────────────────────
21
22async function streamToString(stream: NodeJS.ReadableStream): Promise<string> {
23 const chunks: Buffer[] = [];
24 for await (const chunk of stream) {
25 chunks.push(Buffer.from(chunk as Buffer));
26 }
27 return Buffer.concat(chunks).toString('utf-8');
28}
29
30async function streamByteLength(stream: NodeJS.ReadableStream): Promise<number> {
31 let n = 0;

Callers 1

Calls 2

toStringMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected