-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Ignore order on unordered Immutable.js structures, fixes #4618 #5501
Ignore order on unordered Immutable.js structures, fixes #4618 #5501
Conversation
.set(1, 'one'), | ||
], | ||
[ | ||
Immutable.Map({1: Immutable.Map({2: {a: 99}})}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to show that deep equality works.
.set(2, 'two'), | ||
], | ||
[ | ||
Immutable.Map({1: Immutable.Map({2: {a: 99}})}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to show that deep equality works.
8e161ac
to
5a0a42c
Compare
5a0a42c
to
bc2ff08
Compare
The CI fails during restoring cache because ‘Permission denied’. Does anybody know why this happens? |
Thanks Robin! This looks good, I merged it but will monitor CI to see if it fails. This sometimes happens when a CI run is interrupted, pretty weird. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Immutable.js structures, that do not maintain order, should be equal regardless of the insertion order. This follows how native
Set
andMap
are compared.As
toEqual
should provide deep equality,Immutable.is
(or.equals
on a structure) cannot be used.Sentinels are used for identifying the structures, as we do in pretty-format.
Fixes #4618 (includes additional info and reasons)
Test plan
Added most used Immutable.js structures to unit tests:
List
,Map
,OrdereMap
,Set
,OrderedSet
.