UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

12 lines (7 loc) 295 B
'use strict'; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const flatten = require('./flatten.js'); function flatMap(arr, iteratee, depth = 1) { return flatten.flatten(arr.map((item, index) => iteratee(item, index, arr)), depth); } exports.flatMap = flatMap;