mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 08:07:50 +00:00
upport deep paths as keys in _.zipObject.
This commit is contained in:
committed by
John-David Dalton
parent
b36e659c56
commit
53702774d0
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user