Bump to v3.0.0.

This commit is contained in:
John-David Dalton
2015-01-08 00:37:01 -08:00
committed by jdalton
commit 9b7c4d6761
349 changed files with 23184 additions and 0 deletions

36
array/unzip.js Normal file
View File

@@ -0,0 +1,36 @@
define(['../internal/arrayMap', '../internal/arrayMax', '../internal/baseProperty'], function(arrayMap, arrayMax, baseProperty) {
/** Used to the length of n-tuples for `_.unzip`. */
var getLength = baseProperty('length');
/**
* 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`
* configuration.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array of grouped elements to process.
* @returns {Array} Returns the new array of regrouped elements.
* @example
*
* var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
* // => [['fred', 30, true], ['barney', 40, false]]
*
* _.unzip(zipped);
* // => [['fred', 'barney'], [30, 40], [true, false]]
*/
function unzip(array) {
var index = -1,
length = (array && array.length && arrayMax(arrayMap(array, getLength))) >>> 0,
result = Array(length);
while (++index < length) {
result[index] = arrayMap(array, baseProperty(index));
}
return result;
}
return unzip;
});