MCPcopy Index your code
hub / github.com/simstudioai/sim / streamFromChunks

Function streamFromChunks

apps/sim/lib/core/utils/stream-limits.test.ts:19–31  ·  view source on GitHub ↗
(chunks: Uint8Array[])

Source from the content-addressed store, hash-verified

17} from '@/lib/core/utils/stream-limits'
18
19function streamFromChunks(chunks: Uint8Array[]): ReadableStream<Uint8Array> {
20 let index = 0
21 return new ReadableStream({
22 pull(controller) {
23 if (index >= chunks.length) {
24 controller.close()
25 return
26 }
27 controller.enqueue(chunks[index])
28 index += 1
29 },
30 })
31}
32
33function headers(contentLength?: string): Headers {
34 const headers = new Headers()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected