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

types: add generics to H3Error data and createError #566

Merged
merged 4 commits into from
Nov 20, 2023

Conversation

DamianGlowala
Copy link
Contributor

@DamianGlowala DamianGlowala commented Nov 2, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR allows for typed data property of the H3Error class with an optional generic param defaulting to any, which in turn can be used to provide typed data property on the err returned by createError function.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

codecov bot commented Nov 2, 2023

Codecov Report

Merging #566 (be20212) into main (b7aca96) will increase coverage by 0.00%.
The diff coverage is 80.00%.

@@           Coverage Diff           @@
##             main     #566   +/-   ##
=======================================
  Coverage   83.83%   83.84%           
=======================================
  Files          31       31           
  Lines        3563     3565    +2     
  Branches      543      540    -3     
=======================================
+ Hits         2987     2989    +2     
  Misses        576      576           
Files Coverage Ξ”
src/error.ts 80.76% <80.00%> (+0.21%) ⬆️

@DamianGlowala DamianGlowala changed the title feat: add optional generic param for H3Error data feat: add generics to H3Error data and createError fn Nov 3, 2023
@DamianGlowala DamianGlowala changed the title feat: add generics to H3Error data and createError fn feat: add generics to H3Error data and createError Nov 3, 2023
@pi0 pi0 requested a review from danielroe November 3, 2023 10:15
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Thanks!

@pi0 pi0 changed the title feat: add generics to H3Error data and createError types: add generics to H3Error data and createError Nov 20, 2023
@pi0 pi0 merged commit 7c48856 into unjs:main Nov 20, 2023
5 of 6 checks passed
@DamianGlowala DamianGlowala deleted the feat/generic-h3error-data branch November 20, 2023 06:01
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.

3 participants