source: node_modules/es-toolkit/dist/compat/array/flatMap.js

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

Added visualizations

  • Property mode set to 100644
File size: 501 bytes
Line 
1'use strict';
2
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5const flattenDepth = require('./flattenDepth.js');
6const map = require('./map.js');
7const isNil = require('../../predicate/isNil.js');
8
9function flatMap(collection, iteratee) {
10 if (isNil.isNil(collection)) {
11 return [];
12 }
13 const mapped = isNil.isNil(iteratee) ? map.map(collection) : map.map(collection, iteratee);
14 return flattenDepth.flattenDepth(mapped, 1);
15}
16
17exports.flatMap = flatMap;
Note: See TracBrowser for help on using the repository browser.