1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-03 12:50:04 +02:00

update dependencies

This commit is contained in:
s2
2018-10-09 09:51:34 +02:00
parent 4fcc873901
commit da4083f574
1112 changed files with 23205 additions and 21697 deletions

View File

@@ -2,6 +2,16 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
<a name="10.1.0"></a>
# [10.1.0](https://github.com/yargs/yargs-parser/compare/v10.0.0...v10.1.0) (2018-06-29)
### Features
* add `set-placeholder-key` configuration ([#123](https://github.com/yargs/yargs-parser/issues/123)) ([19386ee](https://github.com/yargs/yargs-parser/commit/19386ee))
<a name="10.0.0"></a>
# [10.0.0](https://github.com/yargs/yargs-parser/compare/v9.0.2...v10.0.0) (2018-04-04)

View File

@@ -298,6 +298,27 @@ node example.js a -b -- x y
{ _: [ 'a' ], '--': [ 'x', 'y' ], b: true }
```
### set placeholder key
* default: `false`.
* key: `set-placeholder-key`.
Should a placeholder be added for keys not set via the corresponding CLI argument?
_If disabled:_
```sh
node example.js -a 1 -c 2
{ _: [], a: 1, c: 2 }
```
_If enabled:_
```sh
node example.js -a 1 -c 2
{ _: [], a: 1, b: undefined, c: 2 }
```
## Special Thanks
The yargs project evolves from optimist and minimist. It owes its

View File

@@ -20,7 +20,8 @@ function parse (args, opts) {
'duplicate-arguments-array': true,
'flatten-duplicate-arrays': true,
'populate--': false,
'combine-arrays': false
'combine-arrays': false,
'set-placeholder-key': false
}, opts.configuration)
var defaults = opts.default || {}
var configObjects = opts.configObjects || []
@@ -44,41 +45,50 @@ function parse (args, opts) {
configs: {},
defaulted: {},
nargs: {},
coercions: {}
coercions: {},
keys: []
}
var negative = /^-[0-9]+(\.[0-9]+)?/
var negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)')
;[].concat(opts.array).filter(Boolean).forEach(function (key) {
flags.arrays[key] = true
flags.keys.push(key)
})
;[].concat(opts.boolean).filter(Boolean).forEach(function (key) {
flags.bools[key] = true
flags.keys.push(key)
})
;[].concat(opts.string).filter(Boolean).forEach(function (key) {
flags.strings[key] = true
flags.keys.push(key)
})
;[].concat(opts.number).filter(Boolean).forEach(function (key) {
flags.numbers[key] = true
flags.keys.push(key)
})
;[].concat(opts.count).filter(Boolean).forEach(function (key) {
flags.counts[key] = true
flags.keys.push(key)
})
;[].concat(opts.normalize).filter(Boolean).forEach(function (key) {
flags.normalize[key] = true
flags.keys.push(key)
})
Object.keys(opts.narg || {}).forEach(function (k) {
flags.nargs[k] = opts.narg[k]
flags.keys.push(k)
})
Object.keys(opts.coerce || {}).forEach(function (k) {
flags.coercions[k] = opts.coerce[k]
flags.keys.push(k)
})
if (Array.isArray(opts.config) || typeof opts.config === 'string') {
@@ -289,6 +299,7 @@ function parse (args, opts) {
setConfigObjects()
applyDefaultsAndAliases(argv, flags.aliases, defaults)
applyCoercions(argv)
if (configuration['set-placeholder-key']) setPlaceholderKeys(argv)
// for any counts either not in args or without an explicit default, set to 0
Object.keys(flags.counts).forEach(function (key) {
@@ -556,6 +567,15 @@ function parse (args, opts) {
})
}
function setPlaceholderKeys (argv) {
flags.keys.forEach((key) => {
// don't set placeholder keys for dot notation options 'foo.bar'.
if (~key.indexOf('.')) return
if (typeof argv[key] === 'undefined') argv[key] = undefined
})
return argv
}
function applyDefaultsAndAliases (obj, aliases, defaults) {
Object.keys(defaults).forEach(function (key) {
if (!hasKey(obj, key.split('.'))) {

View File

@@ -2,7 +2,7 @@
"_args": [
[
"camelcase@4.1.0",
"/home/s2/Documents/Code/gitlit/app"
"E:\\projects\\p\\gitlit\\app"
]
],
"_development": true,
@@ -27,7 +27,7 @@
],
"_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
"_spec": "4.1.0",
"_where": "/home/s2/Documents/Code/gitlit/app",
"_where": "E:\\projects\\p\\gitlit\\app",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",

View File

@@ -1,33 +1,27 @@
{
"_args": [
[
"yargs-parser@10.0.0",
"/home/s2/Documents/Code/gitlit/app"
]
],
"_development": true,
"_from": "yargs-parser@10.0.0",
"_id": "yargs-parser@10.0.0",
"_from": "yargs-parser@^10.0.0",
"_id": "yargs-parser@10.1.0",
"_inBundle": false,
"_integrity": "sha512-+DHejWujTVYeMHLff8U96rLc4uE4Emncoftvn5AjhB1Jw1pWxLzgBUT/WYbPrHmy6YPEBTZQx5myHhVcuuu64g==",
"_integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==",
"_location": "/yargs-parser",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "range",
"registry": true,
"raw": "yargs-parser@10.0.0",
"raw": "yargs-parser@^10.0.0",
"name": "yargs-parser",
"escapedName": "yargs-parser",
"rawSpec": "10.0.0",
"rawSpec": "^10.0.0",
"saveSpec": null,
"fetchSpec": "10.0.0"
"fetchSpec": "^10.0.0"
},
"_requiredBy": [
"/electron-packager"
],
"_resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.0.0.tgz",
"_spec": "10.0.0",
"_where": "/home/s2/Documents/Code/gitlit/app",
"_resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz",
"_shasum": "7202265b89f7e9e9f2e5765e0fe735a905edbaa8",
"_spec": "yargs-parser@^10.0.0",
"_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager",
"author": {
"name": "Ben Coe",
"email": "ben@npmjs.com"
@@ -35,9 +29,11 @@
"bugs": {
"url": "https://github.com/yargs/yargs-parser/issues"
},
"bundleDependencies": false,
"dependencies": {
"camelcase": "^4.1.0"
},
"deprecated": false,
"description": "the mighty option parser used by yargs",
"devDependencies": {
"chai": "^3.5.0",
@@ -75,5 +71,5 @@
"release": "standard-version",
"test": "nyc mocha test/*.js"
},
"version": "10.0.0"
"version": "10.1.0"
}