source: node_modules/es-toolkit/dist/array/unzip.js

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

Added visualizations

  • Property mode set to 100644
File size: 551 bytes
Line 
1'use strict';
2
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5function unzip(zipped) {
6 let maxLen = 0;
7 for (let i = 0; i < zipped.length; i++) {
8 if (zipped[i].length > maxLen) {
9 maxLen = zipped[i].length;
10 }
11 }
12 const result = new Array(maxLen);
13 for (let i = 0; i < maxLen; i++) {
14 result[i] = new Array(zipped.length);
15 for (let j = 0; j < zipped.length; j++) {
16 result[i][j] = zipped[j][i];
17 }
18 }
19 return result;
20}
21
22exports.unzip = unzip;
Note: See TracBrowser for help on using the repository browser.