123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import arrayFilter from './_arrayFilter.js';
- import arrayMap from './_arrayMap.js';
- import baseProperty from './_baseProperty.js';
- import baseTimes from './_baseTimes.js';
- import isArrayLikeObject from './isArrayLikeObject.js';
- var nativeMax = Math.max;
- function unzip(array) {
- if (!(array && array.length)) {
- return [];
- }
- var length = 0;
- array = arrayFilter(array, function(group) {
- if (isArrayLikeObject(group)) {
- length = nativeMax(group.length, length);
- return true;
- }
- });
- return baseTimes(length, function(index) {
- return arrayMap(array, baseProperty(index));
- });
- }
- export default unzip;
|