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

Narrow the searched element type in setHas and arrayIncludes #41

Merged
merged 2 commits into from
Mar 16, 2022
Merged

Narrow the searched element type in setHas and arrayIncludes #41

merged 2 commits into from
Mar 16, 2022

Conversation

tychenjiajun
Copy link
Contributor

fixes #40

@sindresorhus
Copy link
Owner

Would you be able to include a type test?

@tychenjiajun
Copy link
Contributor Author

Not sure how to write tests for this changes.

@sindresorhus
Copy link
Owner

Can't you assert the array afterwards to see if the type was narrowed?

@tychenjiajun
Copy link
Contributor Author

I'll try

@tychenjiajun
Copy link
Contributor Author

Can't you assert the array afterwards to see if the type was narrowed?

I added expectTypeOf

@sindresorhus sindresorhus changed the title feat: narrow the searched element type in setHas and arrayIncludes Narrow the searched element type in setHas and arrayIncludes Mar 16, 2022
@sindresorhus sindresorhus merged commit 04f2818 into sindresorhus:main Mar 16, 2022
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.

Proposal: better arrayIncludes and setHas
2 participants