Skip to content
Discussion options

You must be logged in to vote

I don't think it's a good idea, and I don't think this is a bug. This feature is working as it's intended to be.

I agree in not calling this a bug, but it's not really a feature either.

There is definitely something missing in the way things are implemented at the moment, and that is distinguishing a missing search param from an invalid one.

At the moment, parsers only have one option: return null when they can't correctly turn a query string value into the underlying JS type. But null is also used to indicate that the query key is missing altogether.

The default value was slapped onto the problem to help with type safety, ie to ensure there never was a nullish (null | undefined) value …

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by franky47
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #405 on November 13, 2024 12:44.