diff --git a/lodash.js b/lodash.js index 498ce317a..8dc8eb223 100644 --- a/lodash.js +++ b/lodash.js @@ -6671,9 +6671,9 @@ while (++index < length) { var key = props[index]; if (values) { - result[key] = values[index]; + baseSet(result, key, values[index]); } else if (key) { - result[key[0]] = key[1]; + baseSet(result, key[0], key[1]); } } return result; diff --git a/test/test.js b/test/test.js index f56d9c7c9..ecf040102 100644 --- a/test/test.js +++ b/test/test.js @@ -21236,6 +21236,13 @@ assert.deepEqual(actual, expected); }); + QUnit.test('should support deep paths', function(assert) { + assert.expect(1); + + var actual = _.zipObject(['a.b.c'], [1]); + assert.deepEqual(actual, { 'a': { 'b': { 'c': 1 } } }); + }); + QUnit.test('should support consuming the return value of `_.pairs`', function(assert) { assert.expect(1);