8000 Handling of null or undefined param in object.merge · Issue #262 · mout/mout · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Handling of null or undefined param in object.merge #262
Open
@andi1984

Description

@andi1984

Due to the while conditional in object.merge, there is a nasty edge-case which is about null or undefined in object.merge:

merge({}, null, {foo: 'bar'}) ==> {}
merge({}, {foo: 'bar'}, null) ==> {foo: 'bar'}

Which is counter-intuitive on how it is on Object.assign:

Object.assign({}, null, {foo: 'bar'}) ==> {foo: 'bar'}
Object.assign({}, {foo: 'bar'}, null) ==> {foo: 'bar'}

The same problems exist for undefined instead of null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0