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

First index type T is not required #8

Closed
wants to merge 1 commit into from

Conversation

SerkanSipahi
Copy link

No description provided.

Copy link
Owner

@bcherny bcherny left a comment

Choose a reason for hiding this comment

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

Hey, thank you for the contribution!

Unfortunately, this isn't quite right. If you type ...b as a tuple -- and not as a tuple with at least one element -- TypeScript won't complain when you try and call is with a single argument:

is('x') // Ok, should be an error

By requiring ...b to have a length of >=1, TypeScript makes sure that is is called with at least two arguments.

@bcherny bcherny closed this Jan 2, 2021
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.

None yet

2 participants