Skip to content

Conversation

@feathecutie
Copy link

This PR adds improved typings to Array.every when using the Boolean constructor, in a way that's very similar to what's already being done for Array.filter.

After extensive testing, these types seem to always behave as expected, narrowing the type of the array or tuple down as much as possible (possibly even to never).

I haven't added this feature to recommended.d.ts because I'd like to have some feedback on this first, but I feel like it would make sense to add it there since this is very much in line with the Array.filter improvements, which are recommended.

@feathecutie

This comment was marked as resolved.

@feathecutie feathecutie marked this pull request as draft December 19, 2023 12:40
@feathecutie
Copy link
Author

This should do it, as far as I can tell there are no further regressions in the codebases I've tested

@feathecutie feathecutie marked this pull request as ready for review December 19, 2023 13:27
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.

1 participant