mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Make _.merge align with _.assign exit early snippet.
This commit is contained in:
@@ -6760,13 +6760,13 @@
|
||||
* // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot] }
|
||||
*/
|
||||
function merge(object, source, guard) {
|
||||
if (!object) {
|
||||
return object;
|
||||
}
|
||||
var args = arguments,
|
||||
length = args.length,
|
||||
type = typeof guard;
|
||||
|
||||
if (!object || length < 2) {
|
||||
return object;
|
||||
}
|
||||
// enables use as a callback for functions like `_.reduce`
|
||||
if ((type == 'number' || type == 'string') && args[3] && args[3][guard] === source) {
|
||||
length = 2;
|
||||
|
||||
Reference in New Issue
Block a user