(bytes: Uint8Array)
| 18 | |
| 19 | // Build a ReadableStream<Uint8Array> from a single byte payload. |
| 20 | function streamOf(bytes: Uint8Array): ReadableStream<Uint8Array> { |
| 21 | return new ReadableStream<Uint8Array>({ |
| 22 | start(controller) { |
| 23 | controller.enqueue(bytes); |
| 24 | controller.close(); |
| 25 | }, |
| 26 | }); |
| 27 | } |
| 28 | |
| 29 | function utf8(s: string): Uint8Array { |
| 30 | return new TextEncoder().encode(s); |
no outgoing calls
no test coverage detected