New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fixed] Path.withQuery strips query if query is empty #599
Conversation
so would you never want |
Maybe if I pass Whatsoever, that's a different (and maybe opinionated) question. The current behaviour just isn't consistent:
This fix treats the last remaining parameter similar to all others. Cheers, |
Thanks @mhils ! |
[fixed] Path.withQuery strips query if query is empty
@mhils Your test failed. If you'd like I'd be happy to accept a PR where the test passes. Thanks! |
@mjackson, tests work fine for me. Seems like travis is having an issue? Cheers, |
Ok, looks like there's a bug in the latest version of > merge({a:'b'}, {a:undefined})
{ a: 'b' } |
@mhils Ah, that's the cause. This definitely seems like something that should be changed upstream in |
For the record, the patch here needs to be applied anyway. When I fixed this, qs worked as expected. Now, this first needs to be fixed in qs before it can be fixed in react-router... (In other words; why didn't you merge it right away when qs was still working? :D) |
@nlf indicated in ljharb/qs#67 that this is not intended usage at all for the merge function. What's your take on this? I can adjust this patch to use object-assign (or something similar) if that would fit for you. |
Hi there,
Path.withQuery
did not strip off the query once it became empty. Here's a fix + test. 馃槂Cheers,
Max