.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / arr-flatten / index.js
1 /*!
2  * arr-flatten <https://github.com/jonschlinkert/arr-flatten>
3  *
4  * Copyright (c) 2014-2017, Jon Schlinkert.
5  * Released under the MIT License.
6  */
7
8 'use strict';
9
10 module.exports = function (arr) {
11   return flat(arr, []);
12 };
13
14 function flat(arr, res) {
15   var i = 0, cur;
16   var len = arr.length;
17   for (; i < len; i++) {
18     cur = arr[i];
19     Array.isArray(cur) ? flat(cur, res) : res.push(cur);
20   }
21   return res;
22 }