-
Notifications
You must be signed in to change notification settings - Fork 110
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
fix: avoid mapped type during filter query type narrowing #553
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #553 +/- ##
==========================================
- Coverage 46.08% 46.07% -0.01%
==========================================
Files 19 19
Lines 6052 6051 -1
Branches 320 318 -2
==========================================
- Hits 2789 2788 -1
Misses 3260 3260
Partials 3 3 ☔ View full report in Codecov by Sentry. |
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.
pq is nice
@all-contributors add @kolay-v for review |
@kolay-v already contributed before to review |
Oh |
Awesome |
if (ctx.callbackQuery) { | ||
const s: string = ctx.update.callback_query.data; | ||
assert(s); | ||
throw "never"; |
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.
Perhaps you could replace this and other instances of it with https://deno.land/std@0.224.0/assert/unreachable.ts.
The mapped type
AliasProps
prevents us from leveraging the improvements in microsoft/TypeScript#57871. Hence, even though microsoft/TypeScript#57863 was fixed as a consequence of #543, we are still seeing problems like #551 appear usingtypescript@next
.This PQ removes the helper type and inlines its functionality into the existing collection of
Shortcuts
. In addition to fixing #551, this removes complexity and improves consistency. However, it reduces code reuse a little bit, which is acceptable.You can only test these changes on Node, since Deno does not ship with
typescript@next
yet, which you need to install. You can try out these changes withnpm install github:grammyjs/grammY#avoid-mapped-type
as usual.Closes #551.