Skip to content

chore: improve readability of query/param/header types #169

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

Merged

Conversation

bitgopatmcl
Copy link
Contributor

Helps code readability while keeping the error messages the same.

Helps code readability while keeping the error messages the same.
@bitgopatmcl bitgopatmcl requested a review from a team July 19, 2022 19:46
@bitgopatmcl
Copy link
Contributor Author

Follow up to #168 (comment)

@ericcrosson-bitgo
Copy link
Contributor

How does this change the error message? Got any more of them pics?

@@ -37,21 +37,17 @@ type EmitOutputTypeErrors<
: {
[K in keyof P & string]: P[K] extends t.Type<any, O, any>
? P[K]
: `Codec's output type is not assignable to ${OName}. Try using one like \`NumberFromString\``;
: `Codec's output type is not assignable to \`${OName}\`. Try using one like \`NumberFromString\``;
Copy link
Contributor

Choose a reason for hiding this comment

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

This suggestion seems like a blind guess 😅

I don't suppose there's any way to test these changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah didn't really want to get into some long conditional chain of P[K] extends t.NumberC ? 'NumberFromString' : ... many other codecs

As for testing I briefly thought of that and it's definitely not as easy as a "check that an expression typechecks" test, since we don't want to break compilation.

@ericcrosson-bitgo ericcrosson-bitgo merged commit d3724a4 into BitGo:beta Jul 19, 2022
@github-actions
Copy link

🎉 This PR is included in version 0.2.0-beta.13 🎉

The release is available on npm package (@beta dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 1.0.0-beta.18 🎉

The release is available on npm package (@beta dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 0.2.0-beta.7 🎉

The release is available on npm package (@beta dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Aug 4, 2022

🎉 This PR is included in version 0.2.0-beta.10 🎉

The release is available on npm package (@beta dist-tag)

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants