This library helps you to flatten nested arrays into a single level array.
$ npm install flatten-util --save
import flatten from 'flatten-util'
let flattened = flatten([[1,[[2,[[3,4,[5]],6],[7]],8],[9]],[[10,11,[12]],13]])
console.log(flattened) // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
To run the test suite, first install the dependencies, then run npm test
:
$ npm install
$ npm test
[MIT](LICENSE)