mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 00:27:50 +00:00
Ensure _.mergeWith overwrites primitives with source object clones. [closes #1880]
This commit is contained in:
10
test/test.js
10
test/test.js
@@ -13528,6 +13528,16 @@
|
||||
|
||||
assert.deepEqual(actual, { 'a': { 'b': [0, 1, 2] } });
|
||||
});
|
||||
|
||||
QUnit.test('should overwrite primitives with source object clones', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var actual = _.mergeWith({ 'a': 0 }, { 'a': { 'b': ['c'] } }, function(a, b) {
|
||||
return lodashStable.isArray(a) ? a.concat(b) : undefined;
|
||||
});
|
||||
|
||||
assert.deepEqual(actual, { 'a': { 'b': ['c'] } });
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user