-
Notifications
You must be signed in to change notification settings - Fork 23
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
Further strict null checks #8371
Conversation
…strictNullChecks-dep-cycle-2
…strictNullChecks-insertPanel
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8371 +/- ##
==========================================
+ Coverage 73.51% 73.53% +0.01%
==========================================
Files 1333 1333
Lines 41231 41245 +14
Branches 7671 7677 +6
==========================================
+ Hits 30313 30328 +15
+ Misses 10918 10917 -1 ☔ View full report in Codecov by Sentry. |
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.
Pulling this out eliminates the cycle but doesn't do much to make the individual files easier to strict null check
return compact( | ||
selected.map((element) => { |
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.
It looks like the logic here was designed to throw the error in the case where a match is not found, rather than return an empty array.
exactMatch.get(0);
-- can be asserted due to length check, or code could change to pull this and return if not null
match.get(0);
-- also has a length check, could also be rewritten to return if not null otherwise throw the error
Point of this comment is that I don't want to close one source of bugs while opening another, we may as well keep the logic as "tight" as possible compared to previous.
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.
I suppose the compact()
call just fixes the type and the logic would remain the same though... 🤔
Oh well, whichever, this works for now I guess, just feels gross to pull in compact()
only to fix the typing for us 🤷♂️
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, couldn't get the typing to work otherwise. Just another annoying limitation with arrays
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.
Couple nit picks, but this looks good otherwise 👍
No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack. Do not edit this comment manually. |
What does this PR do?
Checklist