-
Notifications
You must be signed in to change notification settings - Fork 69
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
Improve types for query #36
Conversation
); | ||
|
||
return returnPromise; | ||
} | ||
|
||
async getVisitorCountByColumn( | ||
async getVisitorCountByColumn<T extends keyof typeof ColumnMappings>( |
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 is the only real change (other than the runtime checks) from the previous PR. Introducing a generic here means that the return type can be inferred based on which column is passed.
@benvinegar I'm still seeing some prettier changes, I suspect it is because our editors are each picking up a different version. I think adding Prettier as a direct dev dependency should ensure all contributors are using the same version. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #36 +/- ##
==========================================
+ Coverage 72.38% 72.75% +0.36%
==========================================
Files 18 18
Lines 1934 1960 +26
Branches 115 115
==========================================
+ Hits 1400 1426 +26
Misses 528 528
Partials 6 6 ☔ View full report in Codecov by Sentry. |
Even without the invariant stuff, this is a great improvement. Thanks! |
Co-authored-by: Cal Irvine <[email protected]> Co-authored-by: Ben Vinegar <[email protected]>
Reimplements the types from #26 with some small improvements, and the runtime checks removed.