(chunk, controller)
| 219 | |
| 220 | return new TransformStream({ |
| 221 | transform(chunk, controller) { |
| 222 | // Save a copy of the chunk for caching later |
| 223 | chunks.push(chunk.slice()); |
| 224 | totalSize += chunk.byteLength; |
| 225 | |
| 226 | // Pass the chunk through unchanged to the client |
| 227 | controller.enqueue(chunk); |
| 228 | }, |
| 229 | flush(_controller) { |
| 230 | // This runs when the stream is complete |
| 231 | log?.debug( |
no test coverage detected