Closed dankochetov closed 5 months ago
I checked the source code and saw the stringify
function implementation that specifically converts undefined
to an empty string, but IMO that's a misleading and dangerous behavior (at least for me, coming from axios, which removes keys with undefined
values from the query string). I think it's a common pattern to pass optional query params to a request like that.
Does it make sense to omit null
and undefined
values from the result? I can make a PR with this change. In fact, I've already done it since it's a one line change, feel free to close it if you disagree that it should work like that.
Hey @dankochetov,
Does it make sense to omit null and undefined values from the result? I can make a PR with this change.
Thanks for the PR! I'm fine with adding this as long as it does not break existing code. Can you add an argument to the addon which would toggle on the new behaviour while preserving the existing as the default?
For a query like this
The produced URL is
https://example.com?bar=qwe&foo=
instead ofhttps://example.com?bar=qwe