Skip to content

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.

2 participants