Skip to content

Commit

Permalink
remove "defaulted"
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Jun 23, 2019
1 parent ac5c794 commit 7a4f9e7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.js
Expand Up @@ -46,7 +46,6 @@ function parse (args, opts) {
counts: {},
normalize: {},
configs: {},
defaulted: {},
nargs: {},
coercions: {},
keys: []
Expand Down Expand Up @@ -550,7 +549,7 @@ function parse (args, opts) {
} else {
// setting arguments via CLI takes precedence over
// values within the config file.
if (!hasKey(argv, fullKey.split('.')) || (flags.defaulted[fullKey]) || (flags.arrays[fullKey] && configuration['combine-arrays'])) {
if (!hasKey(argv, fullKey.split('.')) || (flags.arrays[fullKey] && configuration['combine-arrays'])) {
setArg(fullKey, value)
}
}
Expand Down Expand Up @@ -579,7 +578,7 @@ function parse (args, opts) {
return camelCase(key)
})

if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && (!hasKey(argv, keys) || flags.defaulted[keys.join('.')])) {
if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && !hasKey(argv, keys)) {
setArg(keys.join('.'), process.env[envVar])
}
}
Expand Down

0 comments on commit 7a4f9e7

Please sign in to comment.