Skip to content

feat: add an overload function to parse#95

Merged
mcollina merged 2 commits intofastify:masterfrom
timursaurus:dev
Apr 7, 2023
Merged

feat: add an overload function to parse#95
mcollina merged 2 commits intofastify:masterfrom
timursaurus:dev

Conversation

@timursaurus
Copy link
Copy Markdown
Contributor

@timursaurus timursaurus commented Apr 5, 2023

Added an overload function type to parse which provides a better developer experience and makes typescript happy
By adding an overload, we don't have to use @ts-expect-error flag, when only 2 arguments are passed to parse like in this example

Checklist

Signed-off-by: Timur Bolotov <bolotovtmr@gmail.com>
Copy link
Copy Markdown
Member

@Eomm Eomm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind to add a test?

@timursaurus
Copy link
Copy Markdown
Contributor Author

timursaurus commented Apr 6, 2023

Would you mind to add a test?

Sure
I think rewriting some of the test would also be beneficial, as there's no need to pass null to reviver in type tests now

Signed-off-by: Timur Bolotov <bolotovtmr@gmail.com>
Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit 97e3fd1 into fastify:master Apr 7, 2023
@Eomm
Copy link
Copy Markdown
Member

Eomm commented Apr 8, 2023

I can't release it due to permission

@timursaurus timursaurus deleted the dev branch September 29, 2023 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants