Sha256: e2908d84f6a4cae7ab948a069a5b288ab17308f5a8a9349841cd560bb0cb9dd4

Contents?: true

Size: 455 Bytes

Versions: 14

Compression:

Stored size: 455 Bytes

Contents

/*!
 * arr-flatten <https://github.com/jonschlinkert/arr-flatten>
 *
 * Copyright (c) 2014-2015, Jon Schlinkert.
 * Licensed under the MIT License.
 */

'use strict';

module.exports = function flatten(arr) {
  return flat(arr, []);
};

function flat(arr, res) {
  var len = arr.length;
  var i = -1;

  while (len--) {
    var cur = arr[++i];
    if (Array.isArray(cur)) {
      flat(cur, res);
    } else {
      res.push(cur);
    }
  }
  return res;
}

Version data entries

14 entries across 14 versions & 5 rubygems

Version Path
lanes-0.8.0 node_modules/arr-flatten/index.js
brwy_rails-0.0.6 test/dummy/node_modules/arr-flatten/index.js
brwy_rails-0.0.5 test/dummy/node_modules/arr-flatten/index.js
blackboard-3.1.9 lib/site_template/node_modules/arr-flatten/index.js
brwy_rails-0.0.4 test/dummy/node_modules/arr-flatten/index.js
brwy_rails-0.0.3 test/dummy/node_modules/arr-flatten/index.js
brwy_rails-0.0.2 test/dummy/node_modules/arr-flatten/index.js
brwy_rails-0.0.1 test/dummy/node_modules/arr-flatten/index.js
es6_tilt-0.1.2 test/dummy/app/assets/javascripts/node_modules/arr-flatten/index.js
es6_tilt-0.1.1 test/dummy/app/assets/javascripts/node_modules/arr-flatten/index.js
es6_tilt-0.1.0 test/dummy/app/assets/javascripts/node_modules/arr-flatten/index.js
gulp_assets-1.0.0.pre.5 template/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/node_modules/arr-diff/node_modules/arr-flatten/index.js
gulp_assets-1.0.0.pre.4 template/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/node_modules/arr-diff/node_modules/arr-flatten/index.js
gulp_assets-1.0.0.pre.3 template/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/node_modules/arr-diff/node_modules/arr-flatten/index.js