MCPcopy
hub / github.com/di-sukharev/opencommit / ReadableStreamFromDefaultReader

Function ReadableStreamFromDefaultReader

out/cli.cjs:13830–13861  ·  view source on GitHub ↗
(reader)

Source from the content-addressed store, hash-verified

13828 return stream4;
13829 }
13830 function ReadableStreamFromDefaultReader(reader) {
13831 let stream4;
13832 const startAlgorithm = noop2;
13833 function pullAlgorithm() {
13834 let readPromise;
13835 try {
13836 readPromise = reader.read();
13837 } catch (e3) {
13838 return promiseRejectedWith(e3);
13839 }
13840 return transformPromiseWith(readPromise, (readResult) => {
13841 if (!typeIsObject(readResult)) {
13842 throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");
13843 }
13844 if (readResult.done) {
13845 ReadableStreamDefaultControllerClose(stream4._readableStreamController);
13846 } else {
13847 const value = readResult.value;
13848 ReadableStreamDefaultControllerEnqueue(stream4._readableStreamController, value);
13849 }
13850 });
13851 }
13852 function cancelAlgorithm(reason) {
13853 try {
13854 return promiseResolvedWith(reader.cancel(reason));
13855 } catch (e3) {
13856 return promiseRejectedWith(e3);
13857 }
13858 }
13859 stream4 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0);
13860 return stream4;
13861 }
13862 function convertUnderlyingDefaultOrByteSource(source, context) {
13863 assertDictionary(source, context);
13864 const original = source;

Callers 1

ReadableStreamFromFunction · 0.85

Calls 1

CreateReadableStreamFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…