source: trip-planner-front/node_modules/lodash/flattenDeep.js@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 577 bytes
Line 
1var baseFlatten = require('./_baseFlatten');
2
3/** Used as references for various `Number` constants. */
4var INFINITY = 1 / 0;
5
6/**
7 * Recursively flattens `array`.
8 *
9 * @static
10 * @memberOf _
11 * @since 3.0.0
12 * @category Array
13 * @param {Array} array The array to flatten.
14 * @returns {Array} Returns the new flattened array.
15 * @example
16 *
17 * _.flattenDeep([1, [2, [3, [4]], 5]]);
18 * // => [1, 2, 3, 4, 5]
19 */
20function flattenDeep(array) {
21 var length = array == null ? 0 : array.length;
22 return length ? baseFlatten(array, INFINITY) : [];
23}
24
25module.exports = flattenDeep;
Note: See TracBrowser for help on using the repository browser.