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

Function iteratorToStream

out/cli.cjs:77965–77977  ·  view source on GitHub ↗
(iterator2, cancel)

Source from the content-addressed store, hash-verified

77963function makeAsyncIterable2(webStream) {
77964 if (!webStream[Symbol.asyncIterator]) {
77965 webStream[Symbol.asyncIterator] = () => toAsyncIterable(webStream);
77966 }
77967 if (!webStream.values) {
77968 webStream.values = () => toAsyncIterable(webStream);
77969 }
77970}
77971function iteratorToStream(iterator2, cancel) {
77972 return new ReadableStream({
77973 async pull(controller) {
77974 const { value, done } = await iterator2.next();
77975 if (done) {
77976 controller.close();
77977 } else {
77978 controller.enqueue(value);
77979 }
77980 },

Callers 1

createStreamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…