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

Invert the type checking logic of the payload in order to determine whether to stringify or not #24

Closed danawoodman closed 2 years ago

danawoodman commented 2 years ago

This change means that isn't a base type of undefined, string, number, array or object will be passed as-is and the { "content-type": "application/json" } header will be omitted.

This means we don't need to do the individual type checking that we had before, which was really fragile and limited.

kwhitley commented 2 years ago

Passes on my end, and less fragility would be great - thanks (yet again) Dana! :)

kwhitley commented 2 years ago

Live in 0.7.3 🥳