Update metadata

This commit is contained in:
Imran Ismail
2019-09-05 12:08:20 +08:00
parent 6e5c237523
commit 56c04146d7
1454 changed files with 204046 additions and 234789 deletions

34
node_modules/yargs/yargs.js generated vendored
View File

@@ -11,7 +11,7 @@ const Y18n = require('y18n')
const objFilter = require('./lib/obj-filter')
const setBlocking = require('set-blocking')
const applyExtends = require('./lib/apply-extends')
const middlewareFactory = require('./lib/middleware')
const { globalMiddlewareFactory } = require('./lib/middleware')
const YError = require('./lib/yerror')
exports = module.exports = Yargs
@@ -33,7 +33,7 @@ function Yargs (processArgs, cwd, parentRequire) {
updateFiles: false
})
self.middleware = middlewareFactory(globalMiddleware, self)
self.middleware = globalMiddlewareFactory(globalMiddleware, self)
if (!cwd) cwd = process.cwd()
@@ -694,8 +694,8 @@ function Yargs (processArgs, cwd, parentRequire) {
}
// .positional() only supports a subset of the configuration
// options availble to .option().
const supportedOpts = ['default', 'implies', 'normalize',
// options available to .option().
const supportedOpts = ['default', 'defaultDescription', 'implies', 'normalize',
'choices', 'conflicts', 'coerce', 'type', 'describe',
'desc', 'description', 'alias']
opts = objFilter(opts, (k, v) => {
@@ -765,6 +765,14 @@ function Yargs (processArgs, cwd, parentRequire) {
}
self.getStrict = () => strict
let parserConfig = {}
self.parserConfiguration = function parserConfiguration (config) {
argsert('<object>', [config], arguments.length)
parserConfig = config
return self
}
self.getParserConfiguration = () => parserConfig
self.showHelp = function (level) {
argsert('[string|function]', [level], arguments.length)
if (!self.parsed) self._parseArgs(processArgs) // run parser, if it has not already been executed.
@@ -895,7 +903,7 @@ function Yargs (processArgs, cwd, parentRequire) {
// register the completion command.
completionCommand = cmd || 'completion'
if (!desc && desc !== false) {
desc = 'generate bash completion script'
desc = 'generate completion script'
}
self.command(completionCommand, desc)
@@ -1010,7 +1018,14 @@ function Yargs (processArgs, cwd, parentRequire) {
args = args || processArgs
options.__ = y18n.__
options.configuration = pkgUp()['yargs'] || {}
options.configuration = self.getParserConfiguration()
// Deprecated
let pkgConfig = pkgUp()['yargs']
if (pkgConfig) {
console.warn('Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.')
options.configuration = Object.assign({}, pkgConfig, options.configuration)
}
const parsed = Parser.detailed(args, options)
let argv = parsed.argv
@@ -1152,7 +1167,7 @@ function Yargs (processArgs, cwd, parentRequire) {
}
self._runValidation = function runValidation (argv, aliases, positionalMap, parseErrors) {
if (parseErrors) throw new YError(parseErrors.message)
if (parseErrors) throw new YError(parseErrors.message || parseErrors)
validation.nonOptionCount(argv)
validation.requiredArguments(argv)
if (strict) validation.unknownArguments(argv, aliases, positionalMap)
@@ -1166,8 +1181,9 @@ function Yargs (processArgs, cwd, parentRequire) {
if (!detectLocale) return
try {
const osLocale = require('os-locale')
self.locale(osLocale.sync({ spawn: false }))
const { env } = process
const locale = env.LC_ALL || env.LC_MESSAGES || env.LANG || env.LANGUAGE || 'en_US'
self.locale(locale.replace(/[.:].*/, ''))
} catch (err) {
// if we explode looking up locale just noop
// we'll keep using the default language 'en'.