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? |
| [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.
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.
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.