Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.

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

Open
Methuselah96 opened this issue Oct 17, 2020 · 0 comments

Comments

@Methuselah96
Copy link

From @trevorlitsey on Mon, 17 Jun 2019 19:42:35 GMT

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)

Copied from original issue: immutable-js#1719

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant