All files flatten.js

100% Statements 7/7
50% Branches 1/2
100% Functions 1/1
100% Lines 7/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22        1x             11x 11x 11x   11x 18x     11x    
/**
 * Export `flatten`
 */
 
module.exports = flatten
 
/**
 * Shallow Flatten
 */
 
function flatten (array) {
  let length = array ? array.length : 0
  let result = []
  let index = -1
 
  while (++index < length) {
    result = result.concat(array[index])
  }
 
  return result
}