()
| 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; |
no test coverage detected
searching dependent graphs…