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

add req.query.has and req.query.get methods #3455

Open
lorypelli opened this issue Sep 26, 2024 · 1 comment
Open

add req.query.has and req.query.get methods #3455

lorypelli opened this issue Sep 26, 2024 · 1 comment
Labels
enhancement New feature or request.

Comments

@lorypelli
Copy link

What is the feature you are proposing?

You now have only req.query, but you would need to check it against undefined to threat it as a boolean, instead making query an object with these two methods and having has that returns a boolean directly would be better

@lorypelli lorypelli added the enhancement New feature or request. label Sep 26, 2024
@lorypelli lorypelli changed the title ad req.query.has and req.query.get methods add req.query.has and req.query.get methods Sep 26, 2024
@lorypelli
Copy link
Author

if you don't pass a value, it would be false because it's an empty string, but true if you check against undefined because it's not undefined, so, having a method that does this for you would be more coerent

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

No branches or pull requests

1 participant