Skip to content

Every: Fix behaviour when the target type is never#1163

Merged
sindresorhus merged 2 commits intomainfrom
fix/every-with-never
Jun 4, 2025
Merged

Every: Fix behaviour when the target type is never#1163
sindresorhus merged 2 commits intomainfrom
fix/every-with-never

Conversation

@som-sm
Copy link
Collaborator

@som-sm som-sm commented Jun 3, 2025

Just realised that there's a bug with Every, if the target type is never, it doesn't check if all elements are never—it only checks the first one and returns a result. For example, currently Every<[never, number]> incorrectly returns true.

@som-sm som-sm requested a review from sindresorhus June 3, 2025 14:41
@sindresorhus sindresorhus merged commit a891143 into main Jun 4, 2025
6 checks passed
@sindresorhus sindresorhus deleted the fix/every-with-never branch June 4, 2025 01:01
benzaria pushed a commit to benzaria/type-fest that referenced this pull request Jun 6, 2025
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