-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Actions: expand isInputError
to accept unknown
#11439
Conversation
🦋 Changeset detectedLatest commit: ddf1bb0 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
lgtm. It can also be nice to still put these in define/it
blocks so you can have multiple tests in the same file. Even though it can feel a little weird given that the code doesn't run, it can be nice for organization
@matthewp Yeah, I wasn't sure if that would be misleading for new contributors given the tests don't run? I agree the comment separation isn't great. I'll try that since it sounds like you'd prefer it |
* feat: allow type `unknown` on `isInputError` * chore: move ErrorInferenceObject to internal utils * chore: changeset * deps: expect-type * feat: first types test * chore: add types test to general test command * refactor: use describe and it for organization
Changes
Expand
isInputError
to acceptunknown
as a type, so it can narrow any error object to anActionInputError
. This is per feedback in the RFC.unknown
ErrorInferenceObject
. The reason for this utility type was unclear originallyTesting
Manually tested that
isInputError
still type narrows and preserves theerror.fields
types