Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

electron

Package Overview
Dependencies
Maintainers
1
Versions
1347
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

6

History.md
0.3.0 / 2012-10-07
==================
* update comments to reflect multiword params
* add support for multiword argv paramters and tests
0.2.1 / 2012-06-11

@@ -3,0 +9,0 @@ ==================

2

lib/electron.js

@@ -30,3 +30,3 @@ /*!

exports.version = '0.2.0';
exports.version = '0.3.0';

@@ -33,0 +33,0 @@ /*!

@@ -61,2 +61,10 @@ /*!

*
* You can also specify paramters with multiple words by surrounding the
* phrase with double-quotes.
*
* // $ node cli.js --say "hello universe"
* argv.params === {
* say: 'hello universe'
* };
*
* @header Argument Parsing Utility

@@ -148,3 +156,4 @@ */

, parts = args.slice(2)
, input = this;
, input = this
, isStr = false;

@@ -158,2 +167,6 @@ function checkParamKey () {

function appendStr (key, str) {
input.params[key] += ' ' + str;
}
parts.forEach(function (part) {

@@ -189,4 +202,15 @@ if (part.substr(0, 2) === '--') {

if (param_key !== null) {
input.params[param_key] = part;
param_key = null;
if (part[0] === '"') {
isStr = true;
input.params[param_key] = part.substr(1);
} else if (isStr && part[part.length - 1] === '"') {
isStr = false;
appendStr(param_key, part.substr(0, part.length - 1));
param_key = null;
} else if (isStr) {
appendStr(param_key, part);
} else {
input.params[param_key] = part;
param_key = null;
}
} else {

@@ -193,0 +217,0 @@ input.commands.push(part);

@@ -8,3 +8,3 @@ {

"license": "MIT",
"version": "0.2.1",
"version": "0.3.0",
"repository": {

@@ -11,0 +11,0 @@ "type": "git",

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