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

Add support for WeakMap, WeakSet and Promise #53

Open
fabiospampinato opened this issue Mar 7, 2020 · 4 comments
Open

Add support for WeakMap, WeakSet and Promise #53

fabiospampinato opened this issue Mar 7, 2020 · 4 comments

Comments

@fabiospampinato
Copy link

fabiospampinato commented Mar 7, 2020

As an example the following returns true, instead it should return false:

require ( 'fast-deep-equal/es6' )( new WeakMap (), new WeakMap () )

I think this types of objects should be checked for strict equality.

@fabiospampinato fabiospampinato changed the title Add support for WeakMap and WeakSet Add support for WeakMap, WeakSet and Promise Mar 7, 2020
@illuminist
Copy link

I believe WeakMap and WeakSet don't hold or have an ability to iterate their keys. So they just can't be compared.

Had no idea about Promise equality though.

@fabiospampinato
Copy link
Author

@illuminist they can't be deeply compared like objects, but you can check if they are the same object or not.

@illuminist
Copy link

Oh I see, I misread your explanation. Good day though.

@epoberezkin
Copy link
Owner

@fabiospampinato That is a breaking change, but it makes sense to not just iterate their properties and only compare by reference. PR is welcome.

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

No branches or pull requests

3 participants