mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 19:37:49 +00:00
Update builds, vendors, and docs.
Former-commit-id: 67aec5a64de61ac2b8948b31315395a727c10071
This commit is contained in:
2
vendor/underscore/underscore-min.js
vendored
2
vendor/underscore/underscore-min.js
vendored
File diff suppressed because one or more lines are too long
14
vendor/underscore/underscore.js
vendored
14
vendor/underscore/underscore.js
vendored
@@ -506,16 +506,8 @@
|
||||
// `[['a',1],['b',2],['c',3]]` returns the array
|
||||
// [['a','b','c'],[1,2,3]].
|
||||
_.unzip = function(tuples) {
|
||||
var results = [];
|
||||
_.each(tuples, function (tuple, tupleIndex) {
|
||||
_.each(tuple, function (value, itemIndex) {
|
||||
if (results.length <= itemIndex) {
|
||||
results[itemIndex] = [];
|
||||
}
|
||||
results[itemIndex][tupleIndex] = value;
|
||||
});
|
||||
});
|
||||
return results;
|
||||
var maxLen = _.max(_.pluck(tuples, "length"))
|
||||
return _.times(maxLen, _.partial(_.pluck, tuples));
|
||||
};
|
||||
|
||||
// Converts lists into objects. Pass either a single array of `[key, value]`
|
||||
@@ -1043,7 +1035,7 @@
|
||||
|
||||
// Run a function **n** times.
|
||||
_.times = function(n, iterator, context) {
|
||||
var accum = Array(n);
|
||||
var accum = Array(Math.max(0, n));
|
||||
for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i);
|
||||
return accum;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user