-
-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🏷️ ensures that handler return is properly typed
- This change addresses an issue where the return type of handlers was not being correctly enforced by the TypeScript compiler. As far as I could tell, the issue is caused by the `infer` keyword not working with generic types. - Added `TResult` as a type parameter to `MiddlewareHandler` to explicitly specify the handler's return type. - Modified the `middy` function signature to pass `TResult` to `MiddlewareHandler`. - By explicitly specifying `TResult`, we ensure that the compiler can correctly enforce the handler's return type. closes #1228
- Loading branch information
Cesar Canassa
committed
Oct 15, 2024
1 parent
4ad95ba
commit 2e6ccd4
Showing
2 changed files
with
21 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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