source: node_modules/es-toolkit/dist/compat/array/unzip.mjs

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 449 bytes
Line 
1import { unzip as unzip$1 } from '../../array/unzip.mjs';
2import { isArray } from '../predicate/isArray.mjs';
3import { isArrayLikeObject } from '../predicate/isArrayLikeObject.mjs';
4
5function unzip(array) {
6 if (!isArrayLikeObject(array) || !array.length) {
7 return [];
8 }
9 array = isArray(array) ? array : Array.from(array);
10 array = array.filter(item => isArrayLikeObject(item));
11 return unzip$1(array);
12}
13
14export { unzip };
Note: See TracBrowser for help on using the repository browser.