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

Deep Merge with same key of different value type (Map vs List) does not merge as expected #1719

Closed
trevorlitsey opened this issue Jun 17, 2019 · 1 comment · Fixed by #1840
Milestone

Comments

@trevorlitsey
Copy link

What happened

When deep merging two Maps with the same key name but different value types, no merge is done and the key's value remains unchanged. I would expect the value to be overwritten.

How to reproduce

var objWithObj = Immutable.fromJS({ 
  items: { 
    '1': { 
      id: '1'
    } 
  } 
})
var objWithArray = Immutable.fromJS({ 
  items: [{
    id: '1'
  }] 
})
var mergedObj = ObjWithObj.mergeDeep(objWithArray)
@trevorlitsey trevorlitsey changed the title Deep Merge with same key of different type (Map vs List) does not merge as expected Deep Merge with same key of different value type (Map vs List) does not merge as expected Jun 17, 2019
@jay-deshmukh
Copy link

Facing the same issue. @trevorlitsey how did you manage to solve this ?

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.

3 participants