]> git.r.bdr.sh - rbdr/dotfiles/blob
c95407d317fd3b8e6e9435ae16cc2ed63b713dfe
[rbdr/dotfiles] /
1 'use strict';
2
3 var isArray = Array.isArray, forEach = Array.prototype.forEach
4 , push = Array.prototype.push;
5
6 module.exports = function flatten() {
7 var r = [];
8 forEach.call(this, function (x) {
9 push.apply(r, isArray(x) ? flatten.call(x) : [x]);
10 });
11 return r;
12 };