Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can you be explicit about how this handles null and undefined #2

Open
the1mills opened this issue Oct 8, 2015 · 2 comments
Open

can you be explicit about how this handles null and undefined #2

the1mills opened this issue Oct 8, 2015 · 2 comments

Comments

@the1mills
Copy link

GET localhost:3000/api/blah?x=undefined&y=null

can you explicitly describe if this library handles undefined and null as expected??

I assume this
GET localhost:3000/api/blah?x=true&y=false

gets encoded to this

{
x:true
y:false
}

not this

{
x:'true'
y:'false'
}

please be more explicit in the docs thanks because I want to use this

@the1mills
Copy link
Author

ok I looked through your code and it doesn't seem to handle null or undefined. great. otherwise the code looks good.

@wattry
Copy link

wattry commented Jun 13, 2024

Given this hasn't had a reply in almost 9 years and I noticed a similar issue I've created https://github.com/wattry/express-typed-query a 0 dependency alternative that parsed dates too. Regarding undefined, that is a parsing error if something is undefined Node is designed to interpret it as the absence of a value. When using JSON.parse or stringify undefined is completely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants