(input, shallow, output)
| 422 | |
| 423 | // Internal implementation of a recursive `flatten` function. |
| 424 | var flatten = function(input, shallow, output) { |
| 425 | each(input, function(value) { |
| 426 | if (_.isArray(value)) { |
| 427 | shallow ? push.apply(output, value) : flatten(value, shallow, output); |
| 428 | } else { |
| 429 | output.push(value); |
| 430 | } |
| 431 | }); |
| 432 | return output; |
| 433 | }; |
| 434 | |
| 435 | // Return a completely flattened version of an array. |
| 436 | _.flatten = function(array, shallow) { |
no test coverage detected
searching dependent graphs…