8000 _.merge passes object instead of array to callback · Issue #231 · lodash/lodash · GitHub
[go: up one dir, main page]

Skip to content
_.merge passes object instead of array to callback #231
Closed
@NickHeiner

Description

@NickHeiner

I've noticed that the callback to _.merge is passed an empty object instead of an array. Consider the following:

_ = require('lodash');

_.merge({
  foo: [1, 2]
}, {
  foo: {
    bar: 'baz'
  }
}, function(origProp, overrideProp) {
  console.log(origProp, overrideProp);
}); 

/**
 * Expected output: [1, 2], 'baz'
 * Actual output: {}, 'baz'
 */  

This seems like counter-intuitive behavior.

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

      0