Bump to v3.8.0.

This commit is contained in:
John-David Dalton
2015-12-16 17:50:05 -08:00
parent fec213a98c
commit 26837e7fe2
58 changed files with 531 additions and 385 deletions

View File

@@ -1,8 +1,11 @@
define(['../internal/arrayMap', '../internal/arrayMax', '../internal/baseProperty', '../internal/getLength'], function(arrayMap, arrayMax, baseProperty, getLength) {
define(['../internal/arrayFilter', '../internal/arrayMap', '../internal/baseProperty', '../internal/isArrayLike'], function(arrayFilter, arrayMap, baseProperty, isArrayLike) {
/* Native method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* This method is like `_.zip` except that it accepts an array of grouped
* elements and creates an array regrouping the elements to their pre-`_.zip`
* elements and creates an array regrouping the elements to their pre-zip
* configuration.
*
* @static
@@ -19,10 +22,19 @@ define(['../internal/arrayMap', '../internal/arrayMax', '../internal/basePropert
* // => [['fred', 'barney'], [30, 40], [true, false]]
*/
function unzip(array) {
if (!(array && array.length)) {
return [];
}
var index = -1,
length = (array && array.length && arrayMax(arrayMap(array, getLength))) >>> 0,
result = Array(length);
length = 0;
array = arrayFilter(array, function(group) {
if (isArrayLike(group)) {
length = nativeMax(group.length, length);
return true;
}
});
var result = Array(length);
while (++index < length) {
result[index] = arrayMap(array, baseProperty(index));
}