fix: 🐛 typings around server.decorate#4538
Merged
Marsup merged 3 commits intohapijs:masterfrom Mar 5, 2025
Merged
Conversation
- The code currently allows any value to be added as a decorator, but the types do not. This work allows any value to be added to a decorator by updating the types to reflect what the code does - Add relevant tests - Update inline docs - Create and export DecorationValue type - Fixes hapijs#4524
These extra definitions specify how to use value instead of method
Types match the validation a bit more. Type errors with error when attempting to decorate a builtin.
c829767 to
97e8fe0
Compare
Contributor
Author
|
@kanongil @Marsup Need your eyes por favor. I'll fix quickly. @feedmypixel Thanks for the initiation of this PR. I think I've finished it. If you have suggestions, feel free to comment. |
Marsup
approved these changes
Jan 19, 2025
feedmypixel
approved these changes
Jan 25, 2025
Contributor
feedmypixel
left a comment
There was a problem hiding this comment.
LGTM 👍🏻
@damusix thanks so much for picking this up and apologies I didn't get to it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
anywhen decorating a non-methodContinued from #4525