Socket
Socket
Sign inDemoInstall

args-flags

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

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.",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc