-
Notifications
You must be signed in to change notification settings - Fork 352
Closed
Labels
Description
What problem are you trying to solve?
Body has an .arrayBuffer()
method, but that's almost never what you actually want, since you can't read out of a buffer directly - you need a view. Uint8Array is the canonical "sequence of byte values" view.
What solutions exist today?
new Uint8Array(await body.arrayBuffer())
How would you solve it?
Add a .bytes()
method which gives a new Uint8Array
.
Anything else?
Some brief discussion here.
PushMessageData and Blob (which live elsewhere) would need this too, since they just copied Body.
(Also, watch out for #1675 while specifying.)