first commit
This commit is contained in:
8
node_modules/ensure-array/ensure-array.js
generated
vendored
Normal file
8
node_modules/ensure-array/ensure-array.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
module.exports = function ensureArray(a, b, n) {
|
||||
if (arguments.length === 0) return []; // no args, ret []
|
||||
if (arguments.length === 1) { // single argument
|
||||
if (a === undefined || a === null) return []; // undefined or null, ret []
|
||||
if (Array.isArray(a)) return a; // isArray, return it
|
||||
}
|
||||
return Array.prototype.slice.call(arguments); // return array with copy of all arguments
|
||||
}
|
Reference in New Issue
Block a user