Socket
Socket
Sign inDemoInstall

yargs

Package Overview
Dependencies
Maintainers
4
Versions
250
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yargs - npm Package Compare versions

Comparing version 3.18.0 to 3.18.1

5

CHANGELOG.md
## Change Log
### v3.18.1 (2015/08/12 05:53 +00:00)
- [#228](https://github.com/bcoe/yargs/pull/228) notes about embedding yargs in Electron (@etiktin)
- [#223](https://github.com/bcoe/yargs/pull/223) make booleans work in config files (@sgentle)
### v3.18.0 (2015/08/06 20:05 +00:00)

@@ -4,0 +9,0 @@ - [#222](https://github.com/bcoe/yargs/pull/222) updates fr locale (@nexdrew)

2

index.js

@@ -279,2 +279,4 @@ var assert = require('assert')

self.demand(key, demand)
} if ('config' in opt) {
self.config(key)
} if ('default' in opt) {

@@ -281,0 +283,0 @@ self.default(key, opt.default)

@@ -15,3 +15,3 @@ // fancy-pants parsing of argv, originally forked

var error = null
var flags = { arrays: {}, bools: {}, strings: {}, counts: {}, normalize: {}, configs: {} }
var flags = { arrays: {}, bools: {}, strings: {}, counts: {}, normalize: {}, configs: {}, defaulted: {} }

@@ -62,2 +62,3 @@ ;[].concat(opts['array']).filter(Boolean).forEach(function (key) {

setArg(key, !(key in defaults) ? false : defaults[key])
setDefaulted(key)
})

@@ -263,2 +264,4 @@

function setArg (key, val) {
unsetDefaulted(key)
// handle parsing boolean arguments --foo=true --bar false.

@@ -334,3 +337,3 @@ if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) {

// values within the config file.
if (argv[key] === undefined) {
if (argv[key] === undefined || (flags.defaulted[key])) {
delete argv[key]

@@ -422,2 +425,14 @@ setArg(key, config[key])

function setDefaulted (key) {
[].concat(aliases[key] || [], key).forEach(function (k) {
flags.defaulted[k] = true
})
}
function unsetDefaulted (key) {
[].concat(aliases[key] || [], key).forEach(function (k) {
delete flags.defaulted[k]
})
}
// return a default value, given the type of a flag.,

@@ -424,0 +439,0 @@ // e.g., key of type 'string' will default to '', rather than 'true'.

4

package.json
{
"name": "yargs",
"version": "3.18.0",
"version": "3.18.1",
"description": "Light-weight option parsing with an argv hash. No optstrings attached.",

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

"nyc": "^3.1.0",
"standard": "^4.4.0"
"standard": "^5.0.2"
},

@@ -29,0 +29,0 @@ "scripts": {

@@ -389,2 +389,7 @@ yargs

If `yargs` is executed in an environment that embeds node and there's no script name (e.g. [Electron]
(http://electron.atom.io/) or [nw.js](http://nwjs.io/)), it will ignore the first parameter since it
expects it to be the script name. In order to override this behavior, use `.parse(process.argv.slice(1))`
instead of `.argv` and the first parameter won't be ignored.
.array(key)

@@ -391,0 +396,0 @@ ----------

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