Sha256: 69d5763ad59ce6caba72556398e4468c90de09cfae19b05008804014820819f1

Contents?: true

Size: 418 Bytes

Versions: 50

Compression:

Stored size: 418 Bytes

Contents

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

'use strict';

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

function flat(arr, res) {
  var i = 0, cur;
  var len = arr.length;
  for (; i < len; i++) {
    cur = arr[i];
    Array.isArray(cur) ? flat(cur, res) : res.push(cur);
  }
  return res;
}

Version data entries

50 entries across 49 versions & 18 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/arr-flatten/index.js
disco_app-0.18.0 test/dummy/node_modules/arr-flatten/index.js
disco_app-0.18.2 test/dummy/node_modules/arr-flatten/index.js
disco_app-0.16.1 test/dummy/node_modules/arr-flatten/index.js
disco_app-0.15.2 test/dummy/node_modules/arr-flatten/index.js
disco_app-0.18.4 test/dummy/node_modules/arr-flatten/index.js
disco_app-0.18.1 test/dummy/node_modules/arr-flatten/index.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/arr-flatten/index.js
disco_app-0.14.0 test/dummy/node_modules/arr-flatten/index.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/arr-flatten/index.js
tang-0.2.1 spec/tang_app/node_modules/arr-flatten/index.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/arr-flatten/index.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/arr-flatten/index.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/arr-flatten/index.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/arr-flatten/index.js
tang-0.2.0 spec/tang_app/node_modules/arr-flatten/index.js
tang-0.1.0 spec/tang_app/node_modules/arr-flatten/index.js
tang-0.0.9 spec/tang_app/node_modules/arr-flatten/index.js
enju_library-0.3.8 spec/dummy/node_modules/arr-flatten/index.js
jass-0.9.5 vendor/node_modules/arr-flatten/index.js