reports/frontend/node_modules/es-toolkit/dist/compat/array/flatMapDeep.mjs
jtricerolph 1c411e402e Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-20 14:37:36 +00:00

19 lines
651 B
JavaScript

import { flatMapDepth } from "./flatMapDepth.mjs";
//#region src/compat/array/flatMapDeep.ts
/**
* Creates a flattened array of values by running each element through iteratee and recursively flattening the mapped results.
*
* @template T, R
* @param collection - The array or object to iterate over.
* @param [iteratee] - The function that produces the new array elements.
* @returns A new array that has been deeply flattened.
*
* @example
* flatMapDeep([1, 2, 3], n => [[n, n]]);
* // => [1, 1, 2, 2, 3, 3]
*/
function flatMapDeep(collection, iteratee) {
return flatMapDepth(collection, iteratee, Infinity);
}
//#endregion
export { flatMapDeep };