Skip to content

Add OrAll type#1378

Merged
sindresorhus merged 27 commits intosindresorhus:mainfrom
salisbury-espinosa:feat/append-OrMultiple
Mar 18, 2026
Merged

Add OrAll type#1378
sindresorhus merged 27 commits intosindresorhus:mainfrom
salisbury-espinosa:feat/append-OrMultiple

Conversation

@salisbury-espinosa
Copy link
Copy Markdown
Contributor

@salisbury-espinosa salisbury-espinosa commented Mar 14, 2026

Perhaps it would be ideal to create an analogue of AllExtend - AtLeastOneExtend
and then OrMultiple<T> => AtLeastOneExtend<T, true> just like we can do now AndMultiple, for example
AndMultiple<T extends readonly boolean[]> = AllExtend<T, true>;

@salisbury-espinosa salisbury-espinosa changed the title Feat/append OrMultiple Add OrMultiple Mar 14, 2026
@salisbury-espinosa salisbury-espinosa mentioned this pull request Mar 14, 2026
1 task
Copy link
Copy Markdown
Collaborator

@som-sm som-sm left a comment

Choose a reason for hiding this comment

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

Needs more test cases, refer to the test cases for AllExtend.

@som-sm
Copy link
Copy Markdown
Collaborator

som-sm commented Mar 14, 2026

Perhaps it would be ideal to create an analogue of AllExtend

Yeah, I agree. I guess it makes more sense to first expose a SomeExtend type and then use it to build OrMultiple.

@som-sm
Copy link
Copy Markdown
Collaborator

som-sm commented Mar 15, 2026

@salisbury-espinosa SomeExtend type is now available. Please update the PR to use it.

@salisbury-espinosa
Copy link
Copy Markdown
Contributor Author

@salisbury-espinosa SomeExtend type is now available. Please update the PR to use it.

done @som-sm

This comment was marked as resolved.

Copy link
Copy Markdown
Collaborator

@som-sm som-sm left a comment

Choose a reason for hiding this comment

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

PR LGTM. Not too sure about the naming, here are some alternative AI suggestions:

  1. OrAll
  2. OrN

@salisbury-espinosa salisbury-espinosa changed the title Add OrMultiple Add OrAll Mar 17, 2026
@salisbury-espinosa
Copy link
Copy Markdown
Contributor Author

OrMultiple => OrAll ✅ @som-sm

@som-sm som-sm changed the title Add OrAll Add OrAll type Mar 18, 2026
Copy link
Copy Markdown
Collaborator

@som-sm som-sm left a comment

Choose a reason for hiding this comment

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

Also, updated Or to use OrAll (refer 1dc5836). Looks really neat now:

export type Or<A extends boolean, B extends boolean> = OrAll<[A, B]>;

@som-sm som-sm marked this pull request as draft March 18, 2026 07:05
@som-sm som-sm marked this pull request as ready for review March 18, 2026 07:39
@som-sm som-sm requested a review from sindresorhus March 18, 2026 07:40
@som-sm som-sm marked this pull request as draft March 18, 2026 08:27
@som-sm som-sm marked this pull request as ready for review March 18, 2026 09:21
@sindresorhus sindresorhus merged commit 4c42d89 into sindresorhus:main Mar 18, 2026
6 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.

4 participants