Skip to content
This repository was archived by the owner on Jul 23, 2021. It is now read-only.
This repository was 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

Description

@Methuselah96

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions