source: node_modules/es-toolkit/dist/compat/array/zipWith.mjs@ ba17441

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

Added visualizations

  • Property mode set to 100644
File size: 485 bytes
Line 
1import { unzip } from './unzip.mjs';
2import { isFunction } from '../../predicate/isFunction.mjs';
3
4function zipWith(...combine) {
5 let iteratee = combine.pop();
6 if (!isFunction(iteratee)) {
7 combine.push(iteratee);
8 iteratee = undefined;
9 }
10 if (!combine?.length) {
11 return [];
12 }
13 const result = unzip(combine);
14 if (iteratee == null) {
15 return result;
16 }
17 return result.map(group => iteratee(...group));
18}
19
20export { zipWith };
Note: See TracBrowser for help on using the repository browser.