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