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

Added improved typings for Array.every #179

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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