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

argufy

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

argufy - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

3

.vscode/launch.json

@@ -19,3 +19,4 @@ {

"test/spec",
"-b"
"-b",
"-w"
]

@@ -22,0 +23,0 @@ }

@@ -16,2 +16,3 @@ "use strict";

const value = argv[j];
if (!value) return;

@@ -51,3 +52,3 @@ if (number) {

if (!r) return acc;
if (r === undefined) return acc;
return { ...acc,

@@ -54,0 +55,0 @@ [key]: r

@@ -0,1 +1,7 @@

## 11 June 2018
## 1.0.1
- [fix] return an integer with value of zero as an argument, write tests.
## 7 June 2018

@@ -2,0 +8,0 @@

{
"name": "argufy",
"version": "1.0.0",
"version": "1.0.1",
"description": "Parse command line arguments to Node.js CLI programs.",

@@ -5,0 +5,0 @@ "main": "build",

@@ -9,2 +9,3 @@ const find = (argv, long, short, bool, number) => {

const value = argv[j]
if (!value) return
if (number) {

@@ -34,3 +35,3 @@ return parseInt(value, 10)

}
if (!r) return acc
if (r === undefined) return acc
return { ...acc, [key]: r }

@@ -37,0 +38,0 @@ }, {})

@@ -41,4 +41,20 @@ import { equal, deepEqual } from 'zoroaster/assert'

},
'parses a zero integer'() {
const args = ['.nvm/versions/node/v8.10.0/bin/node', 'script', '--wait', '0']
const res = argufy({
wait: { short: 'w', number: true },
}, args)
deepEqual(res, {
wait: 0,
})
},
'ignores edge case with no argument'() {
const args = ['.nvm/versions/node/v8.10.0/bin/node', 'script', '--wait']
const res = argufy({
wait: { short: 'w', number: true },
}, args)
deepEqual(res, {})
},
}
export default T

Sorry, the diff of this file is not supported yet

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