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

GET params don't convert to property arrays #31

Open danawoodman opened 1 year ago

danawoodman commented 1 year ago
fetcher().get('/foo', { bar: ['a', 'b'] })

Should result in /foo?bar=a&bar=b but instead results in /foo?bar=a,b because the array is just being stringified.

I believe it is because of the line passing the payload as an object to URLSearchParams: https://github.com/kwhitley/itty-fetcher/blob/v0.x/src/itty-fetcher.ts#L75

image