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

fix: resolve TS warning after upgrade to "typescript": "5.5.2" #11

Merged

Conversation

SergeyVolynkin
Copy link
Contributor

@SergeyVolynkin SergeyVolynkin commented Jul 21, 2024

CI started to fail after b566b4b was merged recently

This PR fixes the CI

Comment on lines +377 to +378
if (typeof state[j] === 'undefined') throw new Error('state[j] is undefined');
state[j] = state[j]! + item;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Although the TS warning looks very much like a bug in TS ! type assertion is still required even after the explicit typeof state[j] === 'undefined' check

@paulmillr paulmillr merged commit bb3409d into paulmillr:main Jul 21, 2024
2 checks passed
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