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

Function WritableStreamDefaultWriterWrite

out/cli.cjs:12648–12668  ·  view source on GitHub ↗
(writer, chunk)

Source from the content-addressed store, hash-verified

12646 writer._ownerWritableStream = void 0;
12647 }
12648 function WritableStreamDefaultWriterWrite(writer, chunk) {
12649 const stream4 = writer._ownerWritableStream;
12650 const controller = stream4._writableStreamController;
12651 const chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk);
12652 if (stream4 !== writer._ownerWritableStream) {
12653 return promiseRejectedWith(defaultWriterLockException("write to"));
12654 }
12655 const state2 = stream4._state;
12656 if (state2 === "errored") {
12657 return promiseRejectedWith(stream4._storedError);
12658 }
12659 if (WritableStreamCloseQueuedOrInFlight(stream4) || state2 === "closed") {
12660 return promiseRejectedWith(new TypeError("The stream is closing or closed and cannot be written to"));
12661 }
12662 if (state2 === "erroring") {
12663 return promiseRejectedWith(stream4._storedError);
12664 }
12665 const promise = WritableStreamAddWriteRequest(stream4);
12666 WritableStreamDefaultControllerWrite(controller, chunk, chunkSize);
12667 return promise;
12668 }
12669 const closeSentinel = {};
12670 class WritableStreamDefaultController2 {
12671 constructor() {

Callers 2

writeMethod · 0.85
pipeStepFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…