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

Function toAsyncIterable2

out/cli.cjs:78175–78192  ·  view source on GitHub ↗
(stream4)

Source from the content-addressed store, hash-verified

78173function makeAsyncIterable3(webStream) {
78174 if (!webStream[Symbol.asyncIterator]) {
78175 webStream[Symbol.asyncIterator] = () => toAsyncIterable2(webStream);
78176 }
78177 if (!webStream.values) {
78178 webStream.values = () => toAsyncIterable2(webStream);
78179 }
78180}
78181function toAsyncIterable2(stream4) {
78182 return __asyncGenerator(this, arguments, function* toAsyncIterable_1() {
78183 const reader = stream4.getReader();
78184 try {
78185 while (true) {
78186 const { value, done } = yield __await(reader.read());
78187 if (done) {
78188 return yield __await(void 0);
78189 }
78190 yield yield __await(value);
78191 }
78192 } finally {
78193 const cancelPromise = reader.cancel();
78194 reader.releaseLock();
78195 yield __await(cancelPromise);

Callers 1

makeAsyncIterable3Function · 0.85

Calls 6

__asyncGeneratorFunction · 0.85
__awaitFunction · 0.85
getReaderMethod · 0.45
readMethod · 0.45
cancelMethod · 0.45
releaseLockMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…