MCPcopy Index your code
hub / github.com/nodejs/node / nextSyncWithAsyncValues

Function nextSyncWithAsyncValues

lib/internal/streams/from.js:158–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

156 }
157
158 async function nextSyncWithAsyncValues() {
159 for (;;) {
160 try {
161 const { value, done } = iterator.next();
162
163 if (done) {
164 readable.push(null);
165 return;
166 }
167
168 const res = (value &&
169 typeof value.then === 'function') ?
170 await value :
171 value;
172
173 if (res === null) {
174 reading = false;
175 throw new ERR_STREAM_NULL_VALUES();
176 }
177
178 if (readable.push(res)) {
179 continue;
180 }
181
182 reading = false;
183 } catch (err) {
184 readable.destroy(err);
185 }
186 break;
187 }
188 }
189
190 async function nextAsync() {
191 for (;;) {

Callers 2

fromFunction · 0.85
changeToAsyncValuesFunction · 0.85

Calls 3

nextMethod · 0.65
pushMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…