Files
eagler-tiers/node_modules/@hapi/hoek/lib/flatten.js
starified 08bf320b57 uploaded
2026-04-21 22:03:19 -04:00

21 lines
349 B
JavaScript

'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;
};