rasper
Advanced tools
Comparing version 0.2.0 to 0.2.1
18
index.js
@@ -22,2 +22,6 @@ module.exports = (args = process.argv.slice(1)) => { | ||
function exist (value) { | ||
return value ? true : false | ||
} | ||
function getValue (value, index, self) { | ||
@@ -35,8 +39,10 @@ const next = self[index + 1] | ||
} | ||
if (hasDash(value) && !hasEgual(value) && hasDash(next)) { | ||
return value + '=' + 'true' | ||
if (hasDash(value) && !hasEgual(value)) { | ||
if (hasDash(next) || !exist(next)) { | ||
return value + '=' + 'true' | ||
} | ||
if (!hasDash(next) && hasEgual(next)) { | ||
return value + '=' + next | ||
} | ||
} | ||
if (hasDash(value) && !hasEgual(value) && !hasDash(next) && hasEgual(next)) { | ||
return value + '=' + next | ||
} | ||
@@ -69,3 +75,3 @@ return value | ||
if (!isNaN(value)) { | ||
return parseInt(value) | ||
return Number(value) | ||
} | ||
@@ -72,0 +78,0 @@ |
{ | ||
"name": "rasper", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Node.js parse argument options make ease.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://cjpatoilo.com/rasper", |
512474
88