-
Notifications
You must be signed in to change notification settings - Fork 154
chore(parser): return correct type for safeParse in envelopes #3339
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
chore(parser): return correct type for safeParse in envelopes #3339
Conversation
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
Currently, the EventBridgeEnvelope.safeParse method only validates, it does not parse the data provided in the typing system. Small fix utilizing existing typing generics that weren't being assigned.
931ba6f
to
de1c104
Compare
This comment has been minimized.
This comment has been minimized.
Thanks @am29d, appreciate how quickly you set up that issue and responded to this. I'll make those changes and ping you! |
@am29d, I've extended these changes to the envelopes you mentioned, thanks for pointing that out. I did a quick sanity check and couldn't find any other envelopes missing that inferred typing. Hope that's ok but happy to make any other changes you want to see! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR and for addressing the review comments!
|
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |
@aws-powertools/lambda-typescript No related issues found. Please ensure 'pending-release' label is applied before releasing. |
Summary
Provides type inference on successful results of
EventBridgeEnvelope.safeParse
Changes
Currently, the EventBridgeEnvelope.safeParse method only validates, it does not parse the data provided in the typing system.
Small fix utilizes existing typing generics that weren't being assigned previously.
Issue: closes #3340
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.