- From: James M Snell <notifications@github.com>
- Date: Tue, 09 Apr 2024 14:56:21 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 9 April 2024 21:56:25 UTC
### What problem are you trying to solve? The `read all bytes` algorithm currently defined in the spec is currently limited to `Uint8Array` values: ![image](https://github.com/whatwg/streams/assets/439929/82af8935-6d46-4ad5-9252-9a60fd4cfb63) It would be helpful if this algorithm allowed for values with `stringifiers` to be used as well. Specifically, if the value has a `stringifier` then the value would be converted to a string then UTF-8 encoded for the purpose of the `read all bytes` algorithm. This would allow, for instance, a stream of strings or various types of objects to be read: ```js const rs = ReadableStream.from(['hello', ' ', {toString() { return 'world'; }}]); const res = new Response(rs); await res.text(); // 'hello world' ``` ### What solutions exist today? _No response_ ### How would you solve it? _No response_ ### Anything else? _No response_ -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/streams/issues/1312 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/streams/issues/1312@github.com>
Received on Tuesday, 9 April 2024 21:56:25 UTC