Skip to content
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

[typing] Use correct type narrowing construct #16269

Merged
merged 1 commit into from
Dec 8, 2024

Conversation

mjpieters
Copy link
Contributor

@mjpieters mjpieters commented Dec 8, 2024

TypeIs should only be used if the negative result excludes the narrowed type.

Also see #16265 (comment)

Copy link

codspeed-hq bot commented Dec 8, 2024

CodSpeed Performance Report

Merging #16269 will not alter performance

Comparing mjpieters:correct_type_guard (f68949a) with main (24c7f08)

Summary

✅ 3 untouched benchmarks

@mjpieters
Copy link
Contributor Author

Looks like all of the npm infrastructure briefly ate itself and several jobs in the pipeline here failed because of this. I'll have to see if I can't force-push something to trigger re-running.

`TypeIs` should only be used if the negative result excludes the
narrowed type.
Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

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

TIL the difference between TypeIs and TypeGuard! Thanks for the explanation!

@desertaxle desertaxle merged commit cac38a1 into PrefectHQ:main Dec 8, 2024
37 checks passed
@mjpieters mjpieters deleted the correct_type_guard branch December 8, 2024 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants