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 a tuple decoder (along with tests and docs). #28

Merged
merged 3 commits into from
Oct 29, 2020

Conversation

rhofour
Copy link

@rhofour rhofour commented Oct 28, 2020

This fixed #22

@joanllenas
Copy link
Owner

This looks really good @rhofour, nice job!
I'll review/merge it later today.
Thanks!

@rhofour
Copy link
Author

rhofour commented Oct 28, 2020

I had some time and could use a tuple decoder so I figured this was a good time to learn some of the more advanced bits of TypeScript.

The only thing I wish I could change about it is the eliminate the cast I have to do when returning the value. I believe it's always perfectly type-safe, but I haven't figured out how to get the compiler to see that.

Copy link
Owner

@joanllenas joanllenas left a comment

Choose a reason for hiding this comment

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

Other than that the -0 question, this is good to go.
Great job, and a nice feature to have!

src/json-decoder.ts Outdated Show resolved Hide resolved
@joanllenas joanllenas merged commit 034b26f into joanllenas:master Oct 29, 2020
@joanllenas
Copy link
Owner

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.

Support for tuples.
2 participants