UNPKG

luxjs

Version:

Lux JS code style checker

22 lines (20 loc) 545 B
function makeArray () { var iterables = Array.prototype.slice.call(arguments); var result = []; iterables.forEach(function (iterable) { if (iterable === null || iterable === undefined) { // Null or undefined values are ignored return; } else if (Array.isArray(iterable)) { // Array-like objects are pushed into the result iterable.forEach(function (item) { result.push(item); }); } else { // Non-array-like objects are pushed as-is result.push(iterable); } }); return result; } module.exports = makeArray;