This repository has been archived on 2026-03-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
StasisWarden-Legacy/node_modules/es-toolkit/dist/array/unzipWith.mjs
T

15 lines
437 B
JavaScript

function unzipWith(target, iteratee) {
const maxLength = Math.max(...target.map(innerArray => innerArray.length));
const result = new Array(maxLength);
for (let i = 0; i < maxLength; i++) {
const group = new Array(target.length);
for (let j = 0; j < target.length; j++) {
group[j] = target[j][i];
}
result[i] = iteratee(...group);
}
return result;
}
export { unzipWith };