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

improv(parser): correctly infer helper return type #2946

Merged
merged 3 commits into from
Aug 19, 2024

Conversation

dreamorosi
Copy link
Contributor

@dreamorosi dreamorosi commented Aug 17, 2024

Summary

Changes

Please provide a summary of what's being changed

This PR makes the JSONStringified generic following Zod's best practices so that TypeScript can correctly infer the return type of the pipeline. This way customers can have the correct type of the parsed object according to the schema they used.

Before
image

After
image

The PR also does some light housekeeping and standardises the unit tests for the feature to align them with the rest of the test suite.

Please add the issue number below, if no issue is present the PR might get blocked and not be reviewed

Issue number: closes #2945


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.

@dreamorosi dreamorosi self-assigned this Aug 17, 2024
@dreamorosi dreamorosi requested review from a team as code owners August 17, 2024 12:49
@boring-cyborg boring-cyborg bot added parser This item relates to the Parser Utility tests PRs that add or change tests labels Aug 17, 2024
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Aug 17, 2024
@github-actions github-actions bot added the enhancement PRs that introduce minor changes, usually to existing features label Aug 17, 2024
Copy link

@dreamorosi dreamorosi merged commit 8b0e77f into main Aug 19, 2024
9 checks passed
@dreamorosi dreamorosi deleted the fix/jsonstringified_return_type branch August 19, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement PRs that introduce minor changes, usually to existing features parser This item relates to the Parser Utility size/L PRs between 100-499 LOC tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintenance: JSONStringified helper does not infer return type
2 participants