mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 08:07:50 +00:00
Ensure _.merge works with _.reduce.
Former-commit-id: de53bfd024c7a088c98ee94c95d0c57fb00ed032
This commit is contained in:
@@ -1157,6 +1157,14 @@
|
||||
var expected = { 'a': 4 };
|
||||
deepEqual(_.merge({ 'a': 1 }, { 'a': 2 }, { 'a': 3 }, expected), expected);
|
||||
});
|
||||
|
||||
test('should work with `_.reduce`', function() {
|
||||
var actual = { 'a': 1},
|
||||
array = [{ 'b': 2 }, { 'c': 3 }];
|
||||
|
||||
_.reduce(array, _.merge, actual);
|
||||
deepEqual(actual, { 'a': 1, 'b': 2, 'c': 3});
|
||||
});
|
||||
}(1, 2, 3));
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user