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

add types #30

Merged
merged 4 commits into from
Apr 6, 2021
Merged

add types #30

merged 4 commits into from
Apr 6, 2021

Conversation

goto-bus-stop
Copy link
Contributor

Adds typescript types for the secure-json-parse functions.

The any return types are not ideal (it could be better to return unknown and force an explicit cast) but this way it's the same as JSON.parse().

Checklist

Copy link
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.

Could you add a test test for the types using tsd?

@goto-bus-stop
Copy link
Contributor Author

yep--turns out i made a mistake in the declarations the first time round! should be accurate now.

@goto-bus-stop
Copy link
Contributor Author

goto-bus-stop commented Apr 2, 2021

looks like tsd doesn't support <10.x (even the versions that claim to support 8.x pull in dependencies that no longer do).
I don't know if there's precedent in the fastify org for this, I could add an npm run test-legacy for that doesn't run tsd so node 6 and 8 can still be tested on CI. does that sound good?

@mcollina
Copy link
Member

mcollina commented Apr 2, 2021

good for me!

Copy link
Member

@L2jLiga L2jLiga left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
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 a828ae6 into fastify:master Apr 6, 2021
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