Closed
Description
What happened
Until v3, Immutable.is
treated two collections containing equivalent Node Buffers as equal, because Node buffers happen to have an .equals()
method similar to an Immutable collection.
In v4, this is no longer the case.
How to reproduce
Try the following with Immutable v3 and v4:
import { is, Map } from 'immutable'
const a = Map({
'foo.txt': Buffer.from('hello')
})
const b = Map({
'foo.txt': Buffer.from('hello')
})
is(a, b) // true in v3, but false in v4
Summary
This change may be a good thing, as the old behaviour always felt a little magical. And I'm not sure if it was ever officially documented. But @leebyron once told me (in #720) that the old behaviour was desirable, even if accidental. So if this change is intentional, I think it should be flagged up in the release notes as a breaking change.
Metadata
Metadata
Assignees
Labels
No labels