-
Notifications
You must be signed in to change notification settings - Fork 47
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
feat: generic types for getQuery
and parseQuery
#131
Conversation
getQuery
util.getQuery
util
Co-authored-by: pooya parsa <pyapar@gmail.com>
Co-authored-by: pooya parsa <pyapar@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. But I think we need a more restrictive type for the return value of parseQuery
and getQuery
(maybe in a subsequent PR - it's not a result of this one). I don't think we'll ever get number/boolean out from it, for example.
Codecov Report
@@ Coverage Diff @@
## main #131 +/- ##
==========================================
+ Coverage 94.63% 94.69% +0.05%
==========================================
Files 7 7
Lines 802 811 +9
Branches 170 170
==========================================
+ Hits 759 768 +9
Misses 43 43
|
Pushed some changes along those lines - feel free to revert or change if I've misssed anything 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks ❤️
getQuery
utilgetQuery
and parseQuery
I made very simple generic types for getQuery, maybe something different should be done, let me know.
Also fixed
QueryValue
to be compatible withboolean
too, which resolved type errors inquery.test.ts