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

perf(types): use homomorphic mapped type to reduce conditional branches #3440

Conversation

m-shaka
Copy link
Contributor

@m-shaka m-shaka commented Sep 22, 2024

…anches

The author should do the following, if applicable

  • Add tests
  • Run tests
  • bun run format:fix && bun run lint:fix to format the code
  • Add TSDoc/JSDoc to document the code

Reduced conditional branches by using homomorphic mapped type.
The number of type instantiation has dropped a bit and the definition became simpler than before

FYI

Copy link

codecov bot commented Sep 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.77%. Comparing base (66df4e1) to head (57aa0d8).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3440   +/-   ##
=======================================
  Coverage   95.77%   95.77%           
=======================================
  Files         155      155           
  Lines        9310     9310           
  Branches     2759     2773   +14     
=======================================
  Hits         8917     8917           
  Misses        393      393           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@m-shaka m-shaka marked this pull request as ready for review September 22, 2024 11:21
@yusukebe yusukebe changed the title refactor(types): use homomorphic mapped type to reduce conditional br… perl(types): use homomorphic mapped type to reduce conditional branches Sep 23, 2024
Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yusukebe yusukebe changed the title perl(types): use homomorphic mapped type to reduce conditional branches perf(types): use homomorphic mapped type to reduce conditional branches Sep 23, 2024
@yusukebe
Copy link
Member

@m-shaka

Good improvement. Thanks!

@yusukebe yusukebe merged commit e1eb98d into honojs:main Sep 23, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants