grammyjs / grammY

The Telegram Bot Framework.
https://grammy.dev
MIT License
2.17k stars 110 forks source link

fix: avoid mapped type during filter query type narrowing #553

Closed KnorpelSenf closed 5 months ago

KnorpelSenf commented 5 months ago

The mapped type AliasProps prevents us from leveraging the improvements in https://github.com/microsoft/TypeScript/pull/57871. Hence, even though https://github.com/microsoft/TypeScript/issues/57863 was fixed as a consequence of #543, we are still seeing problems like #551 appear using typescript@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 with npm install github:grammyjs/grammY#avoid-mapped-type as usual.

Closes #551.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 46.07%. Comparing base (38efc3c) to head (8598b02).

Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

KnorpelSenf commented 5 months ago

@all-contributors add @kolay-v for review

allcontributors[bot] commented 5 months ago

@KnorpelSenf

@kolay-v already contributed before to review

KnorpelSenf commented 5 months ago

Oh

KnorpelSenf commented 5 months ago

Awesome