Allow _.zipObject to accept an array of keys without assuming its an array of key/value pairs. [closes #397]

This commit is contained in:
John-David Dalton
2013-11-15 00:18:29 -08:00
parent 0563af682d
commit 28e2934a89
8 changed files with 20 additions and 3 deletions

View File

@@ -7634,6 +7634,11 @@
deepEqual(actual, object);
});
test('should not assume `keys` is two dimensional if `values` is not provided', 1, function() {
var actual = _.zipObject(['barney', 'fred']);
deepEqual(actual, { 'barney': undefined, 'fred': undefined });
});
test('should accept a falsey `array` argument', 1, function() {
var expected = _.map(falsey, function() { return {}; });