sonnyp / troll

Libraries for GNOME JavaScript (GJS)
ISC License
45 stars 7 forks source link

Add arrayBuffer and gBytes methods to fetch #11

Closed ranfdev closed 2 years ago

ranfdev commented 2 years ago

This PR makes it possible to use fetch to get binary data.

arrayBuffer is a standard method of fetch. gBytes is non standard, but it's needed in the gjs world (calling arrayBuffer and then converting to GBytes would require more copying) .

ranfdev commented 2 years ago

The two methods return nearly the same thing, so I added just one test for both