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

handler return type checking #1228 #1241

Closed
wants to merge 1 commit into from
Closed

Conversation

jerizm
Copy link

@jerizm jerizm commented Sep 18, 2024

I think what was happening was because , TInputHandlerResultProps = TResult was passed it allowed the return type to be inferred or overridden by the handler.

After removing , TInputHandlerResultProps = TResult from the handler the return type will be enforced by what is passed in to Middy<Event, Result...

This does mean, however, you cannot override the handler return type.

@willfarrell
Copy link
Member

Thanks for the PR! However, I have chosen to merge #1244 instead as it's not a breaking change and is passing TS unit tests.

@jerizm
Copy link
Author

jerizm commented Oct 16, 2024

@willfarrell great we're glad it fixes the return type enforcement. #1244, looks like it has the same issue with not being able to override the handler return type either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants