UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

32 lines (31 loc) 1.04 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.zipWith = void 0; const unzipWith_1 = __importDefault(require("./unzipWith")); /** * This method is like `zip` except that it accepts `iteratee` to specify * how grouped values should be combined. The iteratee is invoked with the * elements of each group: (...group). * * @since 5.7.0 * @category Array * @param arrays The arrays to process. * @param iteratee The function to combine * grouped values. * @returns Returns the new array of grouped elements. * @see [[unzip]],[[unzipWith]],[[zip]],[[zipObject]],[[zipObjectDeep]],[[zipWith]] * @example * * ```js * zipWith([1, 2], [10, 20], [100, 200], (a, b, c) => a + b + c) * // => [111, 222] * ``` */ function zipWith(arrays, iteratee) { return (0, unzipWith_1.default)(arrays, iteratee); } exports.zipWith = zipWith; exports.default = zipWith;