MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / SetUpReadableByteStreamControllerFromUnderlyingSource

Function SetUpReadableByteStreamControllerFromUnderlyingSource

out/cli.cjs:11799–11824  ·  view source on GitHub ↗
(stream4, underlyingByteSource, highWaterMark)

Source from the content-addressed store, hash-verified

11797 });
11798 }
11799 function SetUpReadableByteStreamControllerFromUnderlyingSource(stream4, underlyingByteSource, highWaterMark) {
11800 const controller = Object.create(ReadableByteStreamController2.prototype);
11801 let startAlgorithm;
11802 let pullAlgorithm;
11803 let cancelAlgorithm;
11804 if (underlyingByteSource.start !== void 0) {
11805 startAlgorithm = () => underlyingByteSource.start(controller);
11806 } else {
11807 startAlgorithm = () => void 0;
11808 }
11809 if (underlyingByteSource.pull !== void 0) {
11810 pullAlgorithm = () => underlyingByteSource.pull(controller);
11811 } else {
11812 pullAlgorithm = () => promiseResolvedWith(void 0);
11813 }
11814 if (underlyingByteSource.cancel !== void 0) {
11815 cancelAlgorithm = (reason) => underlyingByteSource.cancel(reason);
11816 } else {
11817 cancelAlgorithm = () => promiseResolvedWith(void 0);
11818 }
11819 const autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize;
11820 if (autoAllocateChunkSize === 0) {
11821 throw new TypeError("autoAllocateChunkSize must be greater than 0");
11822 }
11823 SetUpReadableByteStreamController(stream4, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize);
11824 }
11825 function SetUpReadableStreamBYOBRequest(request3, controller, view) {
11826 request3._associatedReadableByteStreamController = controller;
11827 request3._view = view;

Callers 1

constructorMethod · 0.85

Calls 6

promiseResolvedWithFunction · 0.85
createMethod · 0.45
startMethod · 0.45
pullMethod · 0.45
cancelMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…