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

Function ReadableByteStreamControllerClose

out/cli.cjs:11634–11653  ·  view source on GitHub ↗
(controller)

Source from the content-addressed store, hash-verified

11632 controller._cancelAlgorithm = void 0;
11633 }
11634 function ReadableByteStreamControllerClose(controller) {
11635 const stream4 = controller._controlledReadableByteStream;
11636 if (controller._closeRequested || stream4._state !== "readable") {
11637 return;
11638 }
11639 if (controller._queueTotalSize > 0) {
11640 controller._closeRequested = true;
11641 return;
11642 }
11643 if (controller._pendingPullIntos.length > 0) {
11644 const firstPendingPullInto = controller._pendingPullIntos.peek();
11645 if (firstPendingPullInto.bytesFilled % firstPendingPullInto.elementSize !== 0) {
11646 const e3 = new TypeError("Insufficient bytes to fill elements in the given buffer");
11647 ReadableByteStreamControllerError(controller, e3);
11648 throw e3;
11649 }
11650 }
11651 ReadableByteStreamControllerClearAlgorithms(controller);
11652 ReadableStreamClose(stream4);
11653 }
11654 function ReadableByteStreamControllerEnqueue(controller, chunk) {
11655 const stream4 = controller._controlledReadableByteStream;
11656 if (controller._closeRequested || stream4._state !== "readable") {

Callers 3

closeMethod · 0.85
pullWithDefaultReaderFunction · 0.85
pullWithBYOBReaderFunction · 0.85

Calls 4

ReadableStreamCloseFunction · 0.85
peekMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…