/usr/lib/nodejs/arr-flatten/index.js is in node-arr-flatten 1.0.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | /*!
* 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;
}
|