()
| 105 | |
| 106 | // PipeTo with transforms |
| 107 | async function testPipeToWithTransforms() { |
| 108 | const chunks = []; |
| 109 | const writer = { |
| 110 | write(chunk) { chunks.push(new TextDecoder().decode(chunk)); }, |
| 111 | }; |
| 112 | const upper = (batch) => { |
| 113 | if (batch === null) return null; |
| 114 | return batch.map((c) => { |
| 115 | const out = new Uint8Array(c); |
| 116 | for (let i = 0; i < out.length; i++) |
| 117 | out[i] -= (out[i] >= 97 && out[i] <= 122) * 32; |
| 118 | return out; |
| 119 | }); |
| 120 | }; |
| 121 | await pipeTo(from('hello'), upper, writer); |
| 122 | assert.strictEqual(chunks.join(''), 'HELLO'); |
| 123 | } |
| 124 | |
| 125 | // PipeToSync with transforms |
| 126 | async function testPipeToSyncWithTransforms() { |
no test coverage detected
searching dependent graphs…