-
Notifications
You must be signed in to change notification settings - Fork 22
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
chore: improve readability of query/param/header types #169
Conversation
Helps code readability while keeping the error messages the same.
Follow up to #168 (comment) |
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\``; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
🎉 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 📦🚀 |
🎉 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 📦🚀 |
🎉 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 📦🚀 |
🎉 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 📦🚀 |
Helps code readability while keeping the error messages the same.