Comparing version
35
index.js
@@ -11,25 +11,26 @@ const args = [] | ||
let [key, value] = arg.split('=') | ||
const isNumber = !isNaN(value) | ||
const isFloat = value.includes('.') | ||
if (isNumber) { | ||
if (isFloat) { | ||
value = parseFloat(value) | ||
} else { | ||
value = Number(value) | ||
if (value === undefined) { | ||
value = true | ||
} else { | ||
const isNumber = !isNaN(value) | ||
const isFloat = value.includes('.') | ||
if (isNumber) { | ||
if (isFloat) { | ||
value = parseFloat(value) | ||
} else { | ||
value = Number(value) | ||
} | ||
} | ||
} | ||
if (value === 'true') { | ||
value = true | ||
} | ||
if (value === 'true') { | ||
value = true | ||
} | ||
if (value === 'false') { | ||
value = false | ||
if (value === 'false') { | ||
value = false | ||
} | ||
} | ||
if (value === undefined) { | ||
value = true | ||
} | ||
flags[key.slice(2)] = value | ||
@@ -36,0 +37,0 @@ }) |
{ | ||
"name": "args-flags", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"author": "Travis Arnold", | ||
@@ -5,0 +5,0 @@ "description": "A simple command line argument parser.", |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
1593
2.64%32
3.23%1
Infinity%