MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / append

Function append

packages/simdeck-test/src/index.ts:832–837  ·  view source on GitHub ↗
(source: string, chunk: Buffer)

Source from the content-addressed store, hash-verified

830function captureChildOutput(child: ChildProcess): () => string {
831 const chunks: string[] = [];
832 const append = (source: string, chunk: Buffer) => {
833 chunks.push(`[${source}] ${chunk.toString("utf8")}`);
834 while (chunks.join("").length > 16_384) {
835 chunks.shift();
836 }
837 };
838 child.stdout?.on("data", (chunk: Buffer) => append("stdout", chunk));
839 child.stderr?.on("data", (chunk: Buffer) => append("stderr", chunk));
840 return () => chunks.join("").trim();

Callers 1

captureChildOutputFunction · 0.85

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected