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

Method close

out/cli.cjs:12173–12184  ·  view source on GitHub ↗

* Closes the stream. The underlying sink will finish processing any previously-written chunks, before invoking its * close behavior. During this time any further attempts to write will fail (without erroring the stream). * * The method returns a promise that will fulfill i

()

Source from the content-addressed store, hash-verified

12171 * a `TypeError` (without attempting to cancel the stream) if the stream is currently locked.
12172 */
12173 close() {
12174 if (!IsWritableStream(this)) {
12175 return promiseRejectedWith(streamBrandCheckException$2("close"));
12176 }
12177 if (IsWritableStreamLocked(this)) {
12178 return promiseRejectedWith(new TypeError("Cannot close a stream that already has a writer"));
12179 }
12180 if (WritableStreamCloseQueuedOrInFlight(this)) {
12181 return promiseRejectedWith(new TypeError("Cannot close an already-closing stream"));
12182 }
12183 return WritableStreamClose(this);
12184 }
12185 /**
12186 * Creates a {@link WritableStreamDefaultWriter | writer} and locks the stream to the new writer. While the stream
12187 * is locked, no other writer can be acquired until this one is released.

Callers

nothing calls this directly

Calls 6

IsWritableStreamFunction · 0.85
promiseRejectedWithFunction · 0.85
IsWritableStreamLockedFunction · 0.85
WritableStreamCloseFunction · 0.85

Tested by

no test coverage detected