* Recursively flatten `array` up to `depth` times. * * @static * @memberOf _ * @since 4.4.0 * @category Array * @param {Array} array The array to flatten. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened arr
(array, depth)
| 7462 | * // => [1, 2, 3, [4], 5] |
| 7463 | */ |
| 7464 | function flattenDepth(array, depth) { |
| 7465 | var length = array == null ? 0 : array.length; |
| 7466 | if (!length) { |
| 7467 | return []; |
| 7468 | } |
| 7469 | depth = depth === undefined ? 1 : toInteger(depth); |
| 7470 | return baseFlatten(array, depth); |
| 7471 | } |
| 7472 | |
| 7473 | /** |
| 7474 | * The inverse of `_.toPairs`; this method returns an object composed |
nothing calls this directly
no test coverage detected