()
| 124 | |
| 125 | // PipeToSync with transforms |
| 126 | async function testPipeToSyncWithTransforms() { |
| 127 | const chunks = []; |
| 128 | const writer = { |
| 129 | writeSync(chunk) { chunks.push(new TextDecoder().decode(chunk)); return true; }, |
| 130 | }; |
| 131 | const upper = (batch) => { |
| 132 | if (batch === null) return null; |
| 133 | return batch.map((c) => { |
| 134 | const out = new Uint8Array(c); |
| 135 | for (let i = 0; i < out.length; i++) |
| 136 | out[i] -= (out[i] >= 97 && out[i] <= 122) * 32; |
| 137 | return out; |
| 138 | }); |
| 139 | }; |
| 140 | pipeToSync(fromSync('hello'), upper, writer); |
| 141 | assert.strictEqual(chunks.join(''), 'HELLO'); |
| 142 | } |
| 143 | |
| 144 | async function testPipeToWriterTransformMethodIgnored() { |
| 145 | const chunks = []; |
no test coverage detected
searching dependent graphs…