kwhitley / itty-fetcher

An even simpler wrapper around native Fetch to strip boilerplate from your fetching code!
MIT License
99 stars 4 forks source link

[#25] Don't stringify the prototype of a payload #26

Closed danawoodman closed 1 year ago

danawoodman commented 1 year ago

Previous code threw because TypedArrays/ArrayBuffers will fail when you attempt to Stringify their prototype, like Uin8Array.

Instead we get the constructor of the prototype and check its name, which is also a bit more elegant and explicity as a bonus.

Closes #25

kwhitley commented 1 year ago

Thanks! Out in v0.7.5 🚀

danawoodman commented 1 year ago

Verified in production, thanks!