MCPcopy
hub / github.com/simstudioai/sim / start

Function start

apps/sim/lib/core/utils/multipart.test.ts:30–39  ·  view source on GitHub ↗
(controller)

Source from the content-addressed store, hash-verified

28function toWebStream(body: Buffer, chunkSize?: number): ReadableStream<Uint8Array> {
29 return new ReadableStream<Uint8Array>({
30 start(controller) {
31 if (chunkSize) {
32 for (let i = 0; i < body.length; i += chunkSize) {
33 controller.enqueue(new Uint8Array(body.subarray(i, i + chunkSize)))
34 }
35 } else {
36 controller.enqueue(new Uint8Array(body))
37 }
38 controller.close()
39 },
40 })
41}
42

Callers

nothing calls this directly

Calls 2

enqueueMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected