upport deep paths as keys in _.zipObject.

This commit is contained in:
Jason Karns
2015-11-09 10:43:09 -05:00
committed by John-David Dalton
parent b36e659c56
commit 53702774d0
2 changed files with 9 additions and 2 deletions

View File

@@ -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;

View File

@@ -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);