We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
just-partition
The Typescript type for just-partition does not narrow type correctly when using a type guard
I'm not sure what the best way to report/describe TS issues, so I will use screenshots, I hope that that is okay,
In contrast with how using Array.filter() correctly narrows the type
Array.filter()
The type returned from partition, when using the example type guard, is a tuple of unions of the possible values
partition
[PromiseRejectedResult | PromiseFulfilledResult<boolean>, PromiseRejectedResult | PromiseFulfilledResult<boolean>]
What I would really like/expect is that the types would be correctly inferred, in the same way that Array.filter() does
[ PromiseFulfilledResult<boolean>, PromiseRejectedResult ]
I can work around this by casting the result, but that is not ideal
I have a suggested fix, using a function Type override
I will open a PR,
I just wanted to link the PR to an issue
The text was updated successfully, but these errors were encountered:
Add function override, fixes: angus-c#584
ed6b3c7
- I edited above for (hopefully) more clarity
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
The Typescript type for
just-partition
does not narrow type correctly when using a type guardI'm not sure what the best way to report/describe TS issues, so I will use screenshots,
I hope that that is okay,
In contrast with how using
Array.filter()
correctly narrows the typeThe type returned from
partition
, when using the example type guard, is a tuple of unions of the possible valuesWhat I would really like/expect is that the types would be correctly inferred, in the same way that
Array.filter()
doesI can work around this by casting the result, but that is not ideal
I have a suggested fix, using a function Type override
I will open a PR,
I just wanted to link the PR to an issue
The text was updated successfully, but these errors were encountered: