Socket
Socket
Sign inDemoInstall

ensure-array

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ensure-array - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

.npmignore

36

ensure-array.js

@@ -1,10 +0,30 @@

'use strict';
(function (root, factory) {
/*global define:true */
module.exports = function array(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
if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like enviroments that support module.exports,
// like Node.
module.exports = factory();
} else if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else {
// Browser globals
root.ensureArray = factory();
}
}(this, function () {
'use strict';
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
}
return Array.prototype.slice.call(arguments); //return array with copy of all arguments
};
return ensureArray;
}));

@@ -5,5 +5,5 @@ {

"description": "Ensure that an object is an array. Moves error checking out of your code.",
"version": "0.0.4",
"repository": { "type": "git", "url": "http://github.com/jeffbski/ensure-array.git" },
"bugs" : { "url": "http://github.com/jeffbski/ensure-array/issues" },
"version": "0.0.5",
"repository": { "type": "git", "url": "http://github.com/jeffbski/ensure-array.git" },
"bugs" : { "url": "http://github.com/jeffbski/ensure-array/issues" },
"main": "ensure-array.js",

@@ -15,8 +15,8 @@ "engines": {

"devDependencies": {
"tap": "~0.1.2",
"tapr": "~0.1.1"
"mocha": "~0.14.1",
"chai": "~0.5.2"
},
"scripts": {
"test" : "node_modules/.bin/tapr ./test"
"test": "./node_modules/mocha/bin/mocha ./test/*.mocha.js"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc