Comments (2)
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?
from wretch.
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.
from wretch.
Related Issues (20)
- 2.7.1 is causing a terser issue in my applications HOT 6
- How to add a hook that always runs on success and failure? HOT 2
- [QUESTION] How can I add generic here? HOT 6
- Handling 302 redirects HOT 1
- Retry middleware does not handle other side closing unexpectedly HOT 4
- Retry Middleware HOT 6
- Unable to resolve any addon in Expo React Native project HOT 4
- Generic way to replay requests for all awaited methods HOT 1
- How to send (object manually converted to) FormData instance? HOT 4
- Basic auth middleware/extension HOT 1
- Type issue with `QueryStringAddon` and `resolve` HOT 2
- progress addon not working with Put? HOT 1
- How to extract catcher functions with TypeScript HOT 1
- wretch and nextjs caching HOT 1
- No nice way to handle 202 Accepted HOT 2
- Wretch loses the request body for the PUT, POST, and PATCH methods if it is FormData
- Is it possible to read error.response.body inside of an error? HOT 3
- Not clear how to type a precomposed Wretch object HOT 2
- wretch throws error on redirect response HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wretch.