You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

commands

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commands - npm Package Compare versions

Comparing version

to
0.0.4

.idea/.name

33

lib/commands.js

@@ -84,10 +84,10 @@ /**

if(arg[1].substr(0,3) == 'no-') {
options[Commands.toCamelCase(arg[1].substring(3))] = false;
Commands.optionsAppender(options, arg[1].substring(3), false);
}
else {
options[Commands.toCamelCase(arg[1])] = true;
Commands.optionsAppender(options, arg[1], true);
}
}
else {
options[Commands.toCamelCase(option[0])] = option.length > 1 ? option[1] : null;
Commands.optionsAppender(options, option[0], option.length > 1 ? option[1] : null);
}

@@ -122,10 +122,10 @@ }

if(arg[1].substr(0,3) == 'no-') {
options[Commands.toCamelCase(arg[1].substring(3))] = false;
Commands.optionsAppender(options, arg[1].substring(3), false);
}
else {
options[Commands.toCamelCase(arg[1])] = true;
Commands.optionsAppender(options, arg[1], true);
}
}
else if(argv[i].charAt(0) == '-') {
options[Commands.toCamelCase(argv[i].substring(1))] = argv[++i];
Commands.optionsAppender(options, argv[i].substring(1), argv[++i]);
}

@@ -138,2 +138,23 @@ }

/**
* Appends the named key value pair into the options object. When the key already exists, the value is appended
* to the existing value as an array.
*
* @param {Object} options
* @param {String} key
* @param {String} value
*/
Commands.optionsAppender = function(options, key, value) {
var camelCaseKey = Commands.toCamelCase(key);
if(options[camelCaseKey] === undefined) {
options[camelCaseKey] = value;
}
else if(Array.isArray(options[camelCaseKey])) {
options[camelCaseKey].push(value);
}
else {
options[camelCaseKey] = [options[camelCaseKey], value];
}
};
/**
* Creates a new string that has been converted to camel case where any non letter is treated as a word break.

@@ -140,0 +161,0 @@ * @return {String}

2

package.json
{
"name": "commands",
"description": "Command line arguments reader",
"version": "0.0.3",
"version": "0.0.4",
"author": "Steve King <steve@mydev.co>",

@@ -6,0 +6,0 @@ "contributors": [ { "name": "Steve King", "email": "steve@mydev.co" } ],