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

Unique does not handle non string, number or symbol values correctly #342

Open
jordydhoker opened this issue Aug 30, 2023 · 0 comments · May be fixed by #343
Open

Unique does not handle non string, number or symbol values correctly #342

jordydhoker opened this issue Aug 30, 2023 · 0 comments · May be fixed by #343

Comments

@jordydhoker
Copy link

When calling unique with non string, number or symbol values, it doesn't handle it correctly when not using a toKey function.

This is caused by using an object as the key-value pair for the uniqueness check, as an object can only handle string, number or symbol as keys. Typescript would have caught this issue but it was bypassed using as any.
Using a Map would fix this as it can handle all values as keys.

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 a pull request may close this issue.

1 participant