(input, shallow, output)
| 1662 | return _.filter(array, _.identity); |
| 1663 | }; |
| 1664 | var flatten = function(input, shallow, output) { |
| 1665 | if (shallow && _.every(input, _.isArray)) { |
| 1666 | return concat.apply(output, input); |
| 1667 | } |
| 1668 | each(input, function(value) { |
| 1669 | if (_.isArray(value) || _.isArguments(value)) { |
| 1670 | shallow ? push.apply(output, value) : flatten(value, shallow, output); |
| 1671 | } else { |
| 1672 | output.push(value); |
| 1673 | } |
| 1674 | }); |
| 1675 | return output; |
| 1676 | }; |
| 1677 | _.flatten = function(array, shallow) { |
| 1678 | return flatten(array, shallow, []); |
| 1679 | }; |
no test coverage detected