New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cmdline

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmdline - npm Package Compare versions

Comparing version 1.0.8 to 1.0.9

18

lib/parser.js

@@ -233,2 +233,11 @@ const Class = require('cify').Class;

/**
* 是否包含重复字符
**/
_hasRepeatChar: function (str) {
if (utils.isNull(str)) return false;
var array = str.split('');
return utils.unique(array).length != array.length;
},
/**
* 解析组合短参数

@@ -241,3 +250,7 @@ **/

if (this._options[token]) return; //如果是一个明确存在的 option
var shortOptions = this._trimOptionName(token).split('').map(function (char) {
var trimedName = this._trimOptionName(token);
if (trimedName.length < 2 || this._hasRepeatChar(trimedName)) {
return invalidOptions.push(token);
}
var shortOptions = trimedName.split('').map(function (char) {
return '-' + char;

@@ -249,4 +262,3 @@ });

if (!allExsits) {
invalidOptions.push(token);
return;
return invalidOptions.push(token);
}

@@ -253,0 +265,0 @@ //将分解后的短参插入

6

package.json
{
"name": "cmdline",
"rawName": "cmdline",
"version": "1.0.8",
"version": "1.0.9",
"description": "cmdline is a process.argv parser",

@@ -39,3 +39,3 @@ "main": "./lib/index.js",

"cify": "^1.0.0",
"ntils": "^1.0.1"
"ntils": "^1.0.2"
},

@@ -46,2 +46,2 @@ "devDependencies": {

}
}
}
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