MCPcopy Create free account
hub / github.com/cloudflare/computer / streamOf

Function streamOf

packages/computer/src/mounts/index.test.ts:20–27  ·  view source on GitHub ↗
(bytes: Uint8Array)

Source from the content-addressed store, hash-verified

18
19// Build a ReadableStream<Uint8Array> from a single byte payload.
20function streamOf(bytes: Uint8Array): ReadableStream<Uint8Array> {
21 return new ReadableStream<Uint8Array>({
22 start(controller) {
23 controller.enqueue(bytes);
24 controller.close();
25 },
26 });
27}
28
29function utf8(s: string): Uint8Array {
30 return new TextEncoder().encode(s);

Callers 2

materializeFunction · 0.70
index.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected