-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[PR] Return union void for some string functions #8474
base: main
Are you sure you want to change the base?
Conversation
For my index test I had to write it as |
@Brianzchen I don't really care about flow anymore these days though, sorry. |
I've removed the index of check to make this PR a bit easier to get in. Flow team has already expressed that is an area of unsoundness that they are prepared to allow for an easier dev experience. @nnmrts I understand, hope things get better and you feel interested again soon 😄 |
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.
Reviewed the last commits but I don't know if this does anything or is even relevant anymore.
I think so, the definition if it hasn't been corrected is in fact wrong. It's documented as
|
Closes #8284
codePointAt
and''[123]
has the potential to returnundefined
. This change will enforce users to put guards around these use cases to provide safer string manipulation.