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

transformRequest: improving typing of request.headers #14

Closed danawoodman closed 2 years ago

danawoodman commented 2 years ago

Right now doing request.headers["Authorization"] = "..." shows an invalid type error:

image

I think we need to explicitly define the type as Record<string, string> since we guarantee it is by setting { headers: { "Content-Type": "application/json" } } in the implementation.