Preview: flatten.js
Size: 349 B
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/@hapi/hoek/lib/flatten.js
'use strict';
const internals = {};
module.exports = internals.flatten = function (array, target) {
const result = target || [];
for (const entry of array) {
if (Array.isArray(entry)) {
internals.flatten(entry, result);
}
else {
result.push(entry);
}
}
return result;
};
Directory Contents
Dirs: 0 × Files: 26