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

Function nextSyncWithSyncValues

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

Source from the content-addressed store, hash-verified

102 // reasons - avoid await when not needed.
103
104 function nextSyncWithSyncValues() {
105 for (;;) {
106 try {
107 const { value, done } = iterator.next();
108
109 if (done) {
110 readable.push(null);
111 return;
112 }
113
114 if (value &&
115 typeof value.then === 'function') {
116 return changeToAsyncValues(value);
117 }
118
119 if (value === null) {
120 reading = false;
121 throw new ERR_STREAM_NULL_VALUES();
122 }
123
124 if (readable.push(value)) {
125 continue;
126 }
127
128 reading = false;
129 } catch (err) {
130 readable.destroy(err);
131 }
132 break;
133 }
134 }
135
136 async function changeToAsyncValues(value) {
137 isAsyncValues = true;

Callers 1

fromFunction · 0.85

Calls 4

changeToAsyncValuesFunction · 0.85
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…