MCPcopy Create free account
hub / github.com/ScattrdBlade/bigFileUpload / pull

Function pull

native.ts:33–48  ·  view source on GitHub ↗
(controller)

Source from the content-addressed store, hash-verified

31 let loaded = 0;
32 return new ReadableStream({
33 pull(controller) {
34 while (index < parts.length && offset >= parts[index].length) {
35 index++;
36 offset = 0;
37 }
38 if (index >= parts.length) {
39 controller.close();
40 return;
41 }
42 const part = parts[index];
43 const end = Math.min(offset + UPLOAD_CHUNK_SIZE, part.length);
44 controller.enqueue(part.subarray(offset, end));
45 loaded += end - offset;
46 offset = end;
47 uploadProgress = { loaded, total };
48 }
49 });
50}
51

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected