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

Method pipeTo

out/cli.cjs:14006–14029  ·  view source on GitHub ↗
(destination, rawOptions = {})

Source from the content-addressed store, hash-verified

14004 return transform.readable;
14005 }
14006 pipeTo(destination, rawOptions = {}) {
14007 if (!IsReadableStream(this)) {
14008 return promiseRejectedWith(streamBrandCheckException$1("pipeTo"));
14009 }
14010 if (destination === void 0) {
14011 return promiseRejectedWith(`Parameter 1 is required in 'pipeTo'.`);
14012 }
14013 if (!IsWritableStream(destination)) {
14014 return promiseRejectedWith(new TypeError(`ReadableStream.prototype.pipeTo's first argument must be a WritableStream`));
14015 }
14016 let options;
14017 try {
14018 options = convertPipeOptions(rawOptions, "Second parameter");
14019 } catch (e3) {
14020 return promiseRejectedWith(e3);
14021 }
14022 if (IsReadableStreamLocked(this)) {
14023 return promiseRejectedWith(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream"));
14024 }
14025 if (IsWritableStreamLocked(destination)) {
14026 return promiseRejectedWith(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream"));
14027 }
14028 return ReadableStreamPipeTo(this, destination, options.preventClose, options.preventAbort, options.preventCancel, options.signal);
14029 }
14030 /**
14031 * Tees this readable stream, returning a two-element array containing the two resulting branches as
14032 * new {@link ReadableStream} instances.

Callers

nothing calls this directly

Calls 8

IsReadableStreamFunction · 0.85
promiseRejectedWithFunction · 0.85
IsWritableStreamFunction · 0.85
convertPipeOptionsFunction · 0.85
IsReadableStreamLockedFunction · 0.85
IsWritableStreamLockedFunction · 0.85
ReadableStreamPipeToFunction · 0.85

Tested by

no test coverage detected