Skip to content

Fix: Head type with union of empty and non-empty tuple#425

Merged
Beraliv merged 7 commits into
ts-essentials:masterfrom
som-sm:fix/head-type-with-union
Dec 5, 2024
Merged

Fix: Head type with union of empty and non-empty tuple#425
Beraliv merged 7 commits into
ts-essentials:masterfrom
som-sm:fix/head-type-with-union

Conversation

@som-sm

@som-sm som-sm commented Dec 4, 2024

Copy link
Copy Markdown
Contributor

PR Checklist

  • Addresses an existing open issue: related to #000
  • Steps in Contributing were taken

Overview

Head doesn't have any of the issues mentioned in this PR.

However, there's one minor issue, when instantiated with a union of empty and non-empty tuple, it attaches an extraneous | undefined to the result. This PR addresses that issue and improves the test cases for Head.

type Test = Head<[] | [1, 2]>;
//   ^? type Test = 1 | undefined

@som-sm som-sm marked this pull request as ready for review December 5, 2024 15:35
@som-sm

som-sm commented Dec 5, 2024

Copy link
Copy Markdown
Contributor Author

@Beraliv This PR is also ready for review now!

@Beraliv Beraliv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great work! No questions, everything looks clean, I'm going to merge it now

@Beraliv Beraliv merged commit ecb490b into ts-essentials:master Dec 5, 2024
@Beraliv Beraliv added the v10 label Dec 5, 2024
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