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

Adds widened has support to ReadonlySet #70

Merged
merged 3 commits into from
Feb 24, 2023
Merged

Adds widened has support to ReadonlySet #70

merged 3 commits into from
Feb 24, 2023

Conversation

Kadrei
Copy link
Contributor

@Kadrei Kadrei commented Feb 24, 2023

Currently only Set has support for the widened has and if someone would use ReadonlySet they would lose this widening.

With this change ReadonlySet now supports the widened has argument.

I added it directly to the set-has rule to be similair to the handling in array-includes

I assume this should apply to WeakSet as well - if wanted I can add it as well.

@mattpocock
Copy link
Owner

Makes sense! WeakSet likely also deserves this treatment. Could you also add a changeset? (with pnpm changeset)

@Kadrei
Copy link
Contributor Author

Kadrei commented Feb 24, 2023

Just looked at WeakSet and as it only stores objects it does not work with the current WidenLiteral so I will keep it out for now and even would question if the lib should support it.

Added the changeset.

@mattpocock mattpocock merged commit 37dc8f0 into mattpocock:main Feb 24, 2023
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