Closed nickydonna closed 5 years ago
Seems like a problem in the addToResult
function in the merge
function: https://github.com/rtfeldman/seamless-immutable/blob/281c344ad4694d4190fbe27d954d5a69887335bf/src/seamless-immutable.js#L405
So if the result from the merger is not truthy it will go to the else and use the value from o
. It should do an explicit check for undefined instead. But I guess a fix for that would require a new major version since it can break stuff.
@crudh Ok, but it seem like a major issue, since anyone using null values can have issues like this and its rather hard to track
@donnanicolas yeah, I agree. PR #248 should fix it.
@crudh Thanks!! will update as soon as the PR is merged!! (I "reviewed" it and it seems great, but I don't know much about the code)
This is fixed now, a release will be done soon.
We have an issue with an special merger. We need to keep the properties even if the source object has that property as
undefined
, so we use a custom merger, with almost all values they work ok, but when the original object has a value ofnull
, the resulting property is set to undefined.Here is the code running on runkit https://runkit.com/donnanicolas/seamless-immutable-null
We don't know why this happens