summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/flatten.js
blob: c95407d317fd3b8e6e9435ae16cc2ed63b713dfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
'use strict';

var isArray = Array.isArray, forEach = Array.prototype.forEach
  , push = Array.prototype.push;

module.exports = function flatten() {
	var r = [];
	forEach.call(this, function (x) {
		push.apply(r, isArray(x) ? flatten.call(x) : [x]);
	});
	return r;
};