It appears you have a well-structured Git repository with various files, including SVG icons and HTML documents. Here's a brief overview:
This commit is contained in:
1335
backend/node_modules/yargs/CHANGELOG.md
generated
vendored
Normal file
1335
backend/node_modules/yargs/CHANGELOG.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
22
backend/node_modules/yargs/LICENSE
generated
vendored
Normal file
22
backend/node_modules/yargs/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
Copyright 2010 James Halliday (mail@substack.net)
|
||||
Modified work Copyright 2014 Contributors (ben@npmjs.com)
|
||||
|
||||
This project is free software released under the MIT/X11 license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
122
backend/node_modules/yargs/README.md
generated
vendored
Normal file
122
backend/node_modules/yargs/README.md
generated
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
<p align="center">
|
||||
<img width="250" src="/yargs-logo.png">
|
||||
</p>
|
||||
<h1 align="center"> Yargs </h1>
|
||||
<p align="center">
|
||||
<b >Yargs be a node.js library fer hearties tryin' ter parse optstrings</b>
|
||||
</p>
|
||||
<br>
|
||||
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Coverage Status][coveralls-image]][coveralls-url]
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
[![js-standard-style][standard-image]][standard-url]
|
||||
[![Conventional Commits][conventional-commits-image]][conventional-commits-url]
|
||||
[![Slack][slack-image]][slack-url]
|
||||
|
||||
## Description :
|
||||
Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface.
|
||||
|
||||
It gives you:
|
||||
|
||||
* commands and (grouped) options (`my-program.js serve --port=5000`).
|
||||
* a dynamically generated help menu based on your arguments.
|
||||
|
||||
> <img width="400" src="/screen.png">
|
||||
|
||||
* bash-completion shortcuts for commands and options.
|
||||
* and [tons more](/docs/api.md).
|
||||
|
||||
## Installation
|
||||
|
||||
Stable version:
|
||||
```bash
|
||||
npm i yargs
|
||||
```
|
||||
|
||||
Bleeding edge version with the most recent features:
|
||||
```bash
|
||||
npm i yargs@next
|
||||
```
|
||||
|
||||
## Usage :
|
||||
|
||||
### Simple Example
|
||||
|
||||
````javascript
|
||||
#!/usr/bin/env node
|
||||
const argv = require('yargs').argv
|
||||
|
||||
if (argv.ships > 3 && argv.distance < 53.5) {
|
||||
console.log('Plunder more riffiwobbles!')
|
||||
} else {
|
||||
console.log('Retreat from the xupptumblers!')
|
||||
}
|
||||
````
|
||||
|
||||
```bash
|
||||
$ ./plunder.js --ships=4 --distance=22
|
||||
Plunder more riffiwobbles!
|
||||
|
||||
$ ./plunder.js --ships 12 --distance 98.7
|
||||
Retreat from the xupptumblers!
|
||||
```
|
||||
|
||||
### Complex Example
|
||||
|
||||
```javascript
|
||||
#!/usr/bin/env node
|
||||
require('yargs') // eslint-disable-line
|
||||
.command('serve [port]', 'start the server', (yargs) => {
|
||||
yargs
|
||||
.positional('port', {
|
||||
describe: 'port to bind on',
|
||||
default: 5000
|
||||
})
|
||||
}, (argv) => {
|
||||
if (argv.verbose) console.info(`start server on :${argv.port}`)
|
||||
serve(argv.port)
|
||||
})
|
||||
.option('verbose', {
|
||||
alias: 'v',
|
||||
default: false
|
||||
})
|
||||
.argv
|
||||
```
|
||||
|
||||
Run the example above with `--help` to see the help for the application.
|
||||
|
||||
## Community :
|
||||
|
||||
Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com).
|
||||
|
||||
## Documentation :
|
||||
|
||||
### Table of Contents
|
||||
|
||||
* [Yargs' API](/docs/api.md)
|
||||
* [Examples](/docs/examples.md)
|
||||
* [Parsing Tricks](/docs/tricks.md)
|
||||
* [Stop the Parser](/docs/tricks.md#stop)
|
||||
* [Negating Boolean Arguments](/docs/tricks.md#negate)
|
||||
* [Numbers](/docs/tricks.md#numbers)
|
||||
* [Arrays](/docs/tricks.md#arrays)
|
||||
* [Objects](/docs/tricks.md#objects)
|
||||
* [Advanced Topics](/docs/advanced.md)
|
||||
* [Composing Your App Using Commands](/docs/advanced.md#commands)
|
||||
* [Building Configurable CLI Apps](/docs/advanced.md#configuration)
|
||||
* [Customizing Yargs' Parser](/docs/advanced.md#customizing)
|
||||
* [Contributing](/contributing.md)
|
||||
|
||||
[travis-url]: https://travis-ci.org/yargs/yargs
|
||||
[travis-image]: https://img.shields.io/travis/yargs/yargs/master.svg
|
||||
[coveralls-url]: https://coveralls.io/github/yargs/yargs
|
||||
[coveralls-image]: https://img.shields.io/coveralls/yargs/yargs.svg
|
||||
[npm-url]: https://www.npmjs.com/package/yargs
|
||||
[npm-image]: https://img.shields.io/npm/v/yargs.svg
|
||||
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
|
||||
[standard-url]: http://standardjs.com/
|
||||
[conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg
|
||||
[conventional-commits-url]: https://conventionalcommits.org/
|
||||
[slack-image]: http://devtoolscommunity.herokuapp.com/badge.svg
|
||||
[slack-url]: http://devtoolscommunity.herokuapp.com
|
32
backend/node_modules/yargs/index.js
generated
vendored
Normal file
32
backend/node_modules/yargs/index.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
'use strict'
|
||||
// classic singleton yargs API, to use yargs
|
||||
// without running as a singleton do:
|
||||
// require('yargs/yargs')(process.argv.slice(2))
|
||||
const yargs = require('./yargs')
|
||||
|
||||
Argv(process.argv.slice(2))
|
||||
|
||||
module.exports = Argv
|
||||
|
||||
function Argv (processArgs, cwd) {
|
||||
const argv = yargs(processArgs, cwd, require)
|
||||
singletonify(argv)
|
||||
return argv
|
||||
}
|
||||
|
||||
/* Hack an instance of Argv with process.argv into Argv
|
||||
so people can do
|
||||
require('yargs')(['--beeble=1','-z','zizzle']).argv
|
||||
to parse a list of args and
|
||||
require('yargs').argv
|
||||
to get a parsed version of process.argv.
|
||||
*/
|
||||
function singletonify (inst) {
|
||||
Object.keys(inst).forEach((key) => {
|
||||
if (key === 'argv') {
|
||||
Argv.__defineGetter__(key, inst.__lookupGetter__(key))
|
||||
} else {
|
||||
Argv[key] = typeof inst[key] === 'function' ? inst[key].bind(inst) : inst[key]
|
||||
}
|
||||
})
|
||||
}
|
53
backend/node_modules/yargs/lib/apply-extends.js
generated
vendored
Normal file
53
backend/node_modules/yargs/lib/apply-extends.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
|
||||
'use strict'
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const YError = require('./yerror')
|
||||
|
||||
let previouslyVisitedConfigs = []
|
||||
|
||||
function checkForCircularExtends (cfgPath) {
|
||||
if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) {
|
||||
throw new YError(`Circular extended configurations: '${cfgPath}'.`)
|
||||
}
|
||||
}
|
||||
|
||||
function getPathToDefaultConfig (cwd, pathToExtend) {
|
||||
return path.resolve(cwd, pathToExtend)
|
||||
}
|
||||
|
||||
function applyExtends (config, cwd) {
|
||||
let defaultConfig = {}
|
||||
|
||||
if (config.hasOwnProperty('extends')) {
|
||||
if (typeof config.extends !== 'string') return defaultConfig
|
||||
const isPath = /\.json|\..*rc$/.test(config.extends)
|
||||
let pathToDefault = null
|
||||
if (!isPath) {
|
||||
try {
|
||||
pathToDefault = require.resolve(config.extends)
|
||||
} catch (err) {
|
||||
// most likely this simply isn't a module.
|
||||
}
|
||||
} else {
|
||||
pathToDefault = getPathToDefaultConfig(cwd, config.extends)
|
||||
}
|
||||
// maybe the module uses key for some other reason,
|
||||
// err on side of caution.
|
||||
if (!pathToDefault && !isPath) return config
|
||||
|
||||
checkForCircularExtends(pathToDefault)
|
||||
|
||||
previouslyVisitedConfigs.push(pathToDefault)
|
||||
|
||||
defaultConfig = isPath ? JSON.parse(fs.readFileSync(pathToDefault, 'utf8')) : require(config.extends)
|
||||
delete config.extends
|
||||
defaultConfig = applyExtends(defaultConfig, path.dirname(pathToDefault))
|
||||
}
|
||||
|
||||
previouslyVisitedConfigs = []
|
||||
|
||||
return Object.assign({}, defaultConfig, config)
|
||||
}
|
||||
|
||||
module.exports = applyExtends
|
68
backend/node_modules/yargs/lib/argsert.js
generated
vendored
Normal file
68
backend/node_modules/yargs/lib/argsert.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
'use strict'
|
||||
|
||||
// hoisted due to circular dependency on command.
|
||||
module.exports = argsert
|
||||
const command = require('./command')()
|
||||
const YError = require('./yerror')
|
||||
|
||||
const positionName = ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']
|
||||
function argsert (expected, callerArguments, length) {
|
||||
// TODO: should this eventually raise an exception.
|
||||
try {
|
||||
// preface the argument description with "cmd", so
|
||||
// that we can run it through yargs' command parser.
|
||||
let position = 0
|
||||
let parsed = { demanded: [], optional: [] }
|
||||
if (typeof expected === 'object') {
|
||||
length = callerArguments
|
||||
callerArguments = expected
|
||||
} else {
|
||||
parsed = command.parseCommand(`cmd ${expected}`)
|
||||
}
|
||||
const args = [].slice.call(callerArguments)
|
||||
|
||||
while (args.length && args[args.length - 1] === undefined) args.pop()
|
||||
length = length || args.length
|
||||
|
||||
if (length < parsed.demanded.length) {
|
||||
throw new YError(`Not enough arguments provided. Expected ${parsed.demanded.length} but received ${args.length}.`)
|
||||
}
|
||||
|
||||
const totalCommands = parsed.demanded.length + parsed.optional.length
|
||||
if (length > totalCommands) {
|
||||
throw new YError(`Too many arguments provided. Expected max ${totalCommands} but received ${length}.`)
|
||||
}
|
||||
|
||||
parsed.demanded.forEach((demanded) => {
|
||||
const arg = args.shift()
|
||||
const observedType = guessType(arg)
|
||||
const matchingTypes = demanded.cmd.filter(type => type === observedType || type === '*')
|
||||
if (matchingTypes.length === 0) argumentTypeError(observedType, demanded.cmd, position, false)
|
||||
position += 1
|
||||
})
|
||||
|
||||
parsed.optional.forEach((optional) => {
|
||||
if (args.length === 0) return
|
||||
const arg = args.shift()
|
||||
const observedType = guessType(arg)
|
||||
const matchingTypes = optional.cmd.filter(type => type === observedType || type === '*')
|
||||
if (matchingTypes.length === 0) argumentTypeError(observedType, optional.cmd, position, true)
|
||||
position += 1
|
||||
})
|
||||
} catch (err) {
|
||||
console.warn(err.stack)
|
||||
}
|
||||
}
|
||||
|
||||
function guessType (arg) {
|
||||
if (Array.isArray(arg)) {
|
||||
return 'array'
|
||||
} else if (arg === null) {
|
||||
return 'null'
|
||||
}
|
||||
return typeof arg
|
||||
}
|
||||
|
||||
function argumentTypeError (observedType, allowedTypes, position, optional) {
|
||||
throw new YError(`Invalid ${positionName[position] || 'manyith'} argument. Expected ${allowedTypes.join(' or ')} but received ${observedType}.`)
|
||||
}
|
437
backend/node_modules/yargs/lib/command.js
generated
vendored
Normal file
437
backend/node_modules/yargs/lib/command.js
generated
vendored
Normal file
@@ -0,0 +1,437 @@
|
||||
'use strict'
|
||||
|
||||
const inspect = require('util').inspect
|
||||
const isPromise = require('./is-promise')
|
||||
const { applyMiddleware, commandMiddlewareFactory } = require('./middleware')
|
||||
const path = require('path')
|
||||
const Parser = require('yargs-parser')
|
||||
|
||||
const DEFAULT_MARKER = /(^\*)|(^\$0)/
|
||||
|
||||
// handles parsing positional arguments,
|
||||
// and populating argv with said positional
|
||||
// arguments.
|
||||
module.exports = function command (yargs, usage, validation, globalMiddleware) {
|
||||
const self = {}
|
||||
let handlers = {}
|
||||
let aliasMap = {}
|
||||
let defaultCommand
|
||||
globalMiddleware = globalMiddleware || []
|
||||
|
||||
self.addHandler = function addHandler (cmd, description, builder, handler, commandMiddleware) {
|
||||
let aliases = []
|
||||
const middlewares = commandMiddlewareFactory(commandMiddleware)
|
||||
handler = handler || (() => {})
|
||||
|
||||
if (Array.isArray(cmd)) {
|
||||
aliases = cmd.slice(1)
|
||||
cmd = cmd[0]
|
||||
} else if (typeof cmd === 'object') {
|
||||
let command = (Array.isArray(cmd.command) || typeof cmd.command === 'string') ? cmd.command : moduleName(cmd)
|
||||
if (cmd.aliases) command = [].concat(command).concat(cmd.aliases)
|
||||
self.addHandler(command, extractDesc(cmd), cmd.builder, cmd.handler, cmd.middlewares)
|
||||
return
|
||||
}
|
||||
|
||||
// allow a module to be provided instead of separate builder and handler
|
||||
if (typeof builder === 'object' && builder.builder && typeof builder.handler === 'function') {
|
||||
self.addHandler([cmd].concat(aliases), description, builder.builder, builder.handler, builder.middlewares)
|
||||
return
|
||||
}
|
||||
|
||||
// parse positionals out of cmd string
|
||||
const parsedCommand = self.parseCommand(cmd)
|
||||
|
||||
// remove positional args from aliases only
|
||||
aliases = aliases.map(alias => self.parseCommand(alias).cmd)
|
||||
|
||||
// check for default and filter out '*''
|
||||
let isDefault = false
|
||||
const parsedAliases = [parsedCommand.cmd].concat(aliases).filter((c) => {
|
||||
if (DEFAULT_MARKER.test(c)) {
|
||||
isDefault = true
|
||||
return false
|
||||
}
|
||||
return true
|
||||
})
|
||||
|
||||
// standardize on $0 for default command.
|
||||
if (parsedAliases.length === 0 && isDefault) parsedAliases.push('$0')
|
||||
|
||||
// shift cmd and aliases after filtering out '*'
|
||||
if (isDefault) {
|
||||
parsedCommand.cmd = parsedAliases[0]
|
||||
aliases = parsedAliases.slice(1)
|
||||
cmd = cmd.replace(DEFAULT_MARKER, parsedCommand.cmd)
|
||||
}
|
||||
|
||||
// populate aliasMap
|
||||
aliases.forEach((alias) => {
|
||||
aliasMap[alias] = parsedCommand.cmd
|
||||
})
|
||||
|
||||
if (description !== false) {
|
||||
usage.command(cmd, description, isDefault, aliases)
|
||||
}
|
||||
|
||||
handlers[parsedCommand.cmd] = {
|
||||
original: cmd,
|
||||
description: description,
|
||||
handler,
|
||||
builder: builder || {},
|
||||
middlewares: middlewares || [],
|
||||
demanded: parsedCommand.demanded,
|
||||
optional: parsedCommand.optional
|
||||
}
|
||||
|
||||
if (isDefault) defaultCommand = handlers[parsedCommand.cmd]
|
||||
}
|
||||
|
||||
self.addDirectory = function addDirectory (dir, context, req, callerFile, opts) {
|
||||
opts = opts || {}
|
||||
// disable recursion to support nested directories of subcommands
|
||||
if (typeof opts.recurse !== 'boolean') opts.recurse = false
|
||||
// exclude 'json', 'coffee' from require-directory defaults
|
||||
if (!Array.isArray(opts.extensions)) opts.extensions = ['js']
|
||||
// allow consumer to define their own visitor function
|
||||
const parentVisit = typeof opts.visit === 'function' ? opts.visit : o => o
|
||||
// call addHandler via visitor function
|
||||
opts.visit = function visit (obj, joined, filename) {
|
||||
const visited = parentVisit(obj, joined, filename)
|
||||
// allow consumer to skip modules with their own visitor
|
||||
if (visited) {
|
||||
// check for cyclic reference
|
||||
// each command file path should only be seen once per execution
|
||||
if (~context.files.indexOf(joined)) return visited
|
||||
// keep track of visited files in context.files
|
||||
context.files.push(joined)
|
||||
self.addHandler(visited)
|
||||
}
|
||||
return visited
|
||||
}
|
||||
require('require-directory')({ require: req, filename: callerFile }, dir, opts)
|
||||
}
|
||||
|
||||
// lookup module object from require()d command and derive name
|
||||
// if module was not require()d and no name given, throw error
|
||||
function moduleName (obj) {
|
||||
const mod = require('which-module')(obj)
|
||||
if (!mod) throw new Error(`No command name given for module: ${inspect(obj)}`)
|
||||
return commandFromFilename(mod.filename)
|
||||
}
|
||||
|
||||
// derive command name from filename
|
||||
function commandFromFilename (filename) {
|
||||
return path.basename(filename, path.extname(filename))
|
||||
}
|
||||
|
||||
function extractDesc (obj) {
|
||||
for (let keys = ['describe', 'description', 'desc'], i = 0, l = keys.length, test; i < l; i++) {
|
||||
test = obj[keys[i]]
|
||||
if (typeof test === 'string' || typeof test === 'boolean') return test
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
self.parseCommand = function parseCommand (cmd) {
|
||||
const extraSpacesStrippedCommand = cmd.replace(/\s{2,}/g, ' ')
|
||||
const splitCommand = extraSpacesStrippedCommand.split(/\s+(?![^[]*]|[^<]*>)/)
|
||||
const bregex = /\.*[\][<>]/g
|
||||
const parsedCommand = {
|
||||
cmd: (splitCommand.shift()).replace(bregex, ''),
|
||||
demanded: [],
|
||||
optional: []
|
||||
}
|
||||
splitCommand.forEach((cmd, i) => {
|
||||
let variadic = false
|
||||
cmd = cmd.replace(/\s/g, '')
|
||||
if (/\.+[\]>]/.test(cmd) && i === splitCommand.length - 1) variadic = true
|
||||
if (/^\[/.test(cmd)) {
|
||||
parsedCommand.optional.push({
|
||||
cmd: cmd.replace(bregex, '').split('|'),
|
||||
variadic
|
||||
})
|
||||
} else {
|
||||
parsedCommand.demanded.push({
|
||||
cmd: cmd.replace(bregex, '').split('|'),
|
||||
variadic
|
||||
})
|
||||
}
|
||||
})
|
||||
return parsedCommand
|
||||
}
|
||||
|
||||
self.getCommands = () => Object.keys(handlers).concat(Object.keys(aliasMap))
|
||||
|
||||
self.getCommandHandlers = () => handlers
|
||||
|
||||
self.hasDefaultCommand = () => !!defaultCommand
|
||||
|
||||
self.runCommand = function runCommand (command, yargs, parsed, commandIndex) {
|
||||
let aliases = parsed.aliases
|
||||
const commandHandler = handlers[command] || handlers[aliasMap[command]] || defaultCommand
|
||||
const currentContext = yargs.getContext()
|
||||
let numFiles = currentContext.files.length
|
||||
const parentCommands = currentContext.commands.slice()
|
||||
|
||||
// what does yargs look like after the buidler is run?
|
||||
let innerArgv = parsed.argv
|
||||
let innerYargs = null
|
||||
let positionalMap = {}
|
||||
if (command) {
|
||||
currentContext.commands.push(command)
|
||||
currentContext.fullCommands.push(commandHandler.original)
|
||||
}
|
||||
if (typeof commandHandler.builder === 'function') {
|
||||
// a function can be provided, which builds
|
||||
// up a yargs chain and possibly returns it.
|
||||
innerYargs = commandHandler.builder(yargs.reset(parsed.aliases))
|
||||
// if the builder function did not yet parse argv with reset yargs
|
||||
// and did not explicitly set a usage() string, then apply the
|
||||
// original command string as usage() for consistent behavior with
|
||||
// options object below.
|
||||
if (yargs.parsed === false) {
|
||||
if (shouldUpdateUsage(yargs)) {
|
||||
yargs.getUsageInstance().usage(
|
||||
usageFromParentCommandsCommandHandler(parentCommands, commandHandler),
|
||||
commandHandler.description
|
||||
)
|
||||
}
|
||||
innerArgv = innerYargs ? innerYargs._parseArgs(null, null, true, commandIndex) : yargs._parseArgs(null, null, true, commandIndex)
|
||||
} else {
|
||||
innerArgv = yargs.parsed.argv
|
||||
}
|
||||
|
||||
if (innerYargs && yargs.parsed === false) aliases = innerYargs.parsed.aliases
|
||||
else aliases = yargs.parsed.aliases
|
||||
} else if (typeof commandHandler.builder === 'object') {
|
||||
// as a short hand, an object can instead be provided, specifying
|
||||
// the options that a command takes.
|
||||
innerYargs = yargs.reset(parsed.aliases)
|
||||
if (shouldUpdateUsage(innerYargs)) {
|
||||
innerYargs.getUsageInstance().usage(
|
||||
usageFromParentCommandsCommandHandler(parentCommands, commandHandler),
|
||||
commandHandler.description
|
||||
)
|
||||
}
|
||||
Object.keys(commandHandler.builder).forEach((key) => {
|
||||
innerYargs.option(key, commandHandler.builder[key])
|
||||
})
|
||||
innerArgv = innerYargs._parseArgs(null, null, true, commandIndex)
|
||||
aliases = innerYargs.parsed.aliases
|
||||
}
|
||||
|
||||
if (!yargs._hasOutput()) {
|
||||
positionalMap = populatePositionals(commandHandler, innerArgv, currentContext, yargs)
|
||||
}
|
||||
|
||||
const middlewares = globalMiddleware.slice(0).concat(commandHandler.middlewares || [])
|
||||
applyMiddleware(innerArgv, yargs, middlewares, true)
|
||||
|
||||
// we apply validation post-hoc, so that custom
|
||||
// checks get passed populated positional arguments.
|
||||
if (!yargs._hasOutput()) yargs._runValidation(innerArgv, aliases, positionalMap, yargs.parsed.error)
|
||||
|
||||
if (commandHandler.handler && !yargs._hasOutput()) {
|
||||
yargs._setHasOutput()
|
||||
|
||||
innerArgv = applyMiddleware(innerArgv, yargs, middlewares, false)
|
||||
|
||||
const handlerResult = isPromise(innerArgv)
|
||||
? innerArgv.then(argv => commandHandler.handler(argv))
|
||||
: commandHandler.handler(innerArgv)
|
||||
|
||||
if (isPromise(handlerResult)) {
|
||||
handlerResult.catch(error =>
|
||||
yargs.getUsageInstance().fail(null, error)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (command) {
|
||||
currentContext.commands.pop()
|
||||
currentContext.fullCommands.pop()
|
||||
}
|
||||
numFiles = currentContext.files.length - numFiles
|
||||
if (numFiles > 0) currentContext.files.splice(numFiles * -1, numFiles)
|
||||
|
||||
return innerArgv
|
||||
}
|
||||
|
||||
function shouldUpdateUsage (yargs) {
|
||||
return !yargs.getUsageInstance().getUsageDisabled() &&
|
||||
yargs.getUsageInstance().getUsage().length === 0
|
||||
}
|
||||
|
||||
function usageFromParentCommandsCommandHandler (parentCommands, commandHandler) {
|
||||
const c = DEFAULT_MARKER.test(commandHandler.original) ? commandHandler.original.replace(DEFAULT_MARKER, '').trim() : commandHandler.original
|
||||
const pc = parentCommands.filter((c) => { return !DEFAULT_MARKER.test(c) })
|
||||
pc.push(c)
|
||||
return `$0 ${pc.join(' ')}`
|
||||
}
|
||||
|
||||
self.runDefaultBuilderOn = function (yargs) {
|
||||
if (shouldUpdateUsage(yargs)) {
|
||||
// build the root-level command string from the default string.
|
||||
const commandString = DEFAULT_MARKER.test(defaultCommand.original)
|
||||
? defaultCommand.original : defaultCommand.original.replace(/^[^[\]<>]*/, '$0 ')
|
||||
yargs.getUsageInstance().usage(
|
||||
commandString,
|
||||
defaultCommand.description
|
||||
)
|
||||
}
|
||||
const builder = defaultCommand.builder
|
||||
if (typeof builder === 'function') {
|
||||
builder(yargs)
|
||||
} else {
|
||||
Object.keys(builder).forEach((key) => {
|
||||
yargs.option(key, builder[key])
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// transcribe all positional arguments "command <foo> <bar> [apple]"
|
||||
// onto argv.
|
||||
function populatePositionals (commandHandler, argv, context, yargs) {
|
||||
argv._ = argv._.slice(context.commands.length) // nuke the current commands
|
||||
const demanded = commandHandler.demanded.slice(0)
|
||||
const optional = commandHandler.optional.slice(0)
|
||||
const positionalMap = {}
|
||||
|
||||
validation.positionalCount(demanded.length, argv._.length)
|
||||
|
||||
while (demanded.length) {
|
||||
const demand = demanded.shift()
|
||||
populatePositional(demand, argv, positionalMap)
|
||||
}
|
||||
|
||||
while (optional.length) {
|
||||
const maybe = optional.shift()
|
||||
populatePositional(maybe, argv, positionalMap)
|
||||
}
|
||||
|
||||
argv._ = context.commands.concat(argv._)
|
||||
|
||||
postProcessPositionals(argv, positionalMap, self.cmdToParseOptions(commandHandler.original))
|
||||
|
||||
return positionalMap
|
||||
}
|
||||
|
||||
function populatePositional (positional, argv, positionalMap, parseOptions) {
|
||||
const cmd = positional.cmd[0]
|
||||
if (positional.variadic) {
|
||||
positionalMap[cmd] = argv._.splice(0).map(String)
|
||||
} else {
|
||||
if (argv._.length) positionalMap[cmd] = [String(argv._.shift())]
|
||||
}
|
||||
}
|
||||
|
||||
// we run yargs-parser against the positional arguments
|
||||
// applying the same parsing logic used for flags.
|
||||
function postProcessPositionals (argv, positionalMap, parseOptions) {
|
||||
// combine the parsing hints we've inferred from the command
|
||||
// string with explicitly configured parsing hints.
|
||||
const options = Object.assign({}, yargs.getOptions())
|
||||
options.default = Object.assign(parseOptions.default, options.default)
|
||||
options.alias = Object.assign(parseOptions.alias, options.alias)
|
||||
options.array = options.array.concat(parseOptions.array)
|
||||
delete options.config // don't load config when processing positionals.
|
||||
|
||||
const unparsed = []
|
||||
Object.keys(positionalMap).forEach((key) => {
|
||||
positionalMap[key].map((value) => {
|
||||
unparsed.push(`--${key}`)
|
||||
unparsed.push(value)
|
||||
})
|
||||
})
|
||||
|
||||
// short-circuit parse.
|
||||
if (!unparsed.length) return
|
||||
|
||||
const parsed = Parser.detailed(unparsed, options)
|
||||
|
||||
if (parsed.error) {
|
||||
yargs.getUsageInstance().fail(parsed.error.message, parsed.error)
|
||||
} else {
|
||||
// only copy over positional keys (don't overwrite
|
||||
// flag arguments that were already parsed).
|
||||
const positionalKeys = Object.keys(positionalMap)
|
||||
Object.keys(positionalMap).forEach((key) => {
|
||||
[].push.apply(positionalKeys, parsed.aliases[key])
|
||||
})
|
||||
|
||||
Object.keys(parsed.argv).forEach((key) => {
|
||||
if (positionalKeys.indexOf(key) !== -1) {
|
||||
// any new aliases need to be placed in positionalMap, which
|
||||
// is used for validation.
|
||||
if (!positionalMap[key]) positionalMap[key] = parsed.argv[key]
|
||||
argv[key] = parsed.argv[key]
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
self.cmdToParseOptions = function (cmdString) {
|
||||
const parseOptions = {
|
||||
array: [],
|
||||
default: {},
|
||||
alias: {},
|
||||
demand: {}
|
||||
}
|
||||
|
||||
const parsed = self.parseCommand(cmdString)
|
||||
parsed.demanded.forEach((d) => {
|
||||
const cmds = d.cmd.slice(0)
|
||||
const cmd = cmds.shift()
|
||||
if (d.variadic) {
|
||||
parseOptions.array.push(cmd)
|
||||
parseOptions.default[cmd] = []
|
||||
}
|
||||
cmds.forEach((c) => {
|
||||
parseOptions.alias[cmd] = c
|
||||
})
|
||||
parseOptions.demand[cmd] = true
|
||||
})
|
||||
|
||||
parsed.optional.forEach((o) => {
|
||||
const cmds = o.cmd.slice(0)
|
||||
const cmd = cmds.shift()
|
||||
if (o.variadic) {
|
||||
parseOptions.array.push(cmd)
|
||||
parseOptions.default[cmd] = []
|
||||
}
|
||||
cmds.forEach((c) => {
|
||||
parseOptions.alias[cmd] = c
|
||||
})
|
||||
})
|
||||
|
||||
return parseOptions
|
||||
}
|
||||
|
||||
self.reset = () => {
|
||||
handlers = {}
|
||||
aliasMap = {}
|
||||
defaultCommand = undefined
|
||||
return self
|
||||
}
|
||||
|
||||
// used by yargs.parse() to freeze
|
||||
// the state of commands such that
|
||||
// we can apply .parse() multiple times
|
||||
// with the same yargs instance.
|
||||
let frozen
|
||||
self.freeze = () => {
|
||||
frozen = {}
|
||||
frozen.handlers = handlers
|
||||
frozen.aliasMap = aliasMap
|
||||
frozen.defaultCommand = defaultCommand
|
||||
}
|
||||
self.unfreeze = () => {
|
||||
handlers = frozen.handlers
|
||||
aliasMap = frozen.aliasMap
|
||||
defaultCommand = frozen.defaultCommand
|
||||
frozen = undefined
|
||||
}
|
||||
|
||||
return self
|
||||
}
|
49
backend/node_modules/yargs/lib/completion-templates.js
generated
vendored
Normal file
49
backend/node_modules/yargs/lib/completion-templates.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
exports.completionShTemplate =
|
||||
`###-begin-{{app_name}}-completions-###
|
||||
#
|
||||
# yargs command completion script
|
||||
#
|
||||
# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc
|
||||
# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.
|
||||
#
|
||||
_yargs_completions()
|
||||
{
|
||||
local cur_word args type_list
|
||||
|
||||
cur_word="\${COMP_WORDS[COMP_CWORD]}"
|
||||
args=("\${COMP_WORDS[@]}")
|
||||
|
||||
# ask yargs to generate completions.
|
||||
type_list=$({{app_path}} --get-yargs-completions "\${args[@]}")
|
||||
|
||||
COMPREPLY=( $(compgen -W "\${type_list}" -- \${cur_word}) )
|
||||
|
||||
# if no match was found, fall back to filename completion
|
||||
if [ \${#COMPREPLY[@]} -eq 0 ]; then
|
||||
COMPREPLY=()
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
complete -o default -F _yargs_completions {{app_name}}
|
||||
###-end-{{app_name}}-completions-###
|
||||
`
|
||||
|
||||
exports.completionZshTemplate = `###-begin-{{app_name}}-completions-###
|
||||
#
|
||||
# yargs command completion script
|
||||
#
|
||||
# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
|
||||
# or {{app_path}} {{completion_command}} >> ~/.zsh_profile on OSX.
|
||||
#
|
||||
_{{app_name}}_yargs_completions()
|
||||
{
|
||||
local reply
|
||||
local si=$IFS
|
||||
IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
|
||||
IFS=$si
|
||||
_describe 'values' reply
|
||||
}
|
||||
compdef _{{app_name}}_yargs_completions {{app_name}}
|
||||
###-end-{{app_name}}-completions-###
|
||||
`
|
115
backend/node_modules/yargs/lib/completion.js
generated
vendored
Normal file
115
backend/node_modules/yargs/lib/completion.js
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
|
||||
// add bash completions to your
|
||||
// yargs-powered applications.
|
||||
module.exports = function completion (yargs, usage, command) {
|
||||
const self = {
|
||||
completionKey: 'get-yargs-completions'
|
||||
}
|
||||
|
||||
const zshShell = process.env.SHELL && process.env.SHELL.indexOf('zsh') !== -1
|
||||
// get a list of completion commands.
|
||||
// 'args' is the array of strings from the line to be completed
|
||||
self.getCompletion = function getCompletion (args, done) {
|
||||
const completions = []
|
||||
const current = args.length ? args[args.length - 1] : ''
|
||||
const argv = yargs.parse(args, true)
|
||||
const aliases = yargs.parsed.aliases
|
||||
const parentCommands = yargs.getContext().commands
|
||||
|
||||
// a custom completion function can be provided
|
||||
// to completion().
|
||||
if (completionFunction) {
|
||||
if (completionFunction.length < 3) {
|
||||
const result = completionFunction(current, argv)
|
||||
|
||||
// promise based completion function.
|
||||
if (typeof result.then === 'function') {
|
||||
return result.then((list) => {
|
||||
process.nextTick(() => { done(list) })
|
||||
}).catch((err) => {
|
||||
process.nextTick(() => { throw err })
|
||||
})
|
||||
}
|
||||
|
||||
// synchronous completion function.
|
||||
return done(result)
|
||||
} else {
|
||||
// asynchronous completion function
|
||||
return completionFunction(current, argv, (completions) => {
|
||||
done(completions)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const handlers = command.getCommandHandlers()
|
||||
for (let i = 0, ii = args.length; i < ii; ++i) {
|
||||
if (handlers[args[i]] && handlers[args[i]].builder) {
|
||||
const builder = handlers[args[i]].builder
|
||||
if (typeof builder === 'function') {
|
||||
const y = yargs.reset()
|
||||
builder(y)
|
||||
return y.argv
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!current.match(/^-/) && parentCommands[parentCommands.length - 1] !== current) {
|
||||
usage.getCommands().forEach((usageCommand) => {
|
||||
const commandName = command.parseCommand(usageCommand[0]).cmd
|
||||
if (args.indexOf(commandName) === -1) {
|
||||
if (!zshShell) {
|
||||
completions.push(commandName)
|
||||
} else {
|
||||
const desc = usageCommand[1] || ''
|
||||
completions.push(commandName.replace(/:/g, '\\:') + ':' + desc)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (current.match(/^-/) || (current === '' && completions.length === 0)) {
|
||||
const descs = usage.getDescriptions()
|
||||
Object.keys(yargs.getOptions().key).forEach((key) => {
|
||||
// If the key and its aliases aren't in 'args', add the key to 'completions'
|
||||
const keyAndAliases = [key].concat(aliases[key] || [])
|
||||
const notInArgs = keyAndAliases.every(val => args.indexOf(`--${val}`) === -1)
|
||||
if (notInArgs) {
|
||||
if (!zshShell) {
|
||||
completions.push(`--${key}`)
|
||||
} else {
|
||||
const desc = descs[key] || ''
|
||||
completions.push(`--${key.replace(/:/g, '\\:')}:${desc.replace('__yargsString__:', '')}`)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
done(completions)
|
||||
}
|
||||
|
||||
// generate the completion script to add to your .bashrc.
|
||||
self.generateCompletionScript = function generateCompletionScript ($0, cmd) {
|
||||
const templates = require('./completion-templates')
|
||||
let script = zshShell ? templates.completionZshTemplate : templates.completionShTemplate
|
||||
const name = path.basename($0)
|
||||
|
||||
// add ./to applications not yet installed as bin.
|
||||
if ($0.match(/\.js$/)) $0 = `./${$0}`
|
||||
|
||||
script = script.replace(/{{app_name}}/g, name)
|
||||
script = script.replace(/{{completion_command}}/g, cmd)
|
||||
return script.replace(/{{app_path}}/g, $0)
|
||||
}
|
||||
|
||||
// register a function to perform your own custom
|
||||
// completions., this function can be either
|
||||
// synchrnous or asynchronous.
|
||||
let completionFunction = null
|
||||
self.registerFunction = (fn) => {
|
||||
completionFunction = fn
|
||||
}
|
||||
|
||||
return self
|
||||
}
|
32
backend/node_modules/yargs/lib/decamelize.js
generated
vendored
Normal file
32
backend/node_modules/yargs/lib/decamelize.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
'use strict'
|
||||
|
||||
module.exports = (text, separator) => {
|
||||
separator = typeof separator === 'undefined' ? '_' : separator
|
||||
|
||||
return text
|
||||
.replace(/([a-z\d])([A-Z])/g, `$1${separator}$2`)
|
||||
.replace(/([A-Z]+)([A-Z][a-z\d]+)/g, `$1${separator}$2`)
|
||||
.toLowerCase()
|
||||
}
|
3
backend/node_modules/yargs/lib/is-promise.js
generated
vendored
Normal file
3
backend/node_modules/yargs/lib/is-promise.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = function isPromise (maybePromise) {
|
||||
return maybePromise instanceof Promise
|
||||
}
|
58
backend/node_modules/yargs/lib/levenshtein.js
generated
vendored
Normal file
58
backend/node_modules/yargs/lib/levenshtein.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
Copyright (c) 2011 Andrei Mackenzie
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// levenshtein distance algorithm, pulled from Andrei Mackenzie's MIT licensed.
|
||||
// gist, which can be found here: https://gist.github.com/andrei-m/982927
|
||||
'use strict'
|
||||
// Compute the edit distance between the two given strings
|
||||
module.exports = function levenshtein (a, b) {
|
||||
if (a.length === 0) return b.length
|
||||
if (b.length === 0) return a.length
|
||||
|
||||
const matrix = []
|
||||
|
||||
// increment along the first column of each row
|
||||
let i
|
||||
for (i = 0; i <= b.length; i++) {
|
||||
matrix[i] = [i]
|
||||
}
|
||||
|
||||
// increment each column in the first row
|
||||
let j
|
||||
for (j = 0; j <= a.length; j++) {
|
||||
matrix[0][j] = j
|
||||
}
|
||||
|
||||
// Fill in the rest of the matrix
|
||||
for (i = 1; i <= b.length; i++) {
|
||||
for (j = 1; j <= a.length; j++) {
|
||||
if (b.charAt(i - 1) === a.charAt(j - 1)) {
|
||||
matrix[i][j] = matrix[i - 1][j - 1]
|
||||
} else {
|
||||
matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
|
||||
Math.min(matrix[i][j - 1] + 1, // insertion
|
||||
matrix[i - 1][j] + 1)) // deletion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return matrix[b.length][a.length]
|
||||
}
|
65
backend/node_modules/yargs/lib/middleware.js
generated
vendored
Normal file
65
backend/node_modules/yargs/lib/middleware.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
'use strict'
|
||||
|
||||
// hoisted due to circular dependency on command.
|
||||
module.exports = {
|
||||
applyMiddleware,
|
||||
commandMiddlewareFactory,
|
||||
globalMiddlewareFactory
|
||||
}
|
||||
const isPromise = require('./is-promise')
|
||||
const argsert = require('./argsert')
|
||||
|
||||
function globalMiddlewareFactory (globalMiddleware, context) {
|
||||
return function (callback, applyBeforeValidation = false) {
|
||||
argsert('<array|function> [boolean]', [callback, applyBeforeValidation], arguments.length)
|
||||
if (Array.isArray(callback)) {
|
||||
for (let i = 0; i < callback.length; i++) {
|
||||
if (typeof callback[i] !== 'function') {
|
||||
throw Error('middleware must be a function')
|
||||
}
|
||||
callback[i].applyBeforeValidation = applyBeforeValidation
|
||||
}
|
||||
Array.prototype.push.apply(globalMiddleware, callback)
|
||||
} else if (typeof callback === 'function') {
|
||||
callback.applyBeforeValidation = applyBeforeValidation
|
||||
globalMiddleware.push(callback)
|
||||
}
|
||||
return context
|
||||
}
|
||||
}
|
||||
|
||||
function commandMiddlewareFactory (commandMiddleware) {
|
||||
if (!commandMiddleware) return []
|
||||
return commandMiddleware.map(middleware => {
|
||||
middleware.applyBeforeValidation = false
|
||||
return middleware
|
||||
})
|
||||
}
|
||||
|
||||
function applyMiddleware (argv, yargs, middlewares, beforeValidation) {
|
||||
const beforeValidationError = new Error('middleware cannot return a promise when applyBeforeValidation is true')
|
||||
return middlewares
|
||||
.reduce((accumulation, middleware) => {
|
||||
if (middleware.applyBeforeValidation !== beforeValidation &&
|
||||
!isPromise(accumulation)) {
|
||||
return accumulation
|
||||
}
|
||||
|
||||
if (isPromise(accumulation)) {
|
||||
return accumulation
|
||||
.then(initialObj =>
|
||||
Promise.all([initialObj, middleware(initialObj, yargs)])
|
||||
)
|
||||
.then(([initialObj, middlewareObj]) =>
|
||||
Object.assign(initialObj, middlewareObj)
|
||||
)
|
||||
} else {
|
||||
const result = middleware(argv, yargs)
|
||||
if (beforeValidation && isPromise(result)) throw beforeValidationError
|
||||
|
||||
return isPromise(result)
|
||||
? result.then(middlewareObj => Object.assign(accumulation, middlewareObj))
|
||||
: Object.assign(accumulation, result)
|
||||
}
|
||||
}, argv)
|
||||
}
|
11
backend/node_modules/yargs/lib/obj-filter.js
generated
vendored
Normal file
11
backend/node_modules/yargs/lib/obj-filter.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
'use strict'
|
||||
module.exports = function objFilter (original, filter) {
|
||||
const obj = {}
|
||||
filter = filter || ((k, v) => true)
|
||||
Object.keys(original || {}).forEach((key) => {
|
||||
if (filter(key, original[key])) {
|
||||
obj[key] = original[key]
|
||||
}
|
||||
})
|
||||
return obj
|
||||
}
|
540
backend/node_modules/yargs/lib/usage.js
generated
vendored
Normal file
540
backend/node_modules/yargs/lib/usage.js
generated
vendored
Normal file
@@ -0,0 +1,540 @@
|
||||
'use strict'
|
||||
// this file handles outputting usage instructions,
|
||||
// failures, etc. keeps logging in one place.
|
||||
const decamelize = require('./decamelize')
|
||||
const stringWidth = require('string-width')
|
||||
const objFilter = require('./obj-filter')
|
||||
const path = require('path')
|
||||
const setBlocking = require('set-blocking')
|
||||
const YError = require('./yerror')
|
||||
|
||||
module.exports = function usage (yargs, y18n) {
|
||||
const __ = y18n.__
|
||||
const self = {}
|
||||
|
||||
// methods for ouputting/building failure message.
|
||||
const fails = []
|
||||
self.failFn = function failFn (f) {
|
||||
fails.push(f)
|
||||
}
|
||||
|
||||
let failMessage = null
|
||||
let showHelpOnFail = true
|
||||
self.showHelpOnFail = function showHelpOnFailFn (enabled, message) {
|
||||
if (typeof enabled === 'string') {
|
||||
message = enabled
|
||||
enabled = true
|
||||
} else if (typeof enabled === 'undefined') {
|
||||
enabled = true
|
||||
}
|
||||
failMessage = message
|
||||
showHelpOnFail = enabled
|
||||
return self
|
||||
}
|
||||
|
||||
let failureOutput = false
|
||||
self.fail = function fail (msg, err) {
|
||||
const logger = yargs._getLoggerInstance()
|
||||
|
||||
if (fails.length) {
|
||||
for (let i = fails.length - 1; i >= 0; --i) {
|
||||
fails[i](msg, err, self)
|
||||
}
|
||||
} else {
|
||||
if (yargs.getExitProcess()) setBlocking(true)
|
||||
|
||||
// don't output failure message more than once
|
||||
if (!failureOutput) {
|
||||
failureOutput = true
|
||||
if (showHelpOnFail) {
|
||||
yargs.showHelp('error')
|
||||
logger.error()
|
||||
}
|
||||
if (msg || err) logger.error(msg || err)
|
||||
if (failMessage) {
|
||||
if (msg || err) logger.error('')
|
||||
logger.error(failMessage)
|
||||
}
|
||||
}
|
||||
|
||||
err = err || new YError(msg)
|
||||
if (yargs.getExitProcess()) {
|
||||
return yargs.exit(1)
|
||||
} else if (yargs._hasParseCallback()) {
|
||||
return yargs.exit(1, err)
|
||||
} else {
|
||||
throw err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// methods for ouputting/building help (usage) message.
|
||||
let usages = []
|
||||
let usageDisabled = false
|
||||
self.usage = (msg, description) => {
|
||||
if (msg === null) {
|
||||
usageDisabled = true
|
||||
usages = []
|
||||
return
|
||||
}
|
||||
usageDisabled = false
|
||||
usages.push([msg, description || ''])
|
||||
return self
|
||||
}
|
||||
self.getUsage = () => {
|
||||
return usages
|
||||
}
|
||||
self.getUsageDisabled = () => {
|
||||
return usageDisabled
|
||||
}
|
||||
|
||||
self.getPositionalGroupName = () => {
|
||||
return __('Positionals:')
|
||||
}
|
||||
|
||||
let examples = []
|
||||
self.example = (cmd, description) => {
|
||||
examples.push([cmd, description || ''])
|
||||
}
|
||||
|
||||
let commands = []
|
||||
self.command = function command (cmd, description, isDefault, aliases) {
|
||||
// the last default wins, so cancel out any previously set default
|
||||
if (isDefault) {
|
||||
commands = commands.map((cmdArray) => {
|
||||
cmdArray[2] = false
|
||||
return cmdArray
|
||||
})
|
||||
}
|
||||
commands.push([cmd, description || '', isDefault, aliases])
|
||||
}
|
||||
self.getCommands = () => commands
|
||||
|
||||
let descriptions = {}
|
||||
self.describe = function describe (key, desc) {
|
||||
if (typeof key === 'object') {
|
||||
Object.keys(key).forEach((k) => {
|
||||
self.describe(k, key[k])
|
||||
})
|
||||
} else {
|
||||
descriptions[key] = desc
|
||||
}
|
||||
}
|
||||
self.getDescriptions = () => descriptions
|
||||
|
||||
let epilog
|
||||
self.epilog = (msg) => {
|
||||
epilog = msg
|
||||
}
|
||||
|
||||
let wrapSet = false
|
||||
let wrap
|
||||
self.wrap = (cols) => {
|
||||
wrapSet = true
|
||||
wrap = cols
|
||||
}
|
||||
|
||||
function getWrap () {
|
||||
if (!wrapSet) {
|
||||
wrap = windowWidth()
|
||||
wrapSet = true
|
||||
}
|
||||
|
||||
return wrap
|
||||
}
|
||||
|
||||
const deferY18nLookupPrefix = '__yargsString__:'
|
||||
self.deferY18nLookup = str => deferY18nLookupPrefix + str
|
||||
|
||||
const defaultGroup = 'Options:'
|
||||
self.help = function help () {
|
||||
normalizeAliases()
|
||||
|
||||
// handle old demanded API
|
||||
const base$0 = path.basename(yargs.$0)
|
||||
const demandedOptions = yargs.getDemandedOptions()
|
||||
const demandedCommands = yargs.getDemandedCommands()
|
||||
const groups = yargs.getGroups()
|
||||
const options = yargs.getOptions()
|
||||
|
||||
let keys = []
|
||||
keys = keys.concat(Object.keys(descriptions))
|
||||
keys = keys.concat(Object.keys(demandedOptions))
|
||||
keys = keys.concat(Object.keys(demandedCommands))
|
||||
keys = keys.concat(Object.keys(options.default))
|
||||
keys = keys.filter(filterHiddenOptions)
|
||||
keys = Object.keys(keys.reduce((acc, key) => {
|
||||
if (key !== '_') acc[key] = true
|
||||
return acc
|
||||
}, {}))
|
||||
|
||||
const theWrap = getWrap()
|
||||
const ui = require('cliui')({
|
||||
width: theWrap,
|
||||
wrap: !!theWrap
|
||||
})
|
||||
|
||||
// the usage string.
|
||||
if (!usageDisabled) {
|
||||
if (usages.length) {
|
||||
// user-defined usage.
|
||||
usages.forEach((usage) => {
|
||||
ui.div(`${usage[0].replace(/\$0/g, base$0)}`)
|
||||
if (usage[1]) {
|
||||
ui.div({ text: `${usage[1]}`, padding: [1, 0, 0, 0] })
|
||||
}
|
||||
})
|
||||
ui.div()
|
||||
} else if (commands.length) {
|
||||
let u = null
|
||||
// demonstrate how commands are used.
|
||||
if (demandedCommands._) {
|
||||
u = `${base$0} <${__('command')}>\n`
|
||||
} else {
|
||||
u = `${base$0} [${__('command')}]\n`
|
||||
}
|
||||
ui.div(`${u}`)
|
||||
}
|
||||
}
|
||||
|
||||
// your application's commands, i.e., non-option
|
||||
// arguments populated in '_'.
|
||||
if (commands.length) {
|
||||
ui.div(__('Commands:'))
|
||||
|
||||
const context = yargs.getContext()
|
||||
const parentCommands = context.commands.length ? `${context.commands.join(' ')} ` : ''
|
||||
|
||||
if (yargs.getParserConfiguration()['sort-commands'] === true) {
|
||||
commands = commands.sort((a, b) => a[0].localeCompare(b[0]))
|
||||
}
|
||||
|
||||
commands.forEach((command) => {
|
||||
const commandString = `${base$0} ${parentCommands}${command[0].replace(/^\$0 ?/, '')}` // drop $0 from default commands.
|
||||
ui.span(
|
||||
{
|
||||
text: commandString,
|
||||
padding: [0, 2, 0, 2],
|
||||
width: maxWidth(commands, theWrap, `${base$0}${parentCommands}`) + 4
|
||||
},
|
||||
{ text: command[1] }
|
||||
)
|
||||
const hints = []
|
||||
if (command[2]) hints.push(`[${__('default:').slice(0, -1)}]`) // TODO hacking around i18n here
|
||||
if (command[3] && command[3].length) {
|
||||
hints.push(`[${__('aliases:')} ${command[3].join(', ')}]`)
|
||||
}
|
||||
if (hints.length) {
|
||||
ui.div({ text: hints.join(' '), padding: [0, 0, 0, 2], align: 'right' })
|
||||
} else {
|
||||
ui.div()
|
||||
}
|
||||
})
|
||||
|
||||
ui.div()
|
||||
}
|
||||
|
||||
// perform some cleanup on the keys array, making it
|
||||
// only include top-level keys not their aliases.
|
||||
const aliasKeys = (Object.keys(options.alias) || [])
|
||||
.concat(Object.keys(yargs.parsed.newAliases) || [])
|
||||
|
||||
keys = keys.filter(key => !yargs.parsed.newAliases[key] && aliasKeys.every(alias => (options.alias[alias] || []).indexOf(key) === -1))
|
||||
|
||||
// populate 'Options:' group with any keys that have not
|
||||
// explicitly had a group set.
|
||||
if (!groups[defaultGroup]) groups[defaultGroup] = []
|
||||
addUngroupedKeys(keys, options.alias, groups)
|
||||
|
||||
// display 'Options:' table along with any custom tables:
|
||||
Object.keys(groups).forEach((groupName) => {
|
||||
if (!groups[groupName].length) return
|
||||
|
||||
// if we've grouped the key 'f', but 'f' aliases 'foobar',
|
||||
// normalizedKeys should contain only 'foobar'.
|
||||
const normalizedKeys = groups[groupName].filter(filterHiddenOptions).map((key) => {
|
||||
if (~aliasKeys.indexOf(key)) return key
|
||||
for (let i = 0, aliasKey; (aliasKey = aliasKeys[i]) !== undefined; i++) {
|
||||
if (~(options.alias[aliasKey] || []).indexOf(key)) return aliasKey
|
||||
}
|
||||
return key
|
||||
})
|
||||
|
||||
if (normalizedKeys.length < 1) return
|
||||
|
||||
ui.div(__(groupName))
|
||||
|
||||
// actually generate the switches string --foo, -f, --bar.
|
||||
const switches = normalizedKeys.reduce((acc, key) => {
|
||||
acc[key] = [ key ].concat(options.alias[key] || [])
|
||||
.map(sw => {
|
||||
// for the special positional group don't
|
||||
// add '--' or '-' prefix.
|
||||
if (groupName === self.getPositionalGroupName()) return sw
|
||||
else return (sw.length > 1 ? '--' : '-') + sw
|
||||
})
|
||||
.join(', ')
|
||||
|
||||
return acc
|
||||
}, {})
|
||||
|
||||
normalizedKeys.forEach((key) => {
|
||||
const kswitch = switches[key]
|
||||
let desc = descriptions[key] || ''
|
||||
let type = null
|
||||
|
||||
if (~desc.lastIndexOf(deferY18nLookupPrefix)) desc = __(desc.substring(deferY18nLookupPrefix.length))
|
||||
|
||||
if (~options.boolean.indexOf(key)) type = `[${__('boolean')}]`
|
||||
if (~options.count.indexOf(key)) type = `[${__('count')}]`
|
||||
if (~options.string.indexOf(key)) type = `[${__('string')}]`
|
||||
if (~options.normalize.indexOf(key)) type = `[${__('string')}]`
|
||||
if (~options.array.indexOf(key)) type = `[${__('array')}]`
|
||||
if (~options.number.indexOf(key)) type = `[${__('number')}]`
|
||||
|
||||
const extra = [
|
||||
type,
|
||||
(key in demandedOptions) ? `[${__('required')}]` : null,
|
||||
options.choices && options.choices[key] ? `[${__('choices:')} ${
|
||||
self.stringifiedValues(options.choices[key])}]` : null,
|
||||
defaultString(options.default[key], options.defaultDescription[key])
|
||||
].filter(Boolean).join(' ')
|
||||
|
||||
ui.span(
|
||||
{ text: kswitch, padding: [0, 2, 0, 2], width: maxWidth(switches, theWrap) + 4 },
|
||||
desc
|
||||
)
|
||||
|
||||
if (extra) ui.div({ text: extra, padding: [0, 0, 0, 2], align: 'right' })
|
||||
else ui.div()
|
||||
})
|
||||
|
||||
ui.div()
|
||||
})
|
||||
|
||||
// describe some common use-cases for your application.
|
||||
if (examples.length) {
|
||||
ui.div(__('Examples:'))
|
||||
|
||||
examples.forEach((example) => {
|
||||
example[0] = example[0].replace(/\$0/g, base$0)
|
||||
})
|
||||
|
||||
examples.forEach((example) => {
|
||||
if (example[1] === '') {
|
||||
ui.div(
|
||||
{
|
||||
text: example[0],
|
||||
padding: [0, 2, 0, 2]
|
||||
}
|
||||
)
|
||||
} else {
|
||||
ui.div(
|
||||
{
|
||||
text: example[0],
|
||||
padding: [0, 2, 0, 2],
|
||||
width: maxWidth(examples, theWrap) + 4
|
||||
}, {
|
||||
text: example[1]
|
||||
}
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
ui.div()
|
||||
}
|
||||
|
||||
// the usage string.
|
||||
if (epilog) {
|
||||
const e = epilog.replace(/\$0/g, base$0)
|
||||
ui.div(`${e}\n`)
|
||||
}
|
||||
|
||||
// Remove the trailing white spaces
|
||||
return ui.toString().replace(/\s*$/, '')
|
||||
}
|
||||
|
||||
// return the maximum width of a string
|
||||
// in the left-hand column of a table.
|
||||
function maxWidth (table, theWrap, modifier) {
|
||||
let width = 0
|
||||
|
||||
// table might be of the form [leftColumn],
|
||||
// or {key: leftColumn}
|
||||
if (!Array.isArray(table)) {
|
||||
table = Object.keys(table).map(key => [table[key]])
|
||||
}
|
||||
|
||||
table.forEach((v) => {
|
||||
width = Math.max(
|
||||
stringWidth(modifier ? `${modifier} ${v[0]}` : v[0]),
|
||||
width
|
||||
)
|
||||
})
|
||||
|
||||
// if we've enabled 'wrap' we should limit
|
||||
// the max-width of the left-column.
|
||||
if (theWrap) width = Math.min(width, parseInt(theWrap * 0.5, 10))
|
||||
|
||||
return width
|
||||
}
|
||||
|
||||
// make sure any options set for aliases,
|
||||
// are copied to the keys being aliased.
|
||||
function normalizeAliases () {
|
||||
// handle old demanded API
|
||||
const demandedOptions = yargs.getDemandedOptions()
|
||||
const options = yargs.getOptions()
|
||||
|
||||
;(Object.keys(options.alias) || []).forEach((key) => {
|
||||
options.alias[key].forEach((alias) => {
|
||||
// copy descriptions.
|
||||
if (descriptions[alias]) self.describe(key, descriptions[alias])
|
||||
// copy demanded.
|
||||
if (alias in demandedOptions) yargs.demandOption(key, demandedOptions[alias])
|
||||
// type messages.
|
||||
if (~options.boolean.indexOf(alias)) yargs.boolean(key)
|
||||
if (~options.count.indexOf(alias)) yargs.count(key)
|
||||
if (~options.string.indexOf(alias)) yargs.string(key)
|
||||
if (~options.normalize.indexOf(alias)) yargs.normalize(key)
|
||||
if (~options.array.indexOf(alias)) yargs.array(key)
|
||||
if (~options.number.indexOf(alias)) yargs.number(key)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// given a set of keys, place any keys that are
|
||||
// ungrouped under the 'Options:' grouping.
|
||||
function addUngroupedKeys (keys, aliases, groups) {
|
||||
let groupedKeys = []
|
||||
let toCheck = null
|
||||
Object.keys(groups).forEach((group) => {
|
||||
groupedKeys = groupedKeys.concat(groups[group])
|
||||
})
|
||||
|
||||
keys.forEach((key) => {
|
||||
toCheck = [key].concat(aliases[key])
|
||||
if (!toCheck.some(k => groupedKeys.indexOf(k) !== -1)) {
|
||||
groups[defaultGroup].push(key)
|
||||
}
|
||||
})
|
||||
return groupedKeys
|
||||
}
|
||||
|
||||
function filterHiddenOptions (key) {
|
||||
return yargs.getOptions().hiddenOptions.indexOf(key) < 0 || yargs.parsed.argv[yargs.getOptions().showHiddenOpt]
|
||||
}
|
||||
|
||||
self.showHelp = (level) => {
|
||||
const logger = yargs._getLoggerInstance()
|
||||
if (!level) level = 'error'
|
||||
const emit = typeof level === 'function' ? level : logger[level]
|
||||
emit(self.help())
|
||||
}
|
||||
|
||||
self.functionDescription = (fn) => {
|
||||
const description = fn.name ? decamelize(fn.name, '-') : __('generated-value')
|
||||
return ['(', description, ')'].join('')
|
||||
}
|
||||
|
||||
self.stringifiedValues = function stringifiedValues (values, separator) {
|
||||
let string = ''
|
||||
const sep = separator || ', '
|
||||
const array = [].concat(values)
|
||||
|
||||
if (!values || !array.length) return string
|
||||
|
||||
array.forEach((value) => {
|
||||
if (string.length) string += sep
|
||||
string += JSON.stringify(value)
|
||||
})
|
||||
|
||||
return string
|
||||
}
|
||||
|
||||
// format the default-value-string displayed in
|
||||
// the right-hand column.
|
||||
function defaultString (value, defaultDescription) {
|
||||
let string = `[${__('default:')} `
|
||||
|
||||
if (value === undefined && !defaultDescription) return null
|
||||
|
||||
if (defaultDescription) {
|
||||
string += defaultDescription
|
||||
} else {
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
string += `"${value}"`
|
||||
break
|
||||
case 'object':
|
||||
string += JSON.stringify(value)
|
||||
break
|
||||
default:
|
||||
string += value
|
||||
}
|
||||
}
|
||||
|
||||
return `${string}]`
|
||||
}
|
||||
|
||||
// guess the width of the console window, max-width 80.
|
||||
function windowWidth () {
|
||||
const maxWidth = 80
|
||||
if (typeof process === 'object' && process.stdout && process.stdout.columns) {
|
||||
return Math.min(maxWidth, process.stdout.columns)
|
||||
} else {
|
||||
return maxWidth
|
||||
}
|
||||
}
|
||||
|
||||
// logic for displaying application version.
|
||||
let version = null
|
||||
self.version = (ver) => {
|
||||
version = ver
|
||||
}
|
||||
|
||||
self.showVersion = () => {
|
||||
const logger = yargs._getLoggerInstance()
|
||||
logger.log(version)
|
||||
}
|
||||
|
||||
self.reset = function reset (localLookup) {
|
||||
// do not reset wrap here
|
||||
// do not reset fails here
|
||||
failMessage = null
|
||||
failureOutput = false
|
||||
usages = []
|
||||
usageDisabled = false
|
||||
epilog = undefined
|
||||
examples = []
|
||||
commands = []
|
||||
descriptions = objFilter(descriptions, (k, v) => !localLookup[k])
|
||||
return self
|
||||
}
|
||||
|
||||
let frozen
|
||||
self.freeze = function freeze () {
|
||||
frozen = {}
|
||||
frozen.failMessage = failMessage
|
||||
frozen.failureOutput = failureOutput
|
||||
frozen.usages = usages
|
||||
frozen.usageDisabled = usageDisabled
|
||||
frozen.epilog = epilog
|
||||
frozen.examples = examples
|
||||
frozen.commands = commands
|
||||
frozen.descriptions = descriptions
|
||||
}
|
||||
self.unfreeze = function unfreeze () {
|
||||
failMessage = frozen.failMessage
|
||||
failureOutput = frozen.failureOutput
|
||||
usages = frozen.usages
|
||||
usageDisabled = frozen.usageDisabled
|
||||
epilog = frozen.epilog
|
||||
examples = frozen.examples
|
||||
commands = frozen.commands
|
||||
descriptions = frozen.descriptions
|
||||
frozen = undefined
|
||||
}
|
||||
|
||||
return self
|
||||
}
|
341
backend/node_modules/yargs/lib/validation.js
generated
vendored
Normal file
341
backend/node_modules/yargs/lib/validation.js
generated
vendored
Normal file
@@ -0,0 +1,341 @@
|
||||
'use strict'
|
||||
const argsert = require('./argsert')
|
||||
const objFilter = require('./obj-filter')
|
||||
const specialKeys = ['$0', '--', '_']
|
||||
|
||||
// validation-type-stuff, missing params,
|
||||
// bad implications, custom checks.
|
||||
module.exports = function validation (yargs, usage, y18n) {
|
||||
const __ = y18n.__
|
||||
const __n = y18n.__n
|
||||
const self = {}
|
||||
|
||||
// validate appropriate # of non-option
|
||||
// arguments were provided, i.e., '_'.
|
||||
self.nonOptionCount = function nonOptionCount (argv) {
|
||||
const demandedCommands = yargs.getDemandedCommands()
|
||||
// don't count currently executing commands
|
||||
const _s = argv._.length - yargs.getContext().commands.length
|
||||
|
||||
if (demandedCommands._ && (_s < demandedCommands._.min || _s > demandedCommands._.max)) {
|
||||
if (_s < demandedCommands._.min) {
|
||||
if (demandedCommands._.minMsg !== undefined) {
|
||||
usage.fail(
|
||||
// replace $0 with observed, $1 with expected.
|
||||
demandedCommands._.minMsg ? demandedCommands._.minMsg.replace(/\$0/g, _s).replace(/\$1/, demandedCommands._.min) : null
|
||||
)
|
||||
} else {
|
||||
usage.fail(
|
||||
__('Not enough non-option arguments: got %s, need at least %s', _s, demandedCommands._.min)
|
||||
)
|
||||
}
|
||||
} else if (_s > demandedCommands._.max) {
|
||||
if (demandedCommands._.maxMsg !== undefined) {
|
||||
usage.fail(
|
||||
// replace $0 with observed, $1 with expected.
|
||||
demandedCommands._.maxMsg ? demandedCommands._.maxMsg.replace(/\$0/g, _s).replace(/\$1/, demandedCommands._.max) : null
|
||||
)
|
||||
} else {
|
||||
usage.fail(
|
||||
__('Too many non-option arguments: got %s, maximum of %s', _s, demandedCommands._.max)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// validate the appropriate # of <required>
|
||||
// positional arguments were provided:
|
||||
self.positionalCount = function positionalCount (required, observed) {
|
||||
if (observed < required) {
|
||||
usage.fail(
|
||||
__('Not enough non-option arguments: got %s, need at least %s', observed, required)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// make sure all the required arguments are present.
|
||||
self.requiredArguments = function requiredArguments (argv) {
|
||||
const demandedOptions = yargs.getDemandedOptions()
|
||||
let missing = null
|
||||
|
||||
Object.keys(demandedOptions).forEach((key) => {
|
||||
if (!argv.hasOwnProperty(key) || typeof argv[key] === 'undefined') {
|
||||
missing = missing || {}
|
||||
missing[key] = demandedOptions[key]
|
||||
}
|
||||
})
|
||||
|
||||
if (missing) {
|
||||
const customMsgs = []
|
||||
Object.keys(missing).forEach((key) => {
|
||||
const msg = missing[key]
|
||||
if (msg && customMsgs.indexOf(msg) < 0) {
|
||||
customMsgs.push(msg)
|
||||
}
|
||||
})
|
||||
|
||||
const customMsg = customMsgs.length ? `\n${customMsgs.join('\n')}` : ''
|
||||
|
||||
usage.fail(__n(
|
||||
'Missing required argument: %s',
|
||||
'Missing required arguments: %s',
|
||||
Object.keys(missing).length,
|
||||
Object.keys(missing).join(', ') + customMsg
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
// check for unknown arguments (strict-mode).
|
||||
self.unknownArguments = function unknownArguments (argv, aliases, positionalMap) {
|
||||
const commandKeys = yargs.getCommandInstance().getCommands()
|
||||
const unknown = []
|
||||
const currentContext = yargs.getContext()
|
||||
|
||||
Object.keys(argv).forEach((key) => {
|
||||
if (specialKeys.indexOf(key) === -1 &&
|
||||
!positionalMap.hasOwnProperty(key) &&
|
||||
!yargs._getParseContext().hasOwnProperty(key) &&
|
||||
!aliases.hasOwnProperty(key)
|
||||
) {
|
||||
unknown.push(key)
|
||||
}
|
||||
})
|
||||
|
||||
if (commandKeys.length > 0) {
|
||||
argv._.slice(currentContext.commands.length).forEach((key) => {
|
||||
if (commandKeys.indexOf(key) === -1) {
|
||||
unknown.push(key)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (unknown.length > 0) {
|
||||
usage.fail(__n(
|
||||
'Unknown argument: %s',
|
||||
'Unknown arguments: %s',
|
||||
unknown.length,
|
||||
unknown.join(', ')
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
// validate arguments limited to enumerated choices
|
||||
self.limitedChoices = function limitedChoices (argv) {
|
||||
const options = yargs.getOptions()
|
||||
const invalid = {}
|
||||
|
||||
if (!Object.keys(options.choices).length) return
|
||||
|
||||
Object.keys(argv).forEach((key) => {
|
||||
if (specialKeys.indexOf(key) === -1 &&
|
||||
options.choices.hasOwnProperty(key)) {
|
||||
[].concat(argv[key]).forEach((value) => {
|
||||
// TODO case-insensitive configurability
|
||||
if (options.choices[key].indexOf(value) === -1 &&
|
||||
value !== undefined) {
|
||||
invalid[key] = (invalid[key] || []).concat(value)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
const invalidKeys = Object.keys(invalid)
|
||||
|
||||
if (!invalidKeys.length) return
|
||||
|
||||
let msg = __('Invalid values:')
|
||||
invalidKeys.forEach((key) => {
|
||||
msg += `\n ${__(
|
||||
'Argument: %s, Given: %s, Choices: %s',
|
||||
key,
|
||||
usage.stringifiedValues(invalid[key]),
|
||||
usage.stringifiedValues(options.choices[key])
|
||||
)}`
|
||||
})
|
||||
usage.fail(msg)
|
||||
}
|
||||
|
||||
// custom checks, added using the `check` option on yargs.
|
||||
let checks = []
|
||||
self.check = function check (f, global) {
|
||||
checks.push({
|
||||
func: f,
|
||||
global
|
||||
})
|
||||
}
|
||||
|
||||
self.customChecks = function customChecks (argv, aliases) {
|
||||
for (let i = 0, f; (f = checks[i]) !== undefined; i++) {
|
||||
const func = f.func
|
||||
let result = null
|
||||
try {
|
||||
result = func(argv, aliases)
|
||||
} catch (err) {
|
||||
usage.fail(err.message ? err.message : err, err)
|
||||
continue
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
usage.fail(__('Argument check failed: %s', func.toString()))
|
||||
} else if (typeof result === 'string' || result instanceof Error) {
|
||||
usage.fail(result.toString(), result)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check implications, argument foo implies => argument bar.
|
||||
let implied = {}
|
||||
self.implies = function implies (key, value) {
|
||||
argsert('<string|object> [array|number|string]', [key, value], arguments.length)
|
||||
|
||||
if (typeof key === 'object') {
|
||||
Object.keys(key).forEach((k) => {
|
||||
self.implies(k, key[k])
|
||||
})
|
||||
} else {
|
||||
yargs.global(key)
|
||||
if (!implied[key]) {
|
||||
implied[key] = []
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach((i) => self.implies(key, i))
|
||||
} else {
|
||||
implied[key].push(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
self.getImplied = function getImplied () {
|
||||
return implied
|
||||
}
|
||||
|
||||
self.implications = function implications (argv) {
|
||||
const implyFail = []
|
||||
|
||||
Object.keys(implied).forEach((key) => {
|
||||
const origKey = key
|
||||
;(implied[key] || []).forEach((value) => {
|
||||
let num
|
||||
let key = origKey
|
||||
const origValue = value
|
||||
|
||||
// convert string '1' to number 1
|
||||
num = Number(key)
|
||||
key = isNaN(num) ? key : num
|
||||
|
||||
if (typeof key === 'number') {
|
||||
// check length of argv._
|
||||
key = argv._.length >= key
|
||||
} else if (key.match(/^--no-.+/)) {
|
||||
// check if key doesn't exist
|
||||
key = key.match(/^--no-(.+)/)[1]
|
||||
key = !argv[key]
|
||||
} else {
|
||||
// check if key exists
|
||||
key = argv[key]
|
||||
}
|
||||
|
||||
num = Number(value)
|
||||
value = isNaN(num) ? value : num
|
||||
|
||||
if (typeof value === 'number') {
|
||||
value = argv._.length >= value
|
||||
} else if (value.match(/^--no-.+/)) {
|
||||
value = value.match(/^--no-(.+)/)[1]
|
||||
value = !argv[value]
|
||||
} else {
|
||||
value = argv[value]
|
||||
}
|
||||
if (key && !value) {
|
||||
implyFail.push(` ${origKey} -> ${origValue}`)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
if (implyFail.length) {
|
||||
let msg = `${__('Implications failed:')}\n`
|
||||
|
||||
implyFail.forEach((value) => {
|
||||
msg += (value)
|
||||
})
|
||||
|
||||
usage.fail(msg)
|
||||
}
|
||||
}
|
||||
|
||||
let conflicting = {}
|
||||
self.conflicts = function conflicts (key, value) {
|
||||
argsert('<string|object> [array|string]', [key, value], arguments.length)
|
||||
|
||||
if (typeof key === 'object') {
|
||||
Object.keys(key).forEach((k) => {
|
||||
self.conflicts(k, key[k])
|
||||
})
|
||||
} else {
|
||||
yargs.global(key)
|
||||
if (!conflicting[key]) {
|
||||
conflicting[key] = []
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach((i) => self.conflicts(key, i))
|
||||
} else {
|
||||
conflicting[key].push(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
self.getConflicting = () => conflicting
|
||||
|
||||
self.conflicting = function conflictingFn (argv) {
|
||||
Object.keys(argv).forEach((key) => {
|
||||
if (conflicting[key]) {
|
||||
conflicting[key].forEach((value) => {
|
||||
// we default keys to 'undefined' that have been configured, we should not
|
||||
// apply conflicting check unless they are a value other than 'undefined'.
|
||||
if (value && argv[key] !== undefined && argv[value] !== undefined) {
|
||||
usage.fail(__('Arguments %s and %s are mutually exclusive', key, value))
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
self.recommendCommands = function recommendCommands (cmd, potentialCommands) {
|
||||
const distance = require('./levenshtein')
|
||||
const threshold = 3 // if it takes more than three edits, let's move on.
|
||||
potentialCommands = potentialCommands.sort((a, b) => b.length - a.length)
|
||||
|
||||
let recommended = null
|
||||
let bestDistance = Infinity
|
||||
for (let i = 0, candidate; (candidate = potentialCommands[i]) !== undefined; i++) {
|
||||
const d = distance(cmd, candidate)
|
||||
if (d <= threshold && d < bestDistance) {
|
||||
bestDistance = d
|
||||
recommended = candidate
|
||||
}
|
||||
}
|
||||
if (recommended) usage.fail(__('Did you mean %s?', recommended))
|
||||
}
|
||||
|
||||
self.reset = function reset (localLookup) {
|
||||
implied = objFilter(implied, (k, v) => !localLookup[k])
|
||||
conflicting = objFilter(conflicting, (k, v) => !localLookup[k])
|
||||
checks = checks.filter(c => c.global)
|
||||
return self
|
||||
}
|
||||
|
||||
let frozen
|
||||
self.freeze = function freeze () {
|
||||
frozen = {}
|
||||
frozen.implied = implied
|
||||
frozen.checks = checks
|
||||
frozen.conflicting = conflicting
|
||||
}
|
||||
self.unfreeze = function unfreeze () {
|
||||
implied = frozen.implied
|
||||
checks = frozen.checks
|
||||
conflicting = frozen.conflicting
|
||||
frozen = undefined
|
||||
}
|
||||
|
||||
return self
|
||||
}
|
11
backend/node_modules/yargs/lib/yerror.js
generated
vendored
Normal file
11
backend/node_modules/yargs/lib/yerror.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
'use strict'
|
||||
function YError (msg) {
|
||||
this.name = 'YError'
|
||||
this.message = msg || 'yargs error'
|
||||
Error.captureStackTrace(this, YError)
|
||||
}
|
||||
|
||||
YError.prototype = Object.create(Error.prototype)
|
||||
YError.prototype.constructor = YError
|
||||
|
||||
module.exports = YError
|
39
backend/node_modules/yargs/locales/be.json
generated
vendored
Normal file
39
backend/node_modules/yargs/locales/be.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"Commands:": "Каманды:",
|
||||
"Options:": "Опцыі:",
|
||||
"Examples:": "Прыклады:",
|
||||
"boolean": "булевы тып",
|
||||
"count": "падлік",
|
||||
"string": "радковы тып",
|
||||
"number": "лік",
|
||||
"array": "масіў",
|
||||
"required": "неабходна",
|
||||
"default:": "па змаўчанні:",
|
||||
"choices:": "магчымасці:",
|
||||
"aliases:": "аліасы:",
|
||||
"generated-value": "згенераванае значэнне",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s",
|
||||
"Missing argument value: %s": {
|
||||
"one": "Не хапае значэння аргументу: %s",
|
||||
"other": "Не хапае значэнняў аргументаў: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Не хапае неабходнага аргументу: %s",
|
||||
"other": "Не хапае неабходных аргументаў: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Невядомы аргумент: %s",
|
||||
"other": "Невядомыя аргументы: %s"
|
||||
},
|
||||
"Invalid values:": "Несапраўдныя значэння:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Аргумент: %s, Дадзенае значэнне: %s, Магчымасці: %s",
|
||||
"Argument check failed: %s": "Праверка аргументаў не ўдалася: %s",
|
||||
"Implications failed:": "Дадзены аргумент патрабуе наступны дадатковы аргумент:",
|
||||
"Not enough arguments following: %s": "Недастаткова наступных аргументаў: %s",
|
||||
"Invalid JSON config file: %s": "Несапраўдны файл канфігурацыі JSON: %s",
|
||||
"Path to JSON config file": "Шлях да файла канфігурацыі JSON",
|
||||
"Show help": "Паказаць дапамогу",
|
||||
"Show version number": "Паказаць нумар версіі",
|
||||
"Did you mean %s?": "Вы мелі на ўвазе %s?"
|
||||
}
|
39
backend/node_modules/yargs/locales/de.json
generated
vendored
Normal file
39
backend/node_modules/yargs/locales/de.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"Commands:": "Kommandos:",
|
||||
"Options:": "Optionen:",
|
||||
"Examples:": "Beispiele:",
|
||||
"boolean": "boolean",
|
||||
"count": "Zähler",
|
||||
"string": "string",
|
||||
"number": "Zahl",
|
||||
"array": "array",
|
||||
"required": "erforderlich",
|
||||
"default:": "Standard:",
|
||||
"choices:": "Möglichkeiten:",
|
||||
"aliases:": "Aliase:",
|
||||
"generated-value": "Generierter-Wert",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt",
|
||||
"Missing argument value: %s": {
|
||||
"one": "Fehlender Argumentwert: %s",
|
||||
"other": "Fehlende Argumentwerte: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Fehlendes Argument: %s",
|
||||
"other": "Fehlende Argumente: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Unbekanntes Argument: %s",
|
||||
"other": "Unbekannte Argumente: %s"
|
||||
},
|
||||
"Invalid values:": "Unzulässige Werte:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeben: %s, Möglichkeiten: %s",
|
||||
"Argument check failed: %s": "Argumente-Check fehlgeschlagen: %s",
|
||||
"Implications failed:": "Fehlende abhängige Argumente:",
|
||||
"Not enough arguments following: %s": "Nicht genügend Argumente nach: %s",
|
||||
"Invalid JSON config file: %s": "Fehlerhafte JSON-Config Datei: %s",
|
||||
"Path to JSON config file": "Pfad zur JSON-Config Datei",
|
||||
"Show help": "Hilfe anzeigen",
|
||||
"Show version number": "Version anzeigen",
|
||||
"Did you mean %s?": "Meintest du %s?"
|
||||
}
|
42
backend/node_modules/yargs/locales/en.json
generated
vendored
Normal file
42
backend/node_modules/yargs/locales/en.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"Commands:": "Commands:",
|
||||
"Options:": "Options:",
|
||||
"Examples:": "Examples:",
|
||||
"boolean": "boolean",
|
||||
"count": "count",
|
||||
"string": "string",
|
||||
"number": "number",
|
||||
"array": "array",
|
||||
"required": "required",
|
||||
"default:": "default:",
|
||||
"choices:": "choices:",
|
||||
"aliases:": "aliases:",
|
||||
"generated-value": "generated-value",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "Not enough non-option arguments: got %s, need at least %s",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "Too many non-option arguments: got %s, maximum of %s",
|
||||
"Missing argument value: %s": {
|
||||
"one": "Missing argument value: %s",
|
||||
"other": "Missing argument values: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Missing required argument: %s",
|
||||
"other": "Missing required arguments: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Unknown argument: %s",
|
||||
"other": "Unknown arguments: %s"
|
||||
},
|
||||
"Invalid values:": "Invalid values:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Given: %s, Choices: %s",
|
||||
"Argument check failed: %s": "Argument check failed: %s",
|
||||
"Implications failed:": "Missing dependent arguments:",
|
||||
"Not enough arguments following: %s": "Not enough arguments following: %s",
|
||||
"Invalid JSON config file: %s": "Invalid JSON config file: %s",
|
||||
"Path to JSON config file": "Path to JSON config file",
|
||||
"Show help": "Show help",
|
||||
"Show version number": "Show version number",
|
||||
"Did you mean %s?": "Did you mean %s?",
|
||||
"Arguments %s and %s are mutually exclusive" : "Arguments %s and %s are mutually exclusive",
|
||||
"Positionals:": "Positionals:",
|
||||
"command": "command"
|
||||
}
|
39
backend/node_modules/yargs/locales/es.json
generated
vendored
Normal file
39
backend/node_modules/yargs/locales/es.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"Commands:": "Comandos:",
|
||||
"Options:": "Opciones:",
|
||||
"Examples:": "Ejemplos:",
|
||||
"boolean": "booleano",
|
||||
"count": "cuenta",
|
||||
"string": "cadena de caracteres",
|
||||
"number": "número",
|
||||
"array": "tabla",
|
||||
"required": "requerido",
|
||||
"default:": "defecto:",
|
||||
"choices:": "selección:",
|
||||
"aliases:": "alias:",
|
||||
"generated-value": "valor-generado",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s",
|
||||
"Missing argument value: %s": {
|
||||
"one": "Falta argumento: %s",
|
||||
"other": "Faltan argumentos: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Falta argumento requerido: %s",
|
||||
"other": "Faltan argumentos requeridos: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Argumento desconocido: %s",
|
||||
"other": "Argumentos desconocidos: %s"
|
||||
},
|
||||
"Invalid values:": "Valores inválidos:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Recibido: %s, Seleccionados: %s",
|
||||
"Argument check failed: %s": "Verificación de argumento ha fallado: %s",
|
||||
"Implications failed:": "Implicaciones fallidas:",
|
||||
"Not enough arguments following: %s": "No hay suficientes argumentos después de: %s",
|
||||
"Invalid JSON config file: %s": "Archivo de configuración JSON inválido: %s",
|
||||
"Path to JSON config file": "Ruta al archivo de configuración JSON",
|
||||
"Show help": "Muestra ayuda",
|
||||
"Show version number": "Muestra número de versión",
|
||||
"Did you mean %s?": "Quisiste decir %s?"
|
||||
}
|
37
backend/node_modules/yargs/locales/fr.json
generated
vendored
Normal file
37
backend/node_modules/yargs/locales/fr.json
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"Commands:": "Commandes:",
|
||||
"Options:": "Options:",
|
||||
"Examples:": "Exemples:",
|
||||
"boolean": "booléen",
|
||||
"count": "comptage",
|
||||
"string": "chaine de caractère",
|
||||
"number": "nombre",
|
||||
"array": "tableau",
|
||||
"required": "requis",
|
||||
"default:": "défaut:",
|
||||
"choices:": "choix:",
|
||||
"generated-value": "valeur générée",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "Pas assez d'arguments non-option: reçu %s, besoin d'au moins %s",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "Trop d'arguments non-option: reçu %s, maximum %s",
|
||||
"Missing argument value: %s": {
|
||||
"one": "Argument manquant: %s",
|
||||
"other": "Arguments manquants: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Argument requis manquant: %s",
|
||||
"other": "Arguments requis manquants: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Argument inconnu: %s",
|
||||
"other": "Arguments inconnus: %s"
|
||||
},
|
||||
"Invalid values:": "Valeurs invalides:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Donné: %s, Choix: %s",
|
||||
"Argument check failed: %s": "Echec de la vérification de l'argument: %s",
|
||||
"Implications failed:": "Arguments dépendants manquants:",
|
||||
"Not enough arguments following: %s": "Pas assez d'arguments suivant: %s",
|
||||
"Invalid JSON config file: %s": "Fichier de configuration JSON invalide: %s",
|
||||
"Path to JSON config file": "Chemin du fichier de configuration JSON",
|
||||
"Show help": "Affiche de l'aide",
|
||||
"Show version number": "Affiche le numéro de version"
|
||||
}
|
42
backend/node_modules/yargs/locales/hi.json
generated
vendored
Normal file
42
backend/node_modules/yargs/locales/hi.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"Commands:": "आदेश:",
|
||||
"Options:": "विकल्प:",
|
||||
"Examples:": "उदाहरण:",
|
||||
"boolean": "सत्यता",
|
||||
"count": "संख्या",
|
||||
"string": "वर्णों का तार ",
|
||||
"number": "अंक",
|
||||
"array": "सरणी",
|
||||
"required": "आवश्यक",
|
||||
"default:": "डिफॉल्ट:",
|
||||
"choices:": "विकल्प:",
|
||||
"aliases:": "उपनाम:",
|
||||
"generated-value": "उत्पन्न-मूल्य",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "पर्याप्त गैर-विकल्प तर्क प्राप्त नहीं: %s प्राप्त, कम से कम %s की आवश्यकता है",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "बहुत सारे गैर-विकल्प तर्क: %s प्राप्त, अधिकतम %s मान्य",
|
||||
"Missing argument value: %s": {
|
||||
"one": "कुछ तर्को के मूल्य गुम हैं: %s",
|
||||
"other": "कुछ तर्को के मूल्य गुम हैं: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "आवश्यक तर्क गुम हैं: %s",
|
||||
"other": "आवश्यक तर्क गुम हैं: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "अज्ञात तर्क प्राप्त: %s",
|
||||
"other": "अज्ञात तर्क प्राप्त: %s"
|
||||
},
|
||||
"Invalid values:": "अमान्य मूल्य:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "तर्क: %s, प्राप्त: %s, विकल्प: %s",
|
||||
"Argument check failed: %s": "तर्क जांच विफल: %s",
|
||||
"Implications failed:": "दिए गए तर्क के लिए अतिरिक्त तर्क की अपेक्षा है:",
|
||||
"Not enough arguments following: %s": "निम्नलिखित के बाद पर्याप्त तर्क नहीं प्राप्त: %s",
|
||||
"Invalid JSON config file: %s": "अमान्य JSON config फाइल: %s",
|
||||
"Path to JSON config file": "JSON config फाइल का पथ",
|
||||
"Show help": "सहायता दिखाएँ",
|
||||
"Show version number": "Version संख्या दिखाएँ",
|
||||
"Did you mean %s?": "क्या आपका मतलब है %s?",
|
||||
"Arguments %s and %s are mutually exclusive" : "तर्क %s और %s परस्पर अनन्य हैं",
|
||||
"Positionals:": "स्थानीय:",
|
||||
"command": "आदेश"
|
||||
}
|
39
backend/node_modules/yargs/locales/hu.json
generated
vendored
Normal file
39
backend/node_modules/yargs/locales/hu.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"Commands:": "Parancsok:",
|
||||
"Options:": "Opciók:",
|
||||
"Examples:": "Példák:",
|
||||
"boolean": "boolean",
|
||||
"count": "számláló",
|
||||
"string": "szöveg",
|
||||
"number": "szám",
|
||||
"array": "tömb",
|
||||
"required": "kötelező",
|
||||
"default:": "alapértelmezett:",
|
||||
"choices:": "lehetőségek:",
|
||||
"aliases:": "aliaszok:",
|
||||
"generated-value": "generált-érték",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "Nincs elég nem opcionális argumentum: %s van, legalább %s kell",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "Túl sok nem opciánlis argumentum van: %s van, maximum %s lehet",
|
||||
"Missing argument value: %s": {
|
||||
"one": "Hiányzó argumentum érték: %s",
|
||||
"other": "Hiányzó argumentum értékek: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Hiányzó kötelező argumentum: %s",
|
||||
"other": "Hiányzó kötelező argumentumok: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Ismeretlen argumentum: %s",
|
||||
"other": "Ismeretlen argumentumok: %s"
|
||||
},
|
||||
"Invalid values:": "Érvénytelen érték:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argumentum: %s, Megadott: %s, Lehetőségek: %s",
|
||||
"Argument check failed: %s": "Argumentum ellenőrzés sikertelen: %s",
|
||||
"Implications failed:": "Implikációk sikertelenek:",
|
||||
"Not enough arguments following: %s": "Nem elég argumentum követi: %s",
|
||||
"Invalid JSON config file: %s": "Érvénytelen JSON konfigurációs file: %s",
|
||||
"Path to JSON config file": "JSON konfigurációs file helye",
|
||||
"Show help": "Súgo megjelenítése",
|
||||
"Show version number": "Verziószám megjelenítése",
|
||||
"Did you mean %s?": "Erre gondoltál %s?"
|
||||
}
|
43
backend/node_modules/yargs/locales/id.json
generated
vendored
Normal file
43
backend/node_modules/yargs/locales/id.json
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
{
|
||||
"Commands:": "Perintah:",
|
||||
"Options:": "Pilihan:",
|
||||
"Examples:": "Contoh:",
|
||||
"boolean": "boolean",
|
||||
"count": "jumlah",
|
||||
"number": "nomor",
|
||||
"string": "string",
|
||||
"array": "larik",
|
||||
"required": "diperlukan",
|
||||
"default:": "bawaan:",
|
||||
"aliases:": "istilah lain:",
|
||||
"choices:": "pilihan:",
|
||||
"generated-value": "nilai-yang-dihasilkan",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "Argumen wajib kurang: hanya %s, minimal %s",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "Terlalu banyak argumen wajib: ada %s, maksimal %s",
|
||||
"Missing argument value: %s": {
|
||||
"one": "Kurang argumen: %s",
|
||||
"other": "Kurang argumen: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Kurang argumen wajib: %s",
|
||||
"other": "Kurang argumen wajib: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Argumen tak diketahui: %s",
|
||||
"other": "Argumen tak diketahui: %s"
|
||||
},
|
||||
"Invalid values:": "Nilai-nilai tidak valid:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argumen: %s, Diberikan: %s, Pilihan: %s",
|
||||
"Argument check failed: %s": "Pemeriksaan argument gagal: %s",
|
||||
"Implications failed:": "Implikasi gagal:",
|
||||
"Not enough arguments following: %s": "Kurang argumen untuk: %s",
|
||||
"Invalid JSON config file: %s": "Berkas konfigurasi JSON tidak valid: %s",
|
||||
"Path to JSON config file": "Alamat berkas konfigurasi JSON",
|
||||
"Show help": "Lihat bantuan",
|
||||
"Show version number": "Lihat nomor versi",
|
||||
"Did you mean %s?": "Maksud Anda: %s?",
|
||||
"Arguments %s and %s are mutually exclusive" : "Argumen %s dan %s saling eksklusif",
|
||||
"Positionals:": "Posisional-posisional:",
|
||||
"command": "perintah"
|
||||
}
|
39
backend/node_modules/yargs/locales/it.json
generated
vendored
Normal file
39
backend/node_modules/yargs/locales/it.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"Commands:": "Comandi:",
|
||||
"Options:": "Opzioni:",
|
||||
"Examples:": "Esempi:",
|
||||
"boolean": "booleano",
|
||||
"count": "contatore",
|
||||
"string": "stringa",
|
||||
"number": "numero",
|
||||
"array": "vettore",
|
||||
"required": "richiesto",
|
||||
"default:": "predefinito:",
|
||||
"choices:": "scelte:",
|
||||
"aliases:": "alias:",
|
||||
"generated-value": "valore generato",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "Numero insufficiente di argomenti non opzione: inseriti %s, richiesti almeno %s",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "Troppi argomenti non opzione: inseriti %s, massimo possibile %s",
|
||||
"Missing argument value: %s": {
|
||||
"one": "Argomento mancante: %s",
|
||||
"other": "Argomenti mancanti: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Argomento richiesto mancante: %s",
|
||||
"other": "Argomenti richiesti mancanti: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Argomento sconosciuto: %s",
|
||||
"other": "Argomenti sconosciuti: %s"
|
||||
},
|
||||
"Invalid values:": "Valori non validi:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argomento: %s, Richiesto: %s, Scelte: %s",
|
||||
"Argument check failed: %s": "Controllo dell'argomento fallito: %s",
|
||||
"Implications failed:": "Argomenti dipendenti mancanti:",
|
||||
"Not enough arguments following: %s": "Argomenti insufficienti dopo: %s",
|
||||
"Invalid JSON config file: %s": "File di configurazione JSON non valido: %s",
|
||||
"Path to JSON config file": "Percorso del file di configurazione JSON",
|
||||
"Show help": "Mostra la schermata di aiuto",
|
||||
"Show version number": "Mostra il numero di versione",
|
||||
"Did you mean %s?": "Intendi forse %s?"
|
||||
}
|
42
backend/node_modules/yargs/locales/ja.json
generated
vendored
Normal file
42
backend/node_modules/yargs/locales/ja.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"Commands:": "コマンド:",
|
||||
"Options:": "オプション:",
|
||||
"Examples:": "例:",
|
||||
"boolean": "真偽",
|
||||
"count": "カウント",
|
||||
"string": "文字列",
|
||||
"number": "数値",
|
||||
"array": "配列",
|
||||
"required": "必須",
|
||||
"default:": "デフォルト:",
|
||||
"choices:": "選択してください:",
|
||||
"aliases:": "エイリアス:",
|
||||
"generated-value": "生成された値",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:",
|
||||
"Missing argument value: %s": {
|
||||
"one": "引数が見つかりません: %s",
|
||||
"other": "引数が見つかりません: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "必須の引数が見つかりません: %s",
|
||||
"other": "必須の引数が見つかりません: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "未知の引数です: %s",
|
||||
"other": "未知の引数です: %s"
|
||||
},
|
||||
"Invalid values:": "不正な値です:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "引数は %s です。指定できるのは %s つです。選択してください: %s",
|
||||
"Argument check failed: %s": "引数のチェックに失敗しました: %s",
|
||||
"Implications failed:": "オプションの組み合わせで不正が生じました:",
|
||||
"Not enough arguments following: %s": "次の引数が不足しています。: %s",
|
||||
"Invalid JSON config file: %s": "JSONの設定ファイルが不正です: %s",
|
||||
"Path to JSON config file": "JSONの設定ファイルまでのpath",
|
||||
"Show help": "ヘルプを表示",
|
||||
"Show version number": "バージョンを表示",
|
||||
"Did you mean %s?": "もしかして %s?",
|
||||
"Arguments %s and %s are mutually exclusive" : "引数 %s と %s は同時に指定できません",
|
||||
"Positionals:": "位置:",
|
||||
"command": "コマンド"
|
||||
}
|
42
backend/node_modules/yargs/locales/ko.json
generated
vendored
Normal file
42
backend/node_modules/yargs/locales/ko.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"Commands:": "명령:",
|
||||
"Options:": "옵션:",
|
||||
"Examples:": "예시:",
|
||||
"boolean": "여부",
|
||||
"count": "개수",
|
||||
"string": "문자열",
|
||||
"number": "숫자",
|
||||
"array": "배열",
|
||||
"required": "필수",
|
||||
"default:": "기본:",
|
||||
"choices:": "선택:",
|
||||
"aliases:": "별칭:",
|
||||
"generated-value": "생성된 값",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "옵션이 아닌 인자가 충분치 않습니다: %s개를 받았지만, 적어도 %s개는 필요합니다",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "옵션이 아닌 인자가 너무 많습니다: %s개를 받았지만, %s개 이하여야 합니다",
|
||||
"Missing argument value: %s": {
|
||||
"one": "인자값을 받지 못했습니다: %s",
|
||||
"other": "인자값들을 받지 못했습니다: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "필수 인자를 받지 못했습니다: %s",
|
||||
"other": "필수 인자들을 받지 못했습니다: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "알 수 없는 인자입니다: %s",
|
||||
"other": "알 수 없는 인자들입니다: %s"
|
||||
},
|
||||
"Invalid values:": "잘못된 값입니다:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "인자: %s, 입력받은 값: %s, 선택지: %s",
|
||||
"Argument check failed: %s": "유효하지 않은 인자입니다: %s",
|
||||
"Implications failed:": "옵션의 조합이 잘못되었습니다:",
|
||||
"Not enough arguments following: %s": "인자가 충분하게 주어지지 않았습니다: %s",
|
||||
"Invalid JSON config file: %s": "유효하지 않은 JSON 설정파일입니다: %s",
|
||||
"Path to JSON config file": "JSON 설정파일 경로",
|
||||
"Show help": "도움말을 보여줍니다",
|
||||
"Show version number": "버전 넘버를 보여줍니다",
|
||||
"Did you mean %s?": "찾고계신게 %s입니까?",
|
||||
"Arguments %s and %s are mutually exclusive" : "%s와 %s 인자는 같이 사용될 수 없습니다",
|
||||
"Positionals:": "위치:",
|
||||
"command": "명령"
|
||||
}
|
37
backend/node_modules/yargs/locales/nb.json
generated
vendored
Normal file
37
backend/node_modules/yargs/locales/nb.json
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"Commands:": "Kommandoer:",
|
||||
"Options:": "Alternativer:",
|
||||
"Examples:": "Eksempler:",
|
||||
"boolean": "boolsk",
|
||||
"count": "antall",
|
||||
"string": "streng",
|
||||
"number": "nummer",
|
||||
"array": "matrise",
|
||||
"required": "obligatorisk",
|
||||
"default:": "standard:",
|
||||
"choices:": "valg:",
|
||||
"generated-value": "generert-verdi",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s",
|
||||
"Missing argument value: %s": {
|
||||
"one": "Mangler argument verdi: %s",
|
||||
"other": "Mangler argument verdier: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Mangler obligatorisk argument: %s",
|
||||
"other": "Mangler obligatoriske argumenter: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Ukjent argument: %s",
|
||||
"other": "Ukjente argumenter: %s"
|
||||
},
|
||||
"Invalid values:": "Ugyldige verdier:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gitt: %s, Valg: %s",
|
||||
"Argument check failed: %s": "Argumentsjekk mislyktes: %s",
|
||||
"Implications failed:": "Konsekvensene mislyktes:",
|
||||
"Not enough arguments following: %s": "Ikke nok følgende argumenter: %s",
|
||||
"Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s",
|
||||
"Path to JSON config file": "Bane til JSON konfigurasjonsfil",
|
||||
"Show help": "Vis hjelp",
|
||||
"Show version number": "Vis versjonsnummer"
|
||||
}
|
42
backend/node_modules/yargs/locales/nl.json
generated
vendored
Normal file
42
backend/node_modules/yargs/locales/nl.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"Commands:": "Commando's:",
|
||||
"Options:": "Opties:",
|
||||
"Examples:": "Voorbeelden:",
|
||||
"boolean": "booleaans",
|
||||
"count": "aantal",
|
||||
"string": "string",
|
||||
"number": "getal",
|
||||
"array": "lijst",
|
||||
"required": "verplicht",
|
||||
"default:": "standaard:",
|
||||
"choices:": "keuzes:",
|
||||
"aliases:": "aliassen:",
|
||||
"generated-value": "gegenereerde waarde",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "Niet genoeg niet-optie-argumenten: %s gekregen, minstens %s nodig",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "Te veel niet-optie-argumenten: %s gekregen, maximum is %s",
|
||||
"Missing argument value: %s": {
|
||||
"one": "Missende argumentwaarde: %s",
|
||||
"other": "Missende argumentwaarden: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Missend verplicht argument: %s",
|
||||
"other": "Missende verplichte argumenten: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Onbekend argument: %s",
|
||||
"other": "Onbekende argumenten: %s"
|
||||
},
|
||||
"Invalid values:": "Ongeldige waarden:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeven: %s, Keuzes: %s",
|
||||
"Argument check failed: %s": "Argumentcontrole mislukt: %s",
|
||||
"Implications failed:": "Ontbrekende afhankelijke argumenten:",
|
||||
"Not enough arguments following: %s": "Niet genoeg argumenten na: %s",
|
||||
"Invalid JSON config file: %s": "Ongeldig JSON-config-bestand: %s",
|
||||
"Path to JSON config file": "Pad naar JSON-config-bestand",
|
||||
"Show help": "Toon help",
|
||||
"Show version number": "Toon versienummer",
|
||||
"Did you mean %s?": "Bedoelde u misschien %s?",
|
||||
"Arguments %s and %s are mutually exclusive": "Argumenten %s en %s kunnen niet tegelijk gebruikt worden",
|
||||
"Positionals:": "Positie-afhankelijke argumenten",
|
||||
"command": "commando"
|
||||
}
|
39
backend/node_modules/yargs/locales/nn.json
generated
vendored
Normal file
39
backend/node_modules/yargs/locales/nn.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"Commands:": "Kommandoar:",
|
||||
"Options:": "Alternativ:",
|
||||
"Examples:": "Døme:",
|
||||
"boolean": "boolsk",
|
||||
"count": "mengd",
|
||||
"string": "streng",
|
||||
"number": "nummer",
|
||||
"array": "matrise",
|
||||
"required": "obligatorisk",
|
||||
"default:": "standard:",
|
||||
"choices:": "val:",
|
||||
"generated-value": "generert-verdi",
|
||||
"Not enough non-option arguments: got %s, need at least %s":
|
||||
"Ikkje nok ikkje-alternativ argument: fekk %s, treng minst %s",
|
||||
"Too many non-option arguments: got %s, maximum of %s":
|
||||
"For mange ikkje-alternativ argument: fekk %s, maksimum %s",
|
||||
"Missing argument value: %s": {
|
||||
"one": "Manglar argumentverdi: %s",
|
||||
"other": "Manglar argumentverdiar: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Manglar obligatorisk argument: %s",
|
||||
"other": "Manglar obligatoriske argument: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Ukjent argument: %s",
|
||||
"other": "Ukjende argument: %s"
|
||||
},
|
||||
"Invalid values:": "Ugyldige verdiar:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gjeve: %s, Val: %s",
|
||||
"Argument check failed: %s": "Argumentsjekk mislukkast: %s",
|
||||
"Implications failed:": "Konsekvensane mislukkast:",
|
||||
"Not enough arguments following: %s": "Ikkje nok fylgjande argument: %s",
|
||||
"Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s",
|
||||
"Path to JSON config file": "Bane til JSON konfigurasjonsfil",
|
||||
"Show help": "Vis hjelp",
|
||||
"Show version number": "Vis versjonsnummer"
|
||||
}
|
13
backend/node_modules/yargs/locales/pirate.json
generated
vendored
Normal file
13
backend/node_modules/yargs/locales/pirate.json
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"Commands:": "Choose yer command:",
|
||||
"Options:": "Options for me hearties!",
|
||||
"Examples:": "Ex. marks the spot:",
|
||||
"required": "requi-yar-ed",
|
||||
"Missing required argument: %s": {
|
||||
"one": "Ye be havin' to set the followin' argument land lubber: %s",
|
||||
"other": "Ye be havin' to set the followin' arguments land lubber: %s"
|
||||
},
|
||||
"Show help": "Parlay this here code of conduct",
|
||||
"Show version number": "'Tis the version ye be askin' fer",
|
||||
"Arguments %s and %s are mutually exclusive" : "Yon scurvy dogs %s and %s be as bad as rum and a prudish wench"
|
||||
}
|
42
backend/node_modules/yargs/locales/pl.json
generated
vendored
Normal file
42
backend/node_modules/yargs/locales/pl.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"Commands:": "Polecenia:",
|
||||
"Options:": "Opcje:",
|
||||
"Examples:": "Przykłady:",
|
||||
"boolean": "boolean",
|
||||
"count": "ilość",
|
||||
"string": "ciąg znaków",
|
||||
"number": "liczba",
|
||||
"array": "tablica",
|
||||
"required": "wymagany",
|
||||
"default:": "domyślny:",
|
||||
"choices:": "dostępne:",
|
||||
"aliases:": "aliasy:",
|
||||
"generated-value": "wygenerowana-wartość",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "Niewystarczająca ilość argumentów: otrzymano %s, wymagane co najmniej %s",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "Zbyt duża ilość argumentów: otrzymano %s, wymagane co najwyżej %s",
|
||||
"Missing argument value: %s": {
|
||||
"one": "Brak wartości dla argumentu: %s",
|
||||
"other": "Brak wartości dla argumentów: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Brak wymaganego argumentu: %s",
|
||||
"other": "Brak wymaganych argumentów: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Nieznany argument: %s",
|
||||
"other": "Nieznane argumenty: %s"
|
||||
},
|
||||
"Invalid values:": "Nieprawidłowe wartości:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Otrzymano: %s, Dostępne: %s",
|
||||
"Argument check failed: %s": "Weryfikacja argumentów nie powiodła się: %s",
|
||||
"Implications failed:": "Założenia nie zostały spełnione:",
|
||||
"Not enough arguments following: %s": "Niewystarczająca ilość argumentów następujących po: %s",
|
||||
"Invalid JSON config file: %s": "Nieprawidłowy plik konfiguracyjny JSON: %s",
|
||||
"Path to JSON config file": "Ścieżka do pliku konfiguracyjnego JSON",
|
||||
"Show help": "Pokaż pomoc",
|
||||
"Show version number": "Pokaż numer wersji",
|
||||
"Did you mean %s?": "Czy chodziło Ci o %s?",
|
||||
"Arguments %s and %s are mutually exclusive": "Argumenty %s i %s wzajemnie się wykluczają",
|
||||
"Positionals:": "Pozycyjne:",
|
||||
"command": "polecenie"
|
||||
}
|
38
backend/node_modules/yargs/locales/pt.json
generated
vendored
Normal file
38
backend/node_modules/yargs/locales/pt.json
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"Commands:": "Comandos:",
|
||||
"Options:": "Opções:",
|
||||
"Examples:": "Exemplos:",
|
||||
"boolean": "boolean",
|
||||
"count": "contagem",
|
||||
"string": "cadeia de caracteres",
|
||||
"number": "número",
|
||||
"array": "arranjo",
|
||||
"required": "requerido",
|
||||
"default:": "padrão:",
|
||||
"choices:": "escolhas:",
|
||||
"generated-value": "valor-gerado",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "Argumentos insuficientes não opcionais: Argumento %s, necessário pelo menos %s",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "Excesso de argumentos não opcionais: recebido %s, máximo de %s",
|
||||
"Missing argument value: %s": {
|
||||
"one": "Falta valor de argumento: %s",
|
||||
"other": "Falta valores de argumento: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Falta argumento obrigatório: %s",
|
||||
"other": "Faltando argumentos obrigatórios: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Argumento desconhecido: %s",
|
||||
"other": "Argumentos desconhecidos: %s"
|
||||
},
|
||||
"Invalid values:": "Valores inválidos:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Escolhas: %s",
|
||||
"Argument check failed: %s": "Verificação de argumento falhou: %s",
|
||||
"Implications failed:": "Implicações falharam:",
|
||||
"Not enough arguments following: %s": "Insuficientes argumentos a seguir: %s",
|
||||
"Invalid JSON config file: %s": "Arquivo de configuração em JSON esta inválido: %s",
|
||||
"Path to JSON config file": "Caminho para o arquivo de configuração em JSON",
|
||||
"Show help": "Mostra ajuda",
|
||||
"Show version number": "Mostra número de versão",
|
||||
"Arguments %s and %s are mutually exclusive" : "Argumentos %s e %s são mutualmente exclusivos"
|
||||
}
|
42
backend/node_modules/yargs/locales/pt_BR.json
generated
vendored
Normal file
42
backend/node_modules/yargs/locales/pt_BR.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"Commands:": "Comandos:",
|
||||
"Options:": "Opções:",
|
||||
"Examples:": "Exemplos:",
|
||||
"boolean": "booleano",
|
||||
"count": "contagem",
|
||||
"string": "string",
|
||||
"number": "número",
|
||||
"array": "array",
|
||||
"required": "obrigatório",
|
||||
"default:": "padrão:",
|
||||
"choices:": "opções:",
|
||||
"aliases:": "sinônimos:",
|
||||
"generated-value": "valor-gerado",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "Argumentos insuficientes: Argumento %s, necessário pelo menos %s",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "Excesso de argumentos: recebido %s, máximo de %s",
|
||||
"Missing argument value: %s": {
|
||||
"one": "Falta valor de argumento: %s",
|
||||
"other": "Falta valores de argumento: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Falta argumento obrigatório: %s",
|
||||
"other": "Faltando argumentos obrigatórios: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Argumento desconhecido: %s",
|
||||
"other": "Argumentos desconhecidos: %s"
|
||||
},
|
||||
"Invalid values:": "Valores inválidos:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Opções: %s",
|
||||
"Argument check failed: %s": "Verificação de argumento falhou: %s",
|
||||
"Implications failed:": "Implicações falharam:",
|
||||
"Not enough arguments following: %s": "Argumentos insuficientes a seguir: %s",
|
||||
"Invalid JSON config file: %s": "Arquivo JSON de configuração inválido: %s",
|
||||
"Path to JSON config file": "Caminho para o arquivo JSON de configuração",
|
||||
"Show help": "Exibe ajuda",
|
||||
"Show version number": "Exibe a versão",
|
||||
"Did you mean %s?": "Você quis dizer %s?",
|
||||
"Arguments %s and %s are mutually exclusive" : "Argumentos %s e %s são mutualmente exclusivos",
|
||||
"Positionals:": "Posicionais:",
|
||||
"command": "comando"
|
||||
}
|
39
backend/node_modules/yargs/locales/ru.json
generated
vendored
Normal file
39
backend/node_modules/yargs/locales/ru.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"Commands:": "Команды:",
|
||||
"Options:": "Опции:",
|
||||
"Examples:": "Примеры:",
|
||||
"boolean": "булевый тип",
|
||||
"count": "подсчет",
|
||||
"string": "строковой тип",
|
||||
"number": "число",
|
||||
"array": "массив",
|
||||
"required": "необходимо",
|
||||
"default:": "по умолчанию:",
|
||||
"choices:": "возможности:",
|
||||
"aliases:": "алиасы:",
|
||||
"generated-value": "генерированное значение",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "Недостаточно неопционных аргументов: есть %s, нужно как минимум %s",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "Слишком много неопционных аргументов: есть %s, максимум допустимо %s",
|
||||
"Missing argument value: %s": {
|
||||
"one": "Не хватает значения аргумента: %s",
|
||||
"other": "Не хватает значений аргументов: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Не хватает необходимого аргумента: %s",
|
||||
"other": "Не хватает необходимых аргументов: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Неизвестный аргумент: %s",
|
||||
"other": "Неизвестные аргументы: %s"
|
||||
},
|
||||
"Invalid values:": "Недействительные значения:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Аргумент: %s, Данное значение: %s, Возможности: %s",
|
||||
"Argument check failed: %s": "Проверка аргументов не удалась: %s",
|
||||
"Implications failed:": "Данный аргумент требует следующий дополнительный аргумент:",
|
||||
"Not enough arguments following: %s": "Недостаточно следующих аргументов: %s",
|
||||
"Invalid JSON config file: %s": "Недействительный файл конфигурации JSON: %s",
|
||||
"Path to JSON config file": "Путь к файлу конфигурации JSON",
|
||||
"Show help": "Показать помощь",
|
||||
"Show version number": "Показать номер версии",
|
||||
"Did you mean %s?": "Вы имели в виду %s?"
|
||||
}
|
39
backend/node_modules/yargs/locales/th.json
generated
vendored
Normal file
39
backend/node_modules/yargs/locales/th.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"Commands:": "คอมมาน",
|
||||
"Options:": "ออฟชั่น",
|
||||
"Examples:": "ตัวอย่าง",
|
||||
"boolean": "บูลีน",
|
||||
"count": "นับ",
|
||||
"string": "สตริง",
|
||||
"number": "ตัวเลข",
|
||||
"array": "อาเรย์",
|
||||
"required": "จำเป็น",
|
||||
"default:": "ค่าเริ่มต้น",
|
||||
"choices:": "ตัวเลือก",
|
||||
"aliases:": "เอเลียส",
|
||||
"generated-value": "ค่าที่ถูกสร้างขึ้น",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "ใส่อาร์กิวเมนต์ไม่ครบตามจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการอย่างน้อย %s ค่า",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "ใส่อาร์กิวเมนต์เกินจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการมากที่สุด %s ค่า",
|
||||
"Missing argument value: %s": {
|
||||
"one": "ค่าอาร์กิวเมนต์ที่ขาดไป: %s",
|
||||
"other": "ค่าอาร์กิวเมนต์ที่ขาดไป: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "อาร์กิวเมนต์จำเป็นที่ขาดไป: %s",
|
||||
"other": "อาร์กิวเมนต์จำเป็นที่ขาดไป: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "อาร์กิวเมนต์ที่ไม่รู้จัก: %s",
|
||||
"other": "อาร์กิวเมนต์ที่ไม่รู้จัก: %s"
|
||||
},
|
||||
"Invalid values:": "ค่าไม่ถูกต้อง:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "อาร์กิวเมนต์: %s, ได้รับ: %s, ตัวเลือก: %s",
|
||||
"Argument check failed: %s": "ตรวจสอบพบอาร์กิวเมนต์ที่ไม่ถูกต้อง: %s",
|
||||
"Implications failed:": "Implications ไม่สำเร็จ:",
|
||||
"Not enough arguments following: %s": "ใส่อาร์กิวเมนต์ไม่ครบ: %s",
|
||||
"Invalid JSON config file: %s": "ไฟล์คอนฟิค JSON ไม่ถูกต้อง: %s",
|
||||
"Path to JSON config file": "พาทไฟล์คอนฟิค JSON",
|
||||
"Show help": "ขอความช่วยเหลือ",
|
||||
"Show version number": "แสดงตัวเลขเวอร์ชั่น",
|
||||
"Did you mean %s?": "คุณหมายถึง %s?"
|
||||
}
|
41
backend/node_modules/yargs/locales/tr.json
generated
vendored
Normal file
41
backend/node_modules/yargs/locales/tr.json
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"Commands:": "Komutlar:",
|
||||
"Options:": "Seçenekler:",
|
||||
"Examples:": "Örnekler:",
|
||||
"boolean": "boolean",
|
||||
"count": "sayı",
|
||||
"string": "string",
|
||||
"number": "numara",
|
||||
"array": "array",
|
||||
"required": "zorunlu",
|
||||
"default:": "varsayılan:",
|
||||
"choices:": "seçimler:",
|
||||
"aliases:": "takma adlar:",
|
||||
"generated-value": "oluşturulan-değer",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "Seçenek dışı argümanlar yetersiz: %s bulundu, %s gerekli",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "Seçenek dışı argümanlar gereğinden fazla: %s bulundu, azami %s",
|
||||
"Missing argument value: %s": {
|
||||
"one": "Eksik argüman değeri: %s",
|
||||
"other": "Eksik argüman değerleri: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Eksik zorunlu argüman: %s",
|
||||
"other": "Eksik zorunlu argümanlar: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Bilinmeyen argüman: %s",
|
||||
"other": "Bilinmeyen argümanlar: %s"
|
||||
},
|
||||
"Invalid values:": "Geçersiz değerler:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argüman: %s, Verilen: %s, Seçimler: %s",
|
||||
"Argument check failed: %s": "Argüman kontrolü başarısız oldu: %s",
|
||||
"Implications failed:": "Sonuçlar başarısız oldu:",
|
||||
"Not enough arguments following: %s": "%s için yeterli argüman bulunamadı",
|
||||
"Invalid JSON config file: %s": "Geçersiz JSON yapılandırma dosyası: %s",
|
||||
"Path to JSON config file": "JSON yapılandırma dosya konumu",
|
||||
"Show help": "Yardım detaylarını göster",
|
||||
"Show version number": "Versiyon detaylarını göster",
|
||||
"Did you mean %s?": "Bunu mu demek istediniz: %s?",
|
||||
"Positionals:": "Sıralılar:",
|
||||
"command": "komut"
|
||||
}
|
41
backend/node_modules/yargs/locales/zh_CN.json
generated
vendored
Normal file
41
backend/node_modules/yargs/locales/zh_CN.json
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"Commands:": "命令:",
|
||||
"Options:": "选项:",
|
||||
"Examples:": "示例:",
|
||||
"boolean": "布尔",
|
||||
"count": "计数",
|
||||
"string": "字符串",
|
||||
"number": "数字",
|
||||
"array": "数组",
|
||||
"required": "必需",
|
||||
"default:": "默认值:",
|
||||
"choices:": "可选值:",
|
||||
"generated-value": "生成的值",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "缺少 non-option 参数:传入了 %s 个, 至少需要 %s 个",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "non-option 参数过多:传入了 %s 个, 最大允许 %s 个",
|
||||
"Missing argument value: %s": {
|
||||
"one": "没有给此选项指定值:%s",
|
||||
"other": "没有给这些选项指定值:%s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "缺少必须的选项:%s",
|
||||
"other": "缺少这些必须的选项:%s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "无法识别的选项:%s",
|
||||
"other": "无法识别这些选项:%s"
|
||||
},
|
||||
"Invalid values:": "无效的选项值:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "选项名称: %s, 传入的值: %s, 可选的值:%s",
|
||||
"Argument check failed: %s": "选项值验证失败:%s",
|
||||
"Implications failed:": "缺少依赖的选项:",
|
||||
"Not enough arguments following: %s": "没有提供足够的值给此选项:%s",
|
||||
"Invalid JSON config file: %s": "无效的 JSON 配置文件:%s",
|
||||
"Path to JSON config file": "JSON 配置文件的路径",
|
||||
"Show help": "显示帮助信息",
|
||||
"Show version number": "显示版本号",
|
||||
"Did you mean %s?": "是指 %s?",
|
||||
"Arguments %s and %s are mutually exclusive" : "选项 %s 和 %s 是互斥的",
|
||||
"Positionals:": "位置:",
|
||||
"command": "命令"
|
||||
}
|
40
backend/node_modules/yargs/locales/zh_TW.json
generated
vendored
Normal file
40
backend/node_modules/yargs/locales/zh_TW.json
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"Commands:": "命令:",
|
||||
"Options:": "選項:",
|
||||
"Examples:": "例:",
|
||||
"boolean": "布林",
|
||||
"count": "次數",
|
||||
"string": "字串",
|
||||
"number": "數字",
|
||||
"array": "陣列",
|
||||
"required": "必須",
|
||||
"default:": "預設值:",
|
||||
"choices:": "可選值:",
|
||||
"aliases:": "別名:",
|
||||
"generated-value": "生成的值",
|
||||
"Not enough non-option arguments: got %s, need at least %s": "non-option 引數不足:只傳入了 %s 個, 至少要 %s 個",
|
||||
"Too many non-option arguments: got %s, maximum of %s": "non-option 引數過多:傳入了 %s 個, 但最多 %s 個",
|
||||
"Missing argument value: %s": {
|
||||
"one": "此引數無指定值:%s",
|
||||
"other": "這些引數無指定值:%s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "缺少必須的引數:%s",
|
||||
"other": "缺少這些必須的引數:%s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "未知的引數:%s",
|
||||
"other": "未知的這些引數:%s"
|
||||
},
|
||||
"Invalid values:": "無效的選項值:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "引數名稱: %s, 傳入的值: %s, 可選的值:%s",
|
||||
"Argument check failed: %s": "引數驗證失敗:%s",
|
||||
"Implications failed:": "缺少依賴的選項:",
|
||||
"Not enough arguments following: %s": "沒有提供足夠的值給此引數:%s",
|
||||
"Invalid JSON config file: %s": "無效的 JSON 設置文件:%s",
|
||||
"Path to JSON config file": "JSON 設置文件的路徑",
|
||||
"Show help": "顯示說明",
|
||||
"Show version number": "顯示版本",
|
||||
"Did you mean %s?": "是指 %s?",
|
||||
"Arguments %s and %s are mutually exclusive" : "引數 %s 和 %s 是互斥的"
|
||||
}
|
14
backend/node_modules/yargs/node_modules/ansi-regex/index.js
generated
vendored
Normal file
14
backend/node_modules/yargs/node_modules/ansi-regex/index.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = options => {
|
||||
options = Object.assign({
|
||||
onlyFirst: false
|
||||
}, options);
|
||||
|
||||
const pattern = [
|
||||
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
|
||||
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
|
||||
].join('|');
|
||||
|
||||
return new RegExp(pattern, options.onlyFirst ? undefined : 'g');
|
||||
};
|
9
backend/node_modules/yargs/node_modules/ansi-regex/license
generated
vendored
Normal file
9
backend/node_modules/yargs/node_modules/ansi-regex/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
53
backend/node_modules/yargs/node_modules/ansi-regex/package.json
generated
vendored
Normal file
53
backend/node_modules/yargs/node_modules/ansi-regex/package.json
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"name": "ansi-regex",
|
||||
"version": "4.1.1",
|
||||
"description": "Regular expression for matching ANSI escape codes",
|
||||
"license": "MIT",
|
||||
"repository": "chalk/ansi-regex",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava",
|
||||
"view-supported": "node fixtures/view-codes.js"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"styles",
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"string",
|
||||
"tty",
|
||||
"escape",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"command-line",
|
||||
"text",
|
||||
"regex",
|
||||
"regexp",
|
||||
"re",
|
||||
"match",
|
||||
"test",
|
||||
"find",
|
||||
"pattern"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^0.25.0",
|
||||
"xo": "^0.23.0"
|
||||
}
|
||||
}
|
87
backend/node_modules/yargs/node_modules/ansi-regex/readme.md
generated
vendored
Normal file
87
backend/node_modules/yargs/node_modules/ansi-regex/readme.md
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
# ansi-regex [](https://travis-ci.org/chalk/ansi-regex)
|
||||
|
||||
> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-ansi-regex?utm_source=npm-ansi-regex&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install ansi-regex
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const ansiRegex = require('ansi-regex');
|
||||
|
||||
ansiRegex().test('\u001B[4mcake\u001B[0m');
|
||||
//=> true
|
||||
|
||||
ansiRegex().test('cake');
|
||||
//=> false
|
||||
|
||||
'\u001B[4mcake\u001B[0m'.match(ansiRegex());
|
||||
//=> ['\u001B[4m', '\u001B[0m']
|
||||
|
||||
'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
|
||||
//=> ['\u001B[4m']
|
||||
|
||||
'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
|
||||
//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### ansiRegex([options])
|
||||
|
||||
Returns a regex for matching ANSI escape codes.
|
||||
|
||||
#### options
|
||||
|
||||
##### onlyFirst
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false` *(Matches any ANSI escape codes in a string)*
|
||||
|
||||
Match only the first ANSI escape.
|
||||
|
||||
|
||||
## FAQ
|
||||
|
||||
### Why do you test for codes not in the ECMA 48 standard?
|
||||
|
||||
Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them.
|
||||
|
||||
On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.
|
||||
|
||||
|
||||
## Security
|
||||
|
||||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
63
backend/node_modules/yargs/node_modules/camelcase/index.d.ts
generated
vendored
Normal file
63
backend/node_modules/yargs/node_modules/camelcase/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
declare namespace camelcase {
|
||||
interface Options {
|
||||
/**
|
||||
Uppercase the first character: `foo-bar` → `FooBar`.
|
||||
|
||||
@default false
|
||||
*/
|
||||
readonly pascalCase?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare const camelcase: {
|
||||
/**
|
||||
Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`.
|
||||
|
||||
@param input - String to convert to camel case.
|
||||
|
||||
@example
|
||||
```
|
||||
import camelCase = require('camelcase');
|
||||
|
||||
camelCase('foo-bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('foo_bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('Foo-Bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('Foo-Bar', {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
|
||||
camelCase('--foo.bar', {pascalCase: false});
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('foo bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
console.log(process.argv[3]);
|
||||
//=> '--foo-bar'
|
||||
camelCase(process.argv[3]);
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase(['foo', 'bar']);
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase(['__foo__', '--bar'], {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
```
|
||||
*/
|
||||
(input: string | ReadonlyArray<string>, options?: camelcase.Options): string;
|
||||
|
||||
// TODO: Remove this for the next major release, refactor the whole definition to:
|
||||
// declare function camelcase(
|
||||
// input: string | ReadonlyArray<string>,
|
||||
// options?: camelcase.Options
|
||||
// ): string;
|
||||
// export = camelcase;
|
||||
default: typeof camelcase;
|
||||
};
|
||||
|
||||
export = camelcase;
|
76
backend/node_modules/yargs/node_modules/camelcase/index.js
generated
vendored
Normal file
76
backend/node_modules/yargs/node_modules/camelcase/index.js
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
'use strict';
|
||||
|
||||
const preserveCamelCase = string => {
|
||||
let isLastCharLower = false;
|
||||
let isLastCharUpper = false;
|
||||
let isLastLastCharUpper = false;
|
||||
|
||||
for (let i = 0; i < string.length; i++) {
|
||||
const character = string[i];
|
||||
|
||||
if (isLastCharLower && /[a-zA-Z]/.test(character) && character.toUpperCase() === character) {
|
||||
string = string.slice(0, i) + '-' + string.slice(i);
|
||||
isLastCharLower = false;
|
||||
isLastLastCharUpper = isLastCharUpper;
|
||||
isLastCharUpper = true;
|
||||
i++;
|
||||
} else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(character) && character.toLowerCase() === character) {
|
||||
string = string.slice(0, i - 1) + '-' + string.slice(i - 1);
|
||||
isLastLastCharUpper = isLastCharUpper;
|
||||
isLastCharUpper = false;
|
||||
isLastCharLower = true;
|
||||
} else {
|
||||
isLastCharLower = character.toLowerCase() === character && character.toUpperCase() !== character;
|
||||
isLastLastCharUpper = isLastCharUpper;
|
||||
isLastCharUpper = character.toUpperCase() === character && character.toLowerCase() !== character;
|
||||
}
|
||||
}
|
||||
|
||||
return string;
|
||||
};
|
||||
|
||||
const camelCase = (input, options) => {
|
||||
if (!(typeof input === 'string' || Array.isArray(input))) {
|
||||
throw new TypeError('Expected the input to be `string | string[]`');
|
||||
}
|
||||
|
||||
options = Object.assign({
|
||||
pascalCase: false
|
||||
}, options);
|
||||
|
||||
const postProcess = x => options.pascalCase ? x.charAt(0).toUpperCase() + x.slice(1) : x;
|
||||
|
||||
if (Array.isArray(input)) {
|
||||
input = input.map(x => x.trim())
|
||||
.filter(x => x.length)
|
||||
.join('-');
|
||||
} else {
|
||||
input = input.trim();
|
||||
}
|
||||
|
||||
if (input.length === 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (input.length === 1) {
|
||||
return options.pascalCase ? input.toUpperCase() : input.toLowerCase();
|
||||
}
|
||||
|
||||
const hasUpperCase = input !== input.toLowerCase();
|
||||
|
||||
if (hasUpperCase) {
|
||||
input = preserveCamelCase(input);
|
||||
}
|
||||
|
||||
input = input
|
||||
.replace(/^[_.\- ]+/, '')
|
||||
.toLowerCase()
|
||||
.replace(/[_.\- ]+(\w|$)/g, (_, p1) => p1.toUpperCase())
|
||||
.replace(/\d+(\w|$)/g, m => m.toUpperCase());
|
||||
|
||||
return postProcess(input);
|
||||
};
|
||||
|
||||
module.exports = camelCase;
|
||||
// TODO: Remove this for the next major release
|
||||
module.exports.default = camelCase;
|
9
backend/node_modules/yargs/node_modules/camelcase/license
generated
vendored
Normal file
9
backend/node_modules/yargs/node_modules/camelcase/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
43
backend/node_modules/yargs/node_modules/camelcase/package.json
generated
vendored
Normal file
43
backend/node_modules/yargs/node_modules/camelcase/package.json
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "camelcase",
|
||||
"version": "5.3.1",
|
||||
"description": "Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/camelcase",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"camelcase",
|
||||
"camel-case",
|
||||
"camel",
|
||||
"case",
|
||||
"dash",
|
||||
"hyphen",
|
||||
"dot",
|
||||
"underscore",
|
||||
"separator",
|
||||
"string",
|
||||
"text",
|
||||
"convert",
|
||||
"pascalcase",
|
||||
"pascal-case"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.1",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
99
backend/node_modules/yargs/node_modules/camelcase/readme.md
generated
vendored
Normal file
99
backend/node_modules/yargs/node_modules/camelcase/readme.md
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
# camelcase [](https://travis-ci.org/sindresorhus/camelcase)
|
||||
|
||||
> Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-camelcase?utm_source=npm-camelcase&utm_medium=referral&utm_campaign=readme">Get professional support for 'camelcase' with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install camelcase
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const camelCase = require('camelcase');
|
||||
|
||||
camelCase('foo-bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('foo_bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('Foo-Bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('Foo-Bar', {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
|
||||
camelCase('--foo.bar', {pascalCase: false});
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('foo bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
console.log(process.argv[3]);
|
||||
//=> '--foo-bar'
|
||||
camelCase(process.argv[3]);
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase(['foo', 'bar']);
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase(['__foo__', '--bar'], {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### camelCase(input, [options])
|
||||
|
||||
#### input
|
||||
|
||||
Type: `string` `string[]`
|
||||
|
||||
String to convert to camel case.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### pascalCase
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
Uppercase the first character: `foo-bar` → `FooBar`
|
||||
|
||||
|
||||
## Security
|
||||
|
||||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module
|
||||
- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase
|
||||
- [titleize](https://github.com/sindresorhus/titleize) - Capitalize every word in string
|
||||
- [humanize-string](https://github.com/sindresorhus/humanize-string) - Convert a camelized/dasherized/underscored string into a humanized one
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
13
backend/node_modules/yargs/node_modules/decamelize/index.js
generated
vendored
Normal file
13
backend/node_modules/yargs/node_modules/decamelize/index.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
module.exports = function (str, sep) {
|
||||
if (typeof str !== 'string') {
|
||||
throw new TypeError('Expected a string');
|
||||
}
|
||||
|
||||
sep = typeof sep === 'undefined' ? '_' : sep;
|
||||
|
||||
return str
|
||||
.replace(/([a-z\d])([A-Z])/g, '$1' + sep + '$2')
|
||||
.replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + sep + '$2')
|
||||
.toLowerCase();
|
||||
};
|
21
backend/node_modules/yargs/node_modules/decamelize/license
generated
vendored
Normal file
21
backend/node_modules/yargs/node_modules/decamelize/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
38
backend/node_modules/yargs/node_modules/decamelize/package.json
generated
vendored
Normal file
38
backend/node_modules/yargs/node_modules/decamelize/package.json
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "decamelize",
|
||||
"version": "1.2.0",
|
||||
"description": "Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/decamelize",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"decamelize",
|
||||
"decamelcase",
|
||||
"camelcase",
|
||||
"lowercase",
|
||||
"case",
|
||||
"dash",
|
||||
"hyphen",
|
||||
"string",
|
||||
"str",
|
||||
"text",
|
||||
"convert"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
48
backend/node_modules/yargs/node_modules/decamelize/readme.md
generated
vendored
Normal file
48
backend/node_modules/yargs/node_modules/decamelize/readme.md
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
# decamelize [](https://travis-ci.org/sindresorhus/decamelize)
|
||||
|
||||
> Convert a camelized string into a lowercased one with a custom separator<br>
|
||||
> Example: `unicornRainbow` → `unicorn_rainbow`
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save decamelize
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const decamelize = require('decamelize');
|
||||
|
||||
decamelize('unicornRainbow');
|
||||
//=> 'unicorn_rainbow'
|
||||
|
||||
decamelize('unicornRainbow', '-');
|
||||
//=> 'unicorn-rainbow'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### decamelize(input, [separator])
|
||||
|
||||
#### input
|
||||
|
||||
Type: `string`
|
||||
|
||||
#### separator
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `_`
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
See [`camelcase`](https://github.com/sindresorhus/camelcase) for the inverse.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
20
backend/node_modules/yargs/node_modules/emoji-regex/LICENSE-MIT.txt
generated
vendored
Normal file
20
backend/node_modules/yargs/node_modules/emoji-regex/LICENSE-MIT.txt
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
Copyright Mathias Bynens <https://mathiasbynens.be/>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
73
backend/node_modules/yargs/node_modules/emoji-regex/README.md
generated
vendored
Normal file
73
backend/node_modules/yargs/node_modules/emoji-regex/README.md
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
# emoji-regex [](https://travis-ci.org/mathiasbynens/emoji-regex)
|
||||
|
||||
_emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard.
|
||||
|
||||
This repository contains a script that generates this regular expression based on [the data from Unicode Technical Report #51](https://github.com/mathiasbynens/unicode-tr51). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard.
|
||||
|
||||
## Installation
|
||||
|
||||
Via [npm](https://www.npmjs.com/):
|
||||
|
||||
```bash
|
||||
npm install emoji-regex
|
||||
```
|
||||
|
||||
In [Node.js](https://nodejs.org/):
|
||||
|
||||
```js
|
||||
const emojiRegex = require('emoji-regex');
|
||||
// Note: because the regular expression has the global flag set, this module
|
||||
// exports a function that returns the regex rather than exporting the regular
|
||||
// expression itself, to make it impossible to (accidentally) mutate the
|
||||
// original regular expression.
|
||||
|
||||
const text = `
|
||||
\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation)
|
||||
\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji
|
||||
\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base)
|
||||
\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier
|
||||
`;
|
||||
|
||||
const regex = emojiRegex();
|
||||
let match;
|
||||
while (match = regex.exec(text)) {
|
||||
const emoji = match[0];
|
||||
console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`);
|
||||
}
|
||||
```
|
||||
|
||||
Console output:
|
||||
|
||||
```
|
||||
Matched sequence ⌚ — code points: 1
|
||||
Matched sequence ⌚ — code points: 1
|
||||
Matched sequence ↔️ — code points: 2
|
||||
Matched sequence ↔️ — code points: 2
|
||||
Matched sequence 👩 — code points: 1
|
||||
Matched sequence 👩 — code points: 1
|
||||
Matched sequence 👩🏿 — code points: 2
|
||||
Matched sequence 👩🏿 — code points: 2
|
||||
```
|
||||
|
||||
To match emoji in their textual representation as well (i.e. emoji that are not `Emoji_Presentation` symbols and that aren’t forced to render as emoji by a variation selector), `require` the other regex:
|
||||
|
||||
```js
|
||||
const emojiRegex = require('emoji-regex/text.js');
|
||||
```
|
||||
|
||||
Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes:
|
||||
|
||||
```js
|
||||
const emojiRegex = require('emoji-regex/es2015/index.js');
|
||||
const emojiRegexText = require('emoji-regex/es2015/text.js');
|
||||
```
|
||||
|
||||
## Author
|
||||
|
||||
| [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||
|---|
|
||||
| [Mathias Bynens](https://mathiasbynens.be/) |
|
||||
|
||||
## License
|
||||
|
||||
_emoji-regex_ is available under the [MIT](https://mths.be/mit) license.
|
6
backend/node_modules/yargs/node_modules/emoji-regex/es2015/index.js
generated
vendored
Normal file
6
backend/node_modules/yargs/node_modules/emoji-regex/es2015/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
6
backend/node_modules/yargs/node_modules/emoji-regex/es2015/text.js
generated
vendored
Normal file
6
backend/node_modules/yargs/node_modules/emoji-regex/es2015/text.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
backend/node_modules/yargs/node_modules/emoji-regex/index.d.ts
generated
vendored
Normal file
5
backend/node_modules/yargs/node_modules/emoji-regex/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
declare module 'emoji-regex' {
|
||||
function emojiRegex(): RegExp;
|
||||
|
||||
export default emojiRegex;
|
||||
}
|
6
backend/node_modules/yargs/node_modules/emoji-regex/index.js
generated
vendored
Normal file
6
backend/node_modules/yargs/node_modules/emoji-regex/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
51
backend/node_modules/yargs/node_modules/emoji-regex/package.json
generated
vendored
Normal file
51
backend/node_modules/yargs/node_modules/emoji-regex/package.json
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "emoji-regex",
|
||||
"version": "7.0.3",
|
||||
"description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.",
|
||||
"homepage": "https://mths.be/emoji-regex",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"keywords": [
|
||||
"unicode",
|
||||
"regex",
|
||||
"regexp",
|
||||
"regular expressions",
|
||||
"code points",
|
||||
"symbols",
|
||||
"characters",
|
||||
"emoji"
|
||||
],
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
"name": "Mathias Bynens",
|
||||
"url": "https://mathiasbynens.be/"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mathiasbynens/emoji-regex.git"
|
||||
},
|
||||
"bugs": "https://github.com/mathiasbynens/emoji-regex/issues",
|
||||
"files": [
|
||||
"LICENSE-MIT.txt",
|
||||
"index.js",
|
||||
"index.d.ts",
|
||||
"text.js",
|
||||
"es2015/index.js",
|
||||
"es2015/text.js"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src -d ./es2015; node script/inject-sequences.js",
|
||||
"test": "mocha",
|
||||
"test:watch": "npm run test -- --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.0.0",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/plugin-proposal-unicode-property-regex": "^7.0.0",
|
||||
"@babel/preset-env": "^7.0.0",
|
||||
"mocha": "^5.2.0",
|
||||
"regexgen": "^1.3.0",
|
||||
"unicode-11.0.0": "^0.7.7",
|
||||
"unicode-tr51": "^9.0.1"
|
||||
}
|
||||
}
|
6
backend/node_modules/yargs/node_modules/emoji-regex/text.js
generated
vendored
Normal file
6
backend/node_modules/yargs/node_modules/emoji-regex/text.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
46
backend/node_modules/yargs/node_modules/find-up/index.js
generated
vendored
Normal file
46
backend/node_modules/yargs/node_modules/find-up/index.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const locatePath = require('locate-path');
|
||||
|
||||
module.exports = (filename, opts = {}) => {
|
||||
const startDir = path.resolve(opts.cwd || '');
|
||||
const {root} = path.parse(startDir);
|
||||
|
||||
const filenames = [].concat(filename);
|
||||
|
||||
return new Promise(resolve => {
|
||||
(function find(dir) {
|
||||
locatePath(filenames, {cwd: dir}).then(file => {
|
||||
if (file) {
|
||||
resolve(path.join(dir, file));
|
||||
} else if (dir === root) {
|
||||
resolve(null);
|
||||
} else {
|
||||
find(path.dirname(dir));
|
||||
}
|
||||
});
|
||||
})(startDir);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.sync = (filename, opts = {}) => {
|
||||
let dir = path.resolve(opts.cwd || '');
|
||||
const {root} = path.parse(dir);
|
||||
|
||||
const filenames = [].concat(filename);
|
||||
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
while (true) {
|
||||
const file = locatePath.sync(filenames, {cwd: dir});
|
||||
|
||||
if (file) {
|
||||
return path.join(dir, file);
|
||||
}
|
||||
|
||||
if (dir === root) {
|
||||
return null;
|
||||
}
|
||||
|
||||
dir = path.dirname(dir);
|
||||
}
|
||||
};
|
9
backend/node_modules/yargs/node_modules/find-up/license
generated
vendored
Normal file
9
backend/node_modules/yargs/node_modules/find-up/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
50
backend/node_modules/yargs/node_modules/find-up/package.json
generated
vendored
Normal file
50
backend/node_modules/yargs/node_modules/find-up/package.json
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"name": "find-up",
|
||||
"version": "3.0.0",
|
||||
"description": "Find a file or directory by walking up parent directories",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/find-up",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"find",
|
||||
"up",
|
||||
"find-up",
|
||||
"findup",
|
||||
"look-up",
|
||||
"look",
|
||||
"file",
|
||||
"search",
|
||||
"match",
|
||||
"package",
|
||||
"resolve",
|
||||
"parent",
|
||||
"parents",
|
||||
"folder",
|
||||
"directory",
|
||||
"dir",
|
||||
"walk",
|
||||
"walking",
|
||||
"path"
|
||||
],
|
||||
"dependencies": {
|
||||
"locate-path": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"tempy": "^0.2.1",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
87
backend/node_modules/yargs/node_modules/find-up/readme.md
generated
vendored
Normal file
87
backend/node_modules/yargs/node_modules/find-up/readme.md
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
# find-up [](https://travis-ci.org/sindresorhus/find-up) [](https://ci.appveyor.com/project/sindresorhus/find-up/branch/master)
|
||||
|
||||
> Find a file or directory by walking up parent directories
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install find-up
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
/
|
||||
└── Users
|
||||
└── sindresorhus
|
||||
├── unicorn.png
|
||||
└── foo
|
||||
└── bar
|
||||
├── baz
|
||||
└── example.js
|
||||
```
|
||||
|
||||
`example.js`
|
||||
|
||||
```js
|
||||
const findUp = require('find-up');
|
||||
|
||||
(async () => {
|
||||
console.log(await findUp('unicorn.png'));
|
||||
//=> '/Users/sindresorhus/unicorn.png'
|
||||
|
||||
console.log(await findUp(['rainbow.png', 'unicorn.png']));
|
||||
//=> '/Users/sindresorhus/unicorn.png'
|
||||
})();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### findUp(filename, [options])
|
||||
|
||||
Returns a `Promise` for either the filepath or `null` if it couldn't be found.
|
||||
|
||||
### findUp([filenameA, filenameB], [options])
|
||||
|
||||
Returns a `Promise` for either the first filepath found (by respecting the order) or `null` if none could be found.
|
||||
|
||||
### findUp.sync(filename, [options])
|
||||
|
||||
Returns a filepath or `null`.
|
||||
|
||||
### findUp.sync([filenameA, filenameB], [options])
|
||||
|
||||
Returns the first filepath found (by respecting the order) or `null`.
|
||||
|
||||
#### filename
|
||||
|
||||
Type: `string`
|
||||
|
||||
Filename of the file to find.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### cwd
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `process.cwd()`
|
||||
|
||||
Directory to start from.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module
|
||||
- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file
|
||||
- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package
|
||||
- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module like `require.resolve()` but from a given path
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
46
backend/node_modules/yargs/node_modules/is-fullwidth-code-point/index.js
generated
vendored
Normal file
46
backend/node_modules/yargs/node_modules/is-fullwidth-code-point/index.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
'use strict';
|
||||
/* eslint-disable yoda */
|
||||
module.exports = x => {
|
||||
if (Number.isNaN(x)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// code points are derived from:
|
||||
// http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
|
||||
if (
|
||||
x >= 0x1100 && (
|
||||
x <= 0x115f || // Hangul Jamo
|
||||
x === 0x2329 || // LEFT-POINTING ANGLE BRACKET
|
||||
x === 0x232a || // RIGHT-POINTING ANGLE BRACKET
|
||||
// CJK Radicals Supplement .. Enclosed CJK Letters and Months
|
||||
(0x2e80 <= x && x <= 0x3247 && x !== 0x303f) ||
|
||||
// Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
|
||||
(0x3250 <= x && x <= 0x4dbf) ||
|
||||
// CJK Unified Ideographs .. Yi Radicals
|
||||
(0x4e00 <= x && x <= 0xa4c6) ||
|
||||
// Hangul Jamo Extended-A
|
||||
(0xa960 <= x && x <= 0xa97c) ||
|
||||
// Hangul Syllables
|
||||
(0xac00 <= x && x <= 0xd7a3) ||
|
||||
// CJK Compatibility Ideographs
|
||||
(0xf900 <= x && x <= 0xfaff) ||
|
||||
// Vertical Forms
|
||||
(0xfe10 <= x && x <= 0xfe19) ||
|
||||
// CJK Compatibility Forms .. Small Form Variants
|
||||
(0xfe30 <= x && x <= 0xfe6b) ||
|
||||
// Halfwidth and Fullwidth Forms
|
||||
(0xff01 <= x && x <= 0xff60) ||
|
||||
(0xffe0 <= x && x <= 0xffe6) ||
|
||||
// Kana Supplement
|
||||
(0x1b000 <= x && x <= 0x1b001) ||
|
||||
// Enclosed Ideographic Supplement
|
||||
(0x1f200 <= x && x <= 0x1f251) ||
|
||||
// CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
|
||||
(0x20000 <= x && x <= 0x3fffd)
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
21
backend/node_modules/yargs/node_modules/is-fullwidth-code-point/license
generated
vendored
Normal file
21
backend/node_modules/yargs/node_modules/is-fullwidth-code-point/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
45
backend/node_modules/yargs/node_modules/is-fullwidth-code-point/package.json
generated
vendored
Normal file
45
backend/node_modules/yargs/node_modules/is-fullwidth-code-point/package.json
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "is-fullwidth-code-point",
|
||||
"version": "2.0.0",
|
||||
"description": "Check if the character represented by a given Unicode code point is fullwidth",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/is-fullwidth-code-point",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"fullwidth",
|
||||
"full-width",
|
||||
"full",
|
||||
"width",
|
||||
"unicode",
|
||||
"character",
|
||||
"char",
|
||||
"string",
|
||||
"str",
|
||||
"codepoint",
|
||||
"code",
|
||||
"point",
|
||||
"is",
|
||||
"detect",
|
||||
"check"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"xo": {
|
||||
"esnext": true
|
||||
}
|
||||
}
|
39
backend/node_modules/yargs/node_modules/is-fullwidth-code-point/readme.md
generated
vendored
Normal file
39
backend/node_modules/yargs/node_modules/is-fullwidth-code-point/readme.md
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
# is-fullwidth-code-point [](https://travis-ci.org/sindresorhus/is-fullwidth-code-point)
|
||||
|
||||
> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save is-fullwidth-code-point
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const isFullwidthCodePoint = require('is-fullwidth-code-point');
|
||||
|
||||
isFullwidthCodePoint('谢'.codePointAt());
|
||||
//=> true
|
||||
|
||||
isFullwidthCodePoint('a'.codePointAt());
|
||||
//=> false
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### isFullwidthCodePoint(input)
|
||||
|
||||
#### input
|
||||
|
||||
Type: `number`
|
||||
|
||||
[Code point](https://en.wikipedia.org/wiki/Code_point) of a character.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
24
backend/node_modules/yargs/node_modules/locate-path/index.js
generated
vendored
Normal file
24
backend/node_modules/yargs/node_modules/locate-path/index.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const pathExists = require('path-exists');
|
||||
const pLocate = require('p-locate');
|
||||
|
||||
module.exports = (iterable, options) => {
|
||||
options = Object.assign({
|
||||
cwd: process.cwd()
|
||||
}, options);
|
||||
|
||||
return pLocate(iterable, el => pathExists(path.resolve(options.cwd, el)), options);
|
||||
};
|
||||
|
||||
module.exports.sync = (iterable, options) => {
|
||||
options = Object.assign({
|
||||
cwd: process.cwd()
|
||||
}, options);
|
||||
|
||||
for (const el of iterable) {
|
||||
if (pathExists.sync(path.resolve(options.cwd, el))) {
|
||||
return el;
|
||||
}
|
||||
}
|
||||
};
|
9
backend/node_modules/yargs/node_modules/locate-path/license
generated
vendored
Normal file
9
backend/node_modules/yargs/node_modules/locate-path/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
44
backend/node_modules/yargs/node_modules/locate-path/package.json
generated
vendored
Normal file
44
backend/node_modules/yargs/node_modules/locate-path/package.json
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "locate-path",
|
||||
"version": "3.0.0",
|
||||
"description": "Get the first path that exists on disk of multiple paths",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/locate-path",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"locate",
|
||||
"path",
|
||||
"paths",
|
||||
"file",
|
||||
"files",
|
||||
"exists",
|
||||
"find",
|
||||
"finder",
|
||||
"search",
|
||||
"searcher",
|
||||
"array",
|
||||
"iterable",
|
||||
"iterator"
|
||||
],
|
||||
"dependencies": {
|
||||
"p-locate": "^3.0.0",
|
||||
"path-exists": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
99
backend/node_modules/yargs/node_modules/locate-path/readme.md
generated
vendored
Normal file
99
backend/node_modules/yargs/node_modules/locate-path/readme.md
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
# locate-path [](https://travis-ci.org/sindresorhus/locate-path)
|
||||
|
||||
> Get the first path that exists on disk of multiple paths
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install locate-path
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
Here we find the first file that exists on disk, in array order.
|
||||
|
||||
```js
|
||||
const locatePath = require('locate-path');
|
||||
|
||||
const files = [
|
||||
'unicorn.png',
|
||||
'rainbow.png', // Only this one actually exists on disk
|
||||
'pony.png'
|
||||
];
|
||||
|
||||
(async () => {
|
||||
console(await locatePath(files));
|
||||
//=> 'rainbow'
|
||||
})();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### locatePath(input, [options])
|
||||
|
||||
Returns a `Promise` for the first path that exists or `undefined` if none exists.
|
||||
|
||||
#### input
|
||||
|
||||
Type: `Iterable<string>`
|
||||
|
||||
Paths to check.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### concurrency
|
||||
|
||||
Type: `number`<br>
|
||||
Default: `Infinity`<br>
|
||||
Minimum: `1`
|
||||
|
||||
Number of concurrently pending promises.
|
||||
|
||||
##### preserveOrder
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Preserve `input` order when searching.
|
||||
|
||||
Disable this to improve performance if you don't care about the order.
|
||||
|
||||
##### cwd
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `process.cwd()`
|
||||
|
||||
Current working directory.
|
||||
|
||||
### locatePath.sync(input, [options])
|
||||
|
||||
Returns the first path that exists or `undefined` if none exists.
|
||||
|
||||
#### input
|
||||
|
||||
Type: `Iterable<string>`
|
||||
|
||||
Paths to check.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### cwd
|
||||
|
||||
Same as above.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
38
backend/node_modules/yargs/node_modules/p-limit/index.d.ts
generated
vendored
Normal file
38
backend/node_modules/yargs/node_modules/p-limit/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
export interface Limit {
|
||||
/**
|
||||
@param fn - Promise-returning/async function.
|
||||
@param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions.
|
||||
@returns The promise returned by calling `fn(...arguments)`.
|
||||
*/
|
||||
<Arguments extends unknown[], ReturnType>(
|
||||
fn: (...arguments: Arguments) => PromiseLike<ReturnType> | ReturnType,
|
||||
...arguments: Arguments
|
||||
): Promise<ReturnType>;
|
||||
|
||||
/**
|
||||
The number of promises that are currently running.
|
||||
*/
|
||||
readonly activeCount: number;
|
||||
|
||||
/**
|
||||
The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
|
||||
*/
|
||||
readonly pendingCount: number;
|
||||
|
||||
/**
|
||||
Discard pending promises that are waiting to run.
|
||||
|
||||
This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
|
||||
|
||||
Note: This does not cancel promises that are already running.
|
||||
*/
|
||||
clearQueue(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
Run multiple promise-returning & async functions with limited concurrency.
|
||||
|
||||
@param concurrency - Concurrency limit. Minimum: `1`.
|
||||
@returns A `limit` function.
|
||||
*/
|
||||
export default function pLimit(concurrency: number): Limit;
|
57
backend/node_modules/yargs/node_modules/p-limit/index.js
generated
vendored
Normal file
57
backend/node_modules/yargs/node_modules/p-limit/index.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
'use strict';
|
||||
const pTry = require('p-try');
|
||||
|
||||
const pLimit = concurrency => {
|
||||
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
|
||||
return Promise.reject(new TypeError('Expected `concurrency` to be a number from 1 and up'));
|
||||
}
|
||||
|
||||
const queue = [];
|
||||
let activeCount = 0;
|
||||
|
||||
const next = () => {
|
||||
activeCount--;
|
||||
|
||||
if (queue.length > 0) {
|
||||
queue.shift()();
|
||||
}
|
||||
};
|
||||
|
||||
const run = (fn, resolve, ...args) => {
|
||||
activeCount++;
|
||||
|
||||
const result = pTry(fn, ...args);
|
||||
|
||||
resolve(result);
|
||||
|
||||
result.then(next, next);
|
||||
};
|
||||
|
||||
const enqueue = (fn, resolve, ...args) => {
|
||||
if (activeCount < concurrency) {
|
||||
run(fn, resolve, ...args);
|
||||
} else {
|
||||
queue.push(run.bind(null, fn, resolve, ...args));
|
||||
}
|
||||
};
|
||||
|
||||
const generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args));
|
||||
Object.defineProperties(generator, {
|
||||
activeCount: {
|
||||
get: () => activeCount
|
||||
},
|
||||
pendingCount: {
|
||||
get: () => queue.length
|
||||
},
|
||||
clearQueue: {
|
||||
value: () => {
|
||||
queue.length = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return generator;
|
||||
};
|
||||
|
||||
module.exports = pLimit;
|
||||
module.exports.default = pLimit;
|
9
backend/node_modules/yargs/node_modules/p-limit/license
generated
vendored
Normal file
9
backend/node_modules/yargs/node_modules/p-limit/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
52
backend/node_modules/yargs/node_modules/p-limit/package.json
generated
vendored
Normal file
52
backend/node_modules/yargs/node_modules/p-limit/package.json
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "p-limit",
|
||||
"version": "2.3.0",
|
||||
"description": "Run multiple promise-returning & async functions with limited concurrency",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/p-limit",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd-check"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"promise",
|
||||
"limit",
|
||||
"limited",
|
||||
"concurrency",
|
||||
"throttle",
|
||||
"throat",
|
||||
"rate",
|
||||
"batch",
|
||||
"ratelimit",
|
||||
"task",
|
||||
"queue",
|
||||
"async",
|
||||
"await",
|
||||
"promises",
|
||||
"bluebird"
|
||||
],
|
||||
"dependencies": {
|
||||
"p-try": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^1.2.1",
|
||||
"delay": "^4.1.0",
|
||||
"in-range": "^1.0.0",
|
||||
"random-int": "^1.0.0",
|
||||
"time-span": "^2.0.0",
|
||||
"tsd-check": "^0.3.0",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
101
backend/node_modules/yargs/node_modules/p-limit/readme.md
generated
vendored
Normal file
101
backend/node_modules/yargs/node_modules/p-limit/readme.md
generated
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
# p-limit [](https://travis-ci.org/sindresorhus/p-limit)
|
||||
|
||||
> Run multiple promise-returning & async functions with limited concurrency
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install p-limit
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const pLimit = require('p-limit');
|
||||
|
||||
const limit = pLimit(1);
|
||||
|
||||
const input = [
|
||||
limit(() => fetchSomething('foo')),
|
||||
limit(() => fetchSomething('bar')),
|
||||
limit(() => doSomething())
|
||||
];
|
||||
|
||||
(async () => {
|
||||
// Only one promise is run at once
|
||||
const result = await Promise.all(input);
|
||||
console.log(result);
|
||||
})();
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### pLimit(concurrency)
|
||||
|
||||
Returns a `limit` function.
|
||||
|
||||
#### concurrency
|
||||
|
||||
Type: `number`\
|
||||
Minimum: `1`\
|
||||
Default: `Infinity`
|
||||
|
||||
Concurrency limit.
|
||||
|
||||
### limit(fn, ...args)
|
||||
|
||||
Returns the promise returned by calling `fn(...args)`.
|
||||
|
||||
#### fn
|
||||
|
||||
Type: `Function`
|
||||
|
||||
Promise-returning/async function.
|
||||
|
||||
#### args
|
||||
|
||||
Any arguments to pass through to `fn`.
|
||||
|
||||
Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions.
|
||||
|
||||
### limit.activeCount
|
||||
|
||||
The number of promises that are currently running.
|
||||
|
||||
### limit.pendingCount
|
||||
|
||||
The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
|
||||
|
||||
### limit.clearQueue()
|
||||
|
||||
Discard pending promises that are waiting to run.
|
||||
|
||||
This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
|
||||
|
||||
Note: This does not cancel promises that are already running.
|
||||
|
||||
## FAQ
|
||||
|
||||
### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package?
|
||||
|
||||
This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue.
|
||||
|
||||
## Related
|
||||
|
||||
- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control
|
||||
- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions
|
||||
- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions
|
||||
- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency
|
||||
- [More…](https://github.com/sindresorhus/promise-fun)
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-p-limit?utm_source=npm-p-limit&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
34
backend/node_modules/yargs/node_modules/p-locate/index.js
generated
vendored
Normal file
34
backend/node_modules/yargs/node_modules/p-locate/index.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
'use strict';
|
||||
const pLimit = require('p-limit');
|
||||
|
||||
class EndError extends Error {
|
||||
constructor(value) {
|
||||
super();
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
// The input can also be a promise, so we `Promise.resolve()` it
|
||||
const testElement = (el, tester) => Promise.resolve(el).then(tester);
|
||||
|
||||
// The input can also be a promise, so we `Promise.all()` them both
|
||||
const finder = el => Promise.all(el).then(val => val[1] === true && Promise.reject(new EndError(val[0])));
|
||||
|
||||
module.exports = (iterable, tester, opts) => {
|
||||
opts = Object.assign({
|
||||
concurrency: Infinity,
|
||||
preserveOrder: true
|
||||
}, opts);
|
||||
|
||||
const limit = pLimit(opts.concurrency);
|
||||
|
||||
// Start all the promises concurrently with optional limit
|
||||
const items = [...iterable].map(el => [el, limit(testElement, el, tester)]);
|
||||
|
||||
// Check the promises either serially or concurrently
|
||||
const checkLimit = pLimit(opts.preserveOrder ? 1 : Infinity);
|
||||
|
||||
return Promise.all(items.map(el => checkLimit(finder, el)))
|
||||
.then(() => {})
|
||||
.catch(err => err instanceof EndError ? err.value : Promise.reject(err));
|
||||
};
|
9
backend/node_modules/yargs/node_modules/p-locate/license
generated
vendored
Normal file
9
backend/node_modules/yargs/node_modules/p-locate/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
51
backend/node_modules/yargs/node_modules/p-locate/package.json
generated
vendored
Normal file
51
backend/node_modules/yargs/node_modules/p-locate/package.json
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "p-locate",
|
||||
"version": "3.0.0",
|
||||
"description": "Get the first fulfilled promise that satisfies the provided testing function",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/p-locate",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"promise",
|
||||
"locate",
|
||||
"find",
|
||||
"finder",
|
||||
"search",
|
||||
"searcher",
|
||||
"test",
|
||||
"array",
|
||||
"collection",
|
||||
"iterable",
|
||||
"iterator",
|
||||
"race",
|
||||
"fulfilled",
|
||||
"fastest",
|
||||
"async",
|
||||
"await",
|
||||
"promises",
|
||||
"bluebird"
|
||||
],
|
||||
"dependencies": {
|
||||
"p-limit": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"delay": "^3.0.0",
|
||||
"in-range": "^1.0.0",
|
||||
"time-span": "^2.0.0",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
88
backend/node_modules/yargs/node_modules/p-locate/readme.md
generated
vendored
Normal file
88
backend/node_modules/yargs/node_modules/p-locate/readme.md
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
# p-locate [](https://travis-ci.org/sindresorhus/p-locate)
|
||||
|
||||
> Get the first fulfilled promise that satisfies the provided testing function
|
||||
|
||||
Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find).
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install p-locate
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
Here we find the first file that exists on disk, in array order.
|
||||
|
||||
```js
|
||||
const pathExists = require('path-exists');
|
||||
const pLocate = require('p-locate');
|
||||
|
||||
const files = [
|
||||
'unicorn.png',
|
||||
'rainbow.png', // Only this one actually exists on disk
|
||||
'pony.png'
|
||||
];
|
||||
|
||||
(async () => {
|
||||
const foundPath = await pLocate(files, file => pathExists(file));
|
||||
|
||||
console.log(foundPath);
|
||||
//=> 'rainbow'
|
||||
})();
|
||||
```
|
||||
|
||||
*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.*
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### pLocate(input, tester, [options])
|
||||
|
||||
Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`.
|
||||
|
||||
#### input
|
||||
|
||||
Type: `Iterable<Promise|any>`
|
||||
|
||||
#### tester(element)
|
||||
|
||||
Type: `Function`
|
||||
|
||||
Expected to return a `Promise<boolean>` or boolean.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### concurrency
|
||||
|
||||
Type: `number`<br>
|
||||
Default: `Infinity`<br>
|
||||
Minimum: `1`
|
||||
|
||||
Number of concurrently pending promises returned by `tester`.
|
||||
|
||||
##### preserveOrder
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Preserve `input` order when searching.
|
||||
|
||||
Disable this to improve performance if you don't care about the order.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently
|
||||
- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently
|
||||
- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled
|
||||
- [More…](https://github.com/sindresorhus/promise-fun)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
17
backend/node_modules/yargs/node_modules/path-exists/index.js
generated
vendored
Normal file
17
backend/node_modules/yargs/node_modules/path-exists/index.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
const fs = require('fs');
|
||||
|
||||
module.exports = fp => new Promise(resolve => {
|
||||
fs.access(fp, err => {
|
||||
resolve(!err);
|
||||
});
|
||||
});
|
||||
|
||||
module.exports.sync = fp => {
|
||||
try {
|
||||
fs.accessSync(fp);
|
||||
return true;
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
};
|
21
backend/node_modules/yargs/node_modules/path-exists/license
generated
vendored
Normal file
21
backend/node_modules/yargs/node_modules/path-exists/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
40
backend/node_modules/yargs/node_modules/path-exists/package.json
generated
vendored
Normal file
40
backend/node_modules/yargs/node_modules/path-exists/package.json
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "path-exists",
|
||||
"version": "3.0.0",
|
||||
"description": "Check if a path exists",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/path-exists",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"path",
|
||||
"exists",
|
||||
"exist",
|
||||
"file",
|
||||
"filepath",
|
||||
"fs",
|
||||
"filesystem",
|
||||
"file-system",
|
||||
"access",
|
||||
"stat"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"xo": {
|
||||
"esnext": true
|
||||
}
|
||||
}
|
50
backend/node_modules/yargs/node_modules/path-exists/readme.md
generated
vendored
Normal file
50
backend/node_modules/yargs/node_modules/path-exists/readme.md
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
# path-exists [](https://travis-ci.org/sindresorhus/path-exists)
|
||||
|
||||
> Check if a path exists
|
||||
|
||||
Because [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), but there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it.
|
||||
|
||||
Never use this before handling a file though:
|
||||
|
||||
> In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to `fs.exists()` and `fs.open()`. Just open the file and handle the error when it's not there.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save path-exists
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// foo.js
|
||||
const pathExists = require('path-exists');
|
||||
|
||||
pathExists('foo.js').then(exists => {
|
||||
console.log(exists);
|
||||
//=> true
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### pathExists(path)
|
||||
|
||||
Returns a promise for a boolean of whether the path exists.
|
||||
|
||||
### pathExists.sync(path)
|
||||
|
||||
Returns a boolean of whether the path exists.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [path-exists-cli](https://github.com/sindresorhus/path-exists-cli) - CLI for this module
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
39
backend/node_modules/yargs/node_modules/string-width/index.js
generated
vendored
Normal file
39
backend/node_modules/yargs/node_modules/string-width/index.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
'use strict';
|
||||
const stripAnsi = require('strip-ansi');
|
||||
const isFullwidthCodePoint = require('is-fullwidth-code-point');
|
||||
const emojiRegex = require('emoji-regex')();
|
||||
|
||||
module.exports = input => {
|
||||
input = input.replace(emojiRegex, ' ');
|
||||
|
||||
if (typeof input !== 'string' || input.length === 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
input = stripAnsi(input);
|
||||
|
||||
let width = 0;
|
||||
|
||||
for (let i = 0; i < input.length; i++) {
|
||||
const code = input.codePointAt(i);
|
||||
|
||||
// Ignore control characters
|
||||
if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Ignore combining characters
|
||||
if (code >= 0x300 && code <= 0x36F) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Surrogates
|
||||
if (code > 0xFFFF) {
|
||||
i++;
|
||||
}
|
||||
|
||||
width += isFullwidthCodePoint(code) ? 2 : 1;
|
||||
}
|
||||
|
||||
return width;
|
||||
};
|
9
backend/node_modules/yargs/node_modules/string-width/license
generated
vendored
Normal file
9
backend/node_modules/yargs/node_modules/string-width/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
56
backend/node_modules/yargs/node_modules/string-width/package.json
generated
vendored
Normal file
56
backend/node_modules/yargs/node_modules/string-width/package.json
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "string-width",
|
||||
"version": "3.1.0",
|
||||
"description": "Get the visual width of a string - the number of columns required to display it",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/string-width",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"string",
|
||||
"str",
|
||||
"character",
|
||||
"char",
|
||||
"unicode",
|
||||
"width",
|
||||
"visual",
|
||||
"column",
|
||||
"columns",
|
||||
"fullwidth",
|
||||
"full-width",
|
||||
"full",
|
||||
"ansi",
|
||||
"escape",
|
||||
"codes",
|
||||
"cli",
|
||||
"command-line",
|
||||
"terminal",
|
||||
"console",
|
||||
"cjk",
|
||||
"chinese",
|
||||
"japanese",
|
||||
"korean",
|
||||
"fixed-width"
|
||||
],
|
||||
"dependencies": {
|
||||
"emoji-regex": "^7.0.1",
|
||||
"is-fullwidth-code-point": "^2.0.0",
|
||||
"strip-ansi": "^5.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^1.0.1",
|
||||
"xo": "^0.23.0"
|
||||
}
|
||||
}
|
45
backend/node_modules/yargs/node_modules/string-width/readme.md
generated
vendored
Normal file
45
backend/node_modules/yargs/node_modules/string-width/readme.md
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
# string-width [](https://travis-ci.org/sindresorhus/string-width)
|
||||
|
||||
> Get the visual width of a string - the number of columns required to display it
|
||||
|
||||
Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
|
||||
|
||||
Useful to be able to measure the actual width of command-line output.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install string-width
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const stringWidth = require('string-width');
|
||||
|
||||
stringWidth('古');
|
||||
//=> 2
|
||||
|
||||
stringWidth('\u001b[1m古\u001b[22m');
|
||||
//=> 2
|
||||
|
||||
stringWidth('a');
|
||||
//=> 1
|
||||
|
||||
stringWidth('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
|
||||
// => 5
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module
|
||||
- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string
|
||||
- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
15
backend/node_modules/yargs/node_modules/strip-ansi/index.d.ts
generated
vendored
Normal file
15
backend/node_modules/yargs/node_modules/strip-ansi/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string.
|
||||
|
||||
@example
|
||||
```
|
||||
import stripAnsi from 'strip-ansi';
|
||||
|
||||
stripAnsi('\u001B[4mUnicorn\u001B[0m');
|
||||
//=> 'Unicorn'
|
||||
|
||||
stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
|
||||
//=> 'Click'
|
||||
```
|
||||
*/
|
||||
export default function stripAnsi(string: string): string;
|
7
backend/node_modules/yargs/node_modules/strip-ansi/index.js
generated
vendored
Normal file
7
backend/node_modules/yargs/node_modules/strip-ansi/index.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
const ansiRegex = require('ansi-regex');
|
||||
|
||||
const stripAnsi = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
|
||||
|
||||
module.exports = stripAnsi;
|
||||
module.exports.default = stripAnsi;
|
9
backend/node_modules/yargs/node_modules/strip-ansi/license
generated
vendored
Normal file
9
backend/node_modules/yargs/node_modules/strip-ansi/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
54
backend/node_modules/yargs/node_modules/strip-ansi/package.json
generated
vendored
Normal file
54
backend/node_modules/yargs/node_modules/strip-ansi/package.json
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"name": "strip-ansi",
|
||||
"version": "5.2.0",
|
||||
"description": "Strip ANSI escape codes from a string",
|
||||
"license": "MIT",
|
||||
"repository": "chalk/strip-ansi",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd-check"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"strip",
|
||||
"trim",
|
||||
"remove",
|
||||
"ansi",
|
||||
"styles",
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"string",
|
||||
"tty",
|
||||
"escape",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"log",
|
||||
"logging",
|
||||
"command-line",
|
||||
"text"
|
||||
],
|
||||
"dependencies": {
|
||||
"ansi-regex": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^1.3.1",
|
||||
"tsd-check": "^0.5.0",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
61
backend/node_modules/yargs/node_modules/strip-ansi/readme.md
generated
vendored
Normal file
61
backend/node_modules/yargs/node_modules/strip-ansi/readme.md
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
# strip-ansi [](https://travis-ci.org/chalk/strip-ansi)
|
||||
|
||||
> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=readme">Get professional support for 'strip-ansi' with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install strip-ansi
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const stripAnsi = require('strip-ansi');
|
||||
|
||||
stripAnsi('\u001B[4mUnicorn\u001B[0m');
|
||||
//=> 'Unicorn'
|
||||
|
||||
stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
|
||||
//=> 'Click'
|
||||
```
|
||||
|
||||
|
||||
## Security
|
||||
|
||||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module
|
||||
- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module
|
||||
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
|
||||
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
|
||||
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
467
backend/node_modules/yargs/node_modules/yargs-parser/CHANGELOG.md
generated
vendored
Normal file
467
backend/node_modules/yargs/node_modules/yargs-parser/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,467 @@
|
||||
# Changelog
|
||||
|
||||
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.
|
||||
|
||||
### [13.1.1](https://www.github.com/yargs/yargs-parser/compare/v13.1.0...v13.1.1) (2019-06-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* convert values to strings when tokenizing ([#167](https://www.github.com/yargs/yargs-parser/issues/167)) ([57b7883](https://www.github.com/yargs/yargs-parser/commit/57b7883))
|
||||
* nargs should allow duplicates when duplicate-arguments-array=false ([#164](https://www.github.com/yargs/yargs-parser/issues/164)) ([47ccb0b](https://www.github.com/yargs/yargs-parser/commit/47ccb0b))
|
||||
* should populate "_" when given config with "short-option-groups" false ([#179](https://www.github.com/yargs/yargs-parser/issues/179)) ([6055974](https://www.github.com/yargs/yargs-parser/commit/6055974))
|
||||
|
||||
## [13.1.0](https://github.com/yargs/yargs-parser/compare/v13.0.0...v13.1.0) (2019-05-05)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add `strip-aliased` and `strip-dashed` configuration options. ([#172](https://github.com/yargs/yargs-parser/issues/172)) ([a3936aa](https://github.com/yargs/yargs-parser/commit/a3936aa))
|
||||
* support boolean which do not consume next argument. ([#171](https://github.com/yargs/yargs-parser/issues/171)) ([0ae7fcb](https://github.com/yargs/yargs-parser/commit/0ae7fcb))
|
||||
|
||||
|
||||
|
||||
<a name="13.0.0"></a>
|
||||
# [13.0.0](https://github.com/yargs/yargs-parser/compare/v12.0.0...v13.0.0) (2019-02-02)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* don't coerce number from string with leading '0' or '+' ([#158](https://github.com/yargs/yargs-parser/issues/158)) ([18d0fd5](https://github.com/yargs/yargs-parser/commit/18d0fd5))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* options with leading '+' or '0' now parse as strings
|
||||
|
||||
|
||||
|
||||
<a name="12.0.0"></a>
|
||||
# [12.0.0](https://github.com/yargs/yargs-parser/compare/v11.1.1...v12.0.0) (2019-01-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* better handling of quoted strings ([#153](https://github.com/yargs/yargs-parser/issues/153)) ([2fb71b2](https://github.com/yargs/yargs-parser/commit/2fb71b2))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* default value is now used if no right-hand value provided for numbers/strings ([#156](https://github.com/yargs/yargs-parser/issues/156)) ([5a7c46a](https://github.com/yargs/yargs-parser/commit/5a7c46a))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* a flag with no right-hand value no longer populates defaulted options with `undefined`.
|
||||
* quotes at beginning and endings of strings are not removed during parsing.
|
||||
|
||||
|
||||
|
||||
<a name="11.1.1"></a>
|
||||
## [11.1.1](https://github.com/yargs/yargs-parser/compare/v11.1.0...v11.1.1) (2018-11-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* ensure empty string is added into argv._ ([#140](https://github.com/yargs/yargs-parser/issues/140)) ([79cda98](https://github.com/yargs/yargs-parser/commit/79cda98))
|
||||
|
||||
|
||||
### Reverts
|
||||
|
||||
* make requiresArg work in conjunction with arrays ([#136](https://github.com/yargs/yargs-parser/issues/136)) ([f4a3063](https://github.com/yargs/yargs-parser/commit/f4a3063))
|
||||
|
||||
|
||||
|
||||
<a name="11.1.0"></a>
|
||||
# [11.1.0](https://github.com/yargs/yargs-parser/compare/v11.0.0...v11.1.0) (2018-11-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* handling of one char alias ([#139](https://github.com/yargs/yargs-parser/issues/139)) ([ee56e31](https://github.com/yargs/yargs-parser/commit/ee56e31))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add halt-at-non-option configuration option ([#130](https://github.com/yargs/yargs-parser/issues/130)) ([a849fce](https://github.com/yargs/yargs-parser/commit/a849fce))
|
||||
|
||||
|
||||
|
||||
<a name="11.0.0"></a>
|
||||
# [11.0.0](https://github.com/yargs/yargs-parser/compare/v10.1.0...v11.0.0) (2018-10-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* flatten-duplicate-arrays:false for more than 2 arrays ([#128](https://github.com/yargs/yargs-parser/issues/128)) ([2bc395f](https://github.com/yargs/yargs-parser/commit/2bc395f))
|
||||
* hyphenated flags combined with dot notation broke parsing ([#131](https://github.com/yargs/yargs-parser/issues/131)) ([dc788da](https://github.com/yargs/yargs-parser/commit/dc788da))
|
||||
* make requiresArg work in conjunction with arrays ([#136](https://github.com/yargs/yargs-parser/issues/136)) ([77ae1d4](https://github.com/yargs/yargs-parser/commit/77ae1d4))
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* update dependencies ([6dc42a1](https://github.com/yargs/yargs-parser/commit/6dc42a1))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* also add camelCase array options ([#125](https://github.com/yargs/yargs-parser/issues/125)) ([08c0117](https://github.com/yargs/yargs-parser/commit/08c0117))
|
||||
* array.type can now be provided, supporting coercion ([#132](https://github.com/yargs/yargs-parser/issues/132)) ([4b8cfce](https://github.com/yargs/yargs-parser/commit/4b8cfce))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* drops Node 4 support
|
||||
* the argv object is now populated differently (correctly) when hyphens and dot notation are used in conjunction.
|
||||
|
||||
|
||||
|
||||
<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)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* do not set boolean flags if not defined in `argv` ([#119](https://github.com/yargs/yargs-parser/issues/119)) ([f6e6599](https://github.com/yargs/yargs-parser/commit/f6e6599))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* `boolean` flags defined without a `default` value will now behave like other option type and won't be set in the parsed results when the user doesn't set the corresponding CLI arg.
|
||||
|
||||
Previous behavior:
|
||||
```js
|
||||
var parse = require('yargs-parser');
|
||||
|
||||
parse('--flag', {boolean: ['flag']});
|
||||
// => { _: [], flag: true }
|
||||
|
||||
parse('--no-flag', {boolean: ['flag']});
|
||||
// => { _: [], flag: false }
|
||||
|
||||
parse('', {boolean: ['flag']});
|
||||
// => { _: [], flag: false }
|
||||
```
|
||||
|
||||
New behavior:
|
||||
```js
|
||||
var parse = require('yargs-parser');
|
||||
|
||||
parse('--flag', {boolean: ['flag']});
|
||||
// => { _: [], flag: true }
|
||||
|
||||
parse('--no-flag', {boolean: ['flag']});
|
||||
// => { _: [], flag: false }
|
||||
|
||||
parse('', {boolean: ['flag']});
|
||||
// => { _: [] } => flag not set similarly to other option type
|
||||
```
|
||||
|
||||
|
||||
|
||||
<a name="9.0.2"></a>
|
||||
## [9.0.2](https://github.com/yargs/yargs-parser/compare/v9.0.1...v9.0.2) (2018-01-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* nargs was still aggressively consuming too many arguments ([9b28aad](https://github.com/yargs/yargs-parser/commit/9b28aad))
|
||||
|
||||
|
||||
|
||||
<a name="9.0.1"></a>
|
||||
## [9.0.1](https://github.com/yargs/yargs-parser/compare/v9.0.0...v9.0.1) (2018-01-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* nargs was consuming too many arguments ([4fef206](https://github.com/yargs/yargs-parser/commit/4fef206))
|
||||
|
||||
|
||||
|
||||
<a name="9.0.0"></a>
|
||||
# [9.0.0](https://github.com/yargs/yargs-parser/compare/v8.1.0...v9.0.0) (2018-01-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* narg arguments no longer consume flag arguments ([#114](https://github.com/yargs/yargs-parser/issues/114)) ([60bb9b3](https://github.com/yargs/yargs-parser/commit/60bb9b3))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* arguments of form --foo, -abc, will no longer be consumed by nargs
|
||||
|
||||
|
||||
|
||||
<a name="8.1.0"></a>
|
||||
# [8.1.0](https://github.com/yargs/yargs-parser/compare/v8.0.0...v8.1.0) (2017-12-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allow null config values ([#108](https://github.com/yargs/yargs-parser/issues/108)) ([d8b14f9](https://github.com/yargs/yargs-parser/commit/d8b14f9))
|
||||
* ensure consistent parsing of dot-notation arguments ([#102](https://github.com/yargs/yargs-parser/issues/102)) ([c9bd79c](https://github.com/yargs/yargs-parser/commit/c9bd79c))
|
||||
* implement [@antoniom](https://github.com/antoniom)'s fix for camel-case expansion ([3087e1d](https://github.com/yargs/yargs-parser/commit/3087e1d))
|
||||
* only run coercion functions once, despite aliases. ([#76](https://github.com/yargs/yargs-parser/issues/76)) ([#103](https://github.com/yargs/yargs-parser/issues/103)) ([507aaef](https://github.com/yargs/yargs-parser/commit/507aaef))
|
||||
* scientific notation circumvented bounds check ([#110](https://github.com/yargs/yargs-parser/issues/110)) ([3571f57](https://github.com/yargs/yargs-parser/commit/3571f57))
|
||||
* tokenizer should ignore spaces at the beginning of the argString ([#106](https://github.com/yargs/yargs-parser/issues/106)) ([f34ead9](https://github.com/yargs/yargs-parser/commit/f34ead9))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* make combining arrays a configurable option ([#111](https://github.com/yargs/yargs-parser/issues/111)) ([c8bf536](https://github.com/yargs/yargs-parser/commit/c8bf536))
|
||||
* merge array from arguments with array from config ([#83](https://github.com/yargs/yargs-parser/issues/83)) ([806ddd6](https://github.com/yargs/yargs-parser/commit/806ddd6))
|
||||
|
||||
|
||||
|
||||
<a name="8.0.0"></a>
|
||||
# [8.0.0](https://github.com/yargs/yargs-parser/compare/v7.0.0...v8.0.0) (2017-10-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Ignore multiple spaces between arguments. ([#100](https://github.com/yargs/yargs-parser/issues/100)) ([d137227](https://github.com/yargs/yargs-parser/commit/d137227))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* allow configuration of prefix for boolean negation ([#94](https://github.com/yargs/yargs-parser/issues/94)) ([00bde7d](https://github.com/yargs/yargs-parser/commit/00bde7d))
|
||||
* reworking how numbers are parsed ([#104](https://github.com/yargs/yargs-parser/issues/104)) ([fba00eb](https://github.com/yargs/yargs-parser/commit/fba00eb))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* strings that fail `Number.isSafeInteger()` are no longer coerced into numbers.
|
||||
|
||||
|
||||
|
||||
<a name="7.0.0"></a>
|
||||
# [7.0.0](https://github.com/yargs/yargs-parser/compare/v6.0.1...v7.0.0) (2017-05-02)
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* revert populate-- logic ([#91](https://github.com/yargs/yargs-parser/issues/91)) ([6003e6d](https://github.com/yargs/yargs-parser/commit/6003e6d))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* populate-- now defaults to false.
|
||||
|
||||
|
||||
|
||||
<a name="6.0.1"></a>
|
||||
## [6.0.1](https://github.com/yargs/yargs-parser/compare/v6.0.0...v6.0.1) (2017-05-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* default '--' to undefined when not provided; this is closer to the array API ([#90](https://github.com/yargs/yargs-parser/issues/90)) ([4e739cc](https://github.com/yargs/yargs-parser/commit/4e739cc))
|
||||
|
||||
|
||||
|
||||
<a name="6.0.0"></a>
|
||||
# [6.0.0](https://github.com/yargs/yargs-parser/compare/v4.2.1...v6.0.0) (2017-05-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* environment variables should take precedence over config file ([#81](https://github.com/yargs/yargs-parser/issues/81)) ([76cee1f](https://github.com/yargs/yargs-parser/commit/76cee1f))
|
||||
* parsing hints should apply for dot notation keys ([#86](https://github.com/yargs/yargs-parser/issues/86)) ([3e47d62](https://github.com/yargs/yargs-parser/commit/3e47d62))
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* upgrade to newest version of camelcase ([#87](https://github.com/yargs/yargs-parser/issues/87)) ([f1903aa](https://github.com/yargs/yargs-parser/commit/f1903aa))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add -- option which allows arguments after the -- flag to be returned separated from positional arguments ([#84](https://github.com/yargs/yargs-parser/issues/84)) ([2572ca8](https://github.com/yargs/yargs-parser/commit/2572ca8))
|
||||
* when parsing stops, we now populate "--" by default ([#88](https://github.com/yargs/yargs-parser/issues/88)) ([cd666db](https://github.com/yargs/yargs-parser/commit/cd666db))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* rather than placing arguments in "_", when parsing is stopped via "--"; we now populate an array called "--" by default.
|
||||
* camelcase now requires Node 4+.
|
||||
* environment variables will now override config files (args, env, config-file, config-object)
|
||||
|
||||
|
||||
|
||||
<a name="5.0.0"></a>
|
||||
# [5.0.0](https://github.com/yargs/yargs-parser/compare/v4.2.1...v5.0.0) (2017-02-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* environment variables should take precedence over config file ([#81](https://github.com/yargs/yargs-parser/issues/81)) ([76cee1f](https://github.com/yargs/yargs-parser/commit/76cee1f))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* environment variables will now override config files (args, env, config-file, config-object)
|
||||
|
||||
|
||||
|
||||
<a name="4.2.1"></a>
|
||||
## [4.2.1](https://github.com/yargs/yargs-parser/compare/v4.2.0...v4.2.1) (2017-01-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* flatten/duplicate regression ([#75](https://github.com/yargs/yargs-parser/issues/75)) ([68d68a0](https://github.com/yargs/yargs-parser/commit/68d68a0))
|
||||
|
||||
|
||||
|
||||
<a name="4.2.0"></a>
|
||||
# [4.2.0](https://github.com/yargs/yargs-parser/compare/v4.1.0...v4.2.0) (2016-12-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* inner objects in configs had their keys appended to top-level key when dot-notation was disabled ([#72](https://github.com/yargs/yargs-parser/issues/72)) ([0b1b5f9](https://github.com/yargs/yargs-parser/commit/0b1b5f9))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* allow multiple arrays to be provided, rather than always combining ([#71](https://github.com/yargs/yargs-parser/issues/71)) ([0f0fb2d](https://github.com/yargs/yargs-parser/commit/0f0fb2d))
|
||||
|
||||
|
||||
|
||||
<a name="4.1.0"></a>
|
||||
# [4.1.0](https://github.com/yargs/yargs-parser/compare/v4.0.2...v4.1.0) (2016-11-07)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* apply coercions to default options ([#65](https://github.com/yargs/yargs-parser/issues/65)) ([c79052b](https://github.com/yargs/yargs-parser/commit/c79052b))
|
||||
* handle dot notation boolean options ([#63](https://github.com/yargs/yargs-parser/issues/63)) ([02c3545](https://github.com/yargs/yargs-parser/commit/02c3545))
|
||||
|
||||
|
||||
|
||||
<a name="4.0.2"></a>
|
||||
## [4.0.2](https://github.com/yargs/yargs-parser/compare/v4.0.1...v4.0.2) (2016-09-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* whoops, let's make the assign not change the Object key order ([29d069a](https://github.com/yargs/yargs-parser/commit/29d069a))
|
||||
|
||||
|
||||
|
||||
<a name="4.0.1"></a>
|
||||
## [4.0.1](https://github.com/yargs/yargs-parser/compare/v4.0.0...v4.0.1) (2016-09-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* lodash.assign was deprecated ([#59](https://github.com/yargs/yargs-parser/issues/59)) ([5e7eb11](https://github.com/yargs/yargs-parser/commit/5e7eb11))
|
||||
|
||||
|
||||
|
||||
<a name="4.0.0"></a>
|
||||
# [4.0.0](https://github.com/yargs/yargs-parser/compare/v3.2.0...v4.0.0) (2016-09-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* coerce should be applied to the final objects and arrays created ([#57](https://github.com/yargs/yargs-parser/issues/57)) ([4ca69da](https://github.com/yargs/yargs-parser/commit/4ca69da))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* coerce is no longer applied to individual arguments in an implicit array.
|
||||
|
||||
|
||||
|
||||
<a name="3.2.0"></a>
|
||||
# [3.2.0](https://github.com/yargs/yargs-parser/compare/v3.1.0...v3.2.0) (2016-08-13)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* coerce full array instead of each element ([#51](https://github.com/yargs/yargs-parser/issues/51)) ([cc4dc56](https://github.com/yargs/yargs-parser/commit/cc4dc56))
|
||||
|
||||
|
||||
|
||||
<a name="3.1.0"></a>
|
||||
# [3.1.0](https://github.com/yargs/yargs-parser/compare/v3.0.0...v3.1.0) (2016-08-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* address pkgConf parsing bug outlined in [#37](https://github.com/yargs/yargs-parser/issues/37) ([#45](https://github.com/yargs/yargs-parser/issues/45)) ([be76ee6](https://github.com/yargs/yargs-parser/commit/be76ee6))
|
||||
* better parsing of negative values ([#44](https://github.com/yargs/yargs-parser/issues/44)) ([2e43692](https://github.com/yargs/yargs-parser/commit/2e43692))
|
||||
* check aliases when guessing defaults for arguments fixes [#41](https://github.com/yargs/yargs-parser/issues/41) ([#43](https://github.com/yargs/yargs-parser/issues/43)) ([f3e4616](https://github.com/yargs/yargs-parser/commit/f3e4616))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* added coerce option, for providing specialized argument parsing ([#42](https://github.com/yargs/yargs-parser/issues/42)) ([7b49cd2](https://github.com/yargs/yargs-parser/commit/7b49cd2))
|
||||
|
||||
|
||||
|
||||
<a name="3.0.0"></a>
|
||||
# [3.0.0](https://github.com/yargs/yargs-parser/compare/v2.4.1...v3.0.0) (2016-08-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* parsing issue with numeric character in group of options ([#19](https://github.com/yargs/yargs-parser/issues/19)) ([f743236](https://github.com/yargs/yargs-parser/commit/f743236))
|
||||
* upgraded lodash.assign ([5d7fdf4](https://github.com/yargs/yargs-parser/commit/5d7fdf4))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* subtle change to how values are parsed in a group of single-character arguments.
|
||||
* _first released in 3.1.0, better handling of negative values should be considered a breaking change._
|
||||
|
||||
|
||||
|
||||
<a name="2.4.1"></a>
|
||||
## [2.4.1](https://github.com/yargs/yargs-parser/compare/v2.4.0...v2.4.1) (2016-07-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **count:** do not increment a default value ([#39](https://github.com/yargs/yargs-parser/issues/39)) ([b04a189](https://github.com/yargs/yargs-parser/commit/b04a189))
|
||||
|
||||
|
||||
|
||||
<a name="2.4.0"></a>
|
||||
# [2.4.0](https://github.com/yargs/yargs-parser/compare/v2.3.0...v2.4.0) (2016-04-11)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **environment:** Support nested options in environment variables ([#26](https://github.com/yargs/yargs-parser/issues/26)) thanks [@elas7](https://github.com/elas7) \o/ ([020778b](https://github.com/yargs/yargs-parser/commit/020778b))
|
||||
|
||||
|
||||
|
||||
<a name="2.3.0"></a>
|
||||
# [2.3.0](https://github.com/yargs/yargs-parser/compare/v2.2.0...v2.3.0) (2016-04-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **boolean:** fix for boolean options with non boolean defaults (#20) ([2dbe86b](https://github.com/yargs/yargs-parser/commit/2dbe86b)), closes [(#20](https://github.com/(/issues/20)
|
||||
* **package:** remove tests from tarball ([0353c0d](https://github.com/yargs/yargs-parser/commit/0353c0d))
|
||||
* **parsing:** handle calling short option with an empty string as the next value. ([a867165](https://github.com/yargs/yargs-parser/commit/a867165))
|
||||
* boolean flag when next value contains the strings 'true' or 'false'. ([69941a6](https://github.com/yargs/yargs-parser/commit/69941a6))
|
||||
* update dependencies; add standard-version bin for next release (#24) ([822d9d5](https://github.com/yargs/yargs-parser/commit/822d9d5))
|
||||
|
||||
### Features
|
||||
|
||||
* **configuration:** Allow to pass configuration objects to yargs-parser ([0780900](https://github.com/yargs/yargs-parser/commit/0780900))
|
||||
* **normalize:** allow normalize to work with arrays ([e0eaa1a](https://github.com/yargs/yargs-parser/commit/e0eaa1a))
|
14
backend/node_modules/yargs/node_modules/yargs-parser/LICENSE.txt
generated
vendored
Normal file
14
backend/node_modules/yargs/node_modules/yargs-parser/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
Copyright (c) 2016, Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software
|
||||
for any purpose with or without fee is hereby granted, provided
|
||||
that the above copyright notice and this permission notice
|
||||
appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
|
||||
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
||||
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
396
backend/node_modules/yargs/node_modules/yargs-parser/README.md
generated
vendored
Normal file
396
backend/node_modules/yargs/node_modules/yargs-parser/README.md
generated
vendored
Normal file
@@ -0,0 +1,396 @@
|
||||
# yargs-parser
|
||||
|
||||
[](https://travis-ci.org/yargs/yargs-parser)
|
||||
[](https://coveralls.io/r/yargs/yargs-parser?branch=master)
|
||||
[](https://www.npmjs.com/package/yargs-parser)
|
||||
[](https://github.com/conventional-changelog/standard-version)
|
||||
|
||||
|
||||
The mighty option parser used by [yargs](https://github.com/yargs/yargs).
|
||||
|
||||
visit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions.
|
||||
|
||||
<img width="250" src="https://raw.githubusercontent.com/yargs/yargs-parser/master/yargs-logo.png">
|
||||
|
||||
## Example
|
||||
|
||||
```sh
|
||||
npm i yargs-parser --save
|
||||
```
|
||||
|
||||
```js
|
||||
var argv = require('yargs-parser')(process.argv.slice(2))
|
||||
console.log(argv)
|
||||
```
|
||||
|
||||
```sh
|
||||
node example.js --foo=33 --bar hello
|
||||
{ _: [], foo: 33, bar: 'hello' }
|
||||
```
|
||||
|
||||
_or parse a string!_
|
||||
|
||||
```js
|
||||
var argv = require('./')('--foo=99 --bar=33')
|
||||
console.log(argv)
|
||||
```
|
||||
|
||||
```sh
|
||||
{ _: [], foo: 99, bar: 33 }
|
||||
```
|
||||
|
||||
Convert an array of mixed types before passing to `yargs-parser`:
|
||||
|
||||
```js
|
||||
var parse = require('yargs-parser')
|
||||
parse(['-f', 11, '--zoom', 55].join(' ')) // <-- array to string
|
||||
parse(['-f', 11, '--zoom', 55].map(String)) // <-- array of strings
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### require('yargs-parser')(args, opts={})
|
||||
|
||||
Parses command line arguments returning a simple mapping of keys and values.
|
||||
|
||||
**expects:**
|
||||
|
||||
* `args`: a string or array of strings representing the options to parse.
|
||||
* `opts`: provide a set of hints indicating how `args` should be parsed:
|
||||
* `opts.alias`: an object representing the set of aliases for a key: `{alias: {foo: ['f']}}`.
|
||||
* `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`.<br>
|
||||
Indicate that keys should be parsed as an array and coerced to booleans / numbers:<br>
|
||||
`{array: [{ key: 'foo', boolean: true }, {key: 'bar', number: true}]}`.
|
||||
* `opts.boolean`: arguments should be parsed as booleans: `{boolean: ['x', 'y']}`.
|
||||
* `opts.coerce`: provide a custom synchronous function that returns a coerced value from the argument provided
|
||||
(or throws an error). For arrays the function is called only once for the entire array:<br>
|
||||
`{coerce: {foo: function (arg) {return modifiedArg}}}`.
|
||||
* `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed).
|
||||
* `opts.configObjects`: configuration objects to parse, their properties will be set as arguments:<br>
|
||||
`{configObjects: [{'x': 5, 'y': 33}, {'z': 44}]}`.
|
||||
* `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)).
|
||||
* `opts.count`: indicate a key that should be used as a counter, e.g., `-vvv` = `{v: 3}`.
|
||||
* `opts.default`: provide default values for keys: `{default: {x: 33, y: 'hello world!'}}`.
|
||||
* `opts.envPrefix`: environment variables (`process.env`) with the prefix provided should be parsed.
|
||||
* `opts.narg`: specify that a key requires `n` arguments: `{narg: {x: 2}}`.
|
||||
* `opts.normalize`: `path.normalize()` will be applied to values set to this key.
|
||||
* `opts.number`: keys should be treated as numbers.
|
||||
* `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`).
|
||||
|
||||
**returns:**
|
||||
|
||||
* `obj`: an object representing the parsed value of `args`
|
||||
* `key/value`: key value pairs for each argument and their aliases.
|
||||
* `_`: an array representing the positional arguments.
|
||||
* [optional] `--`: an array with arguments after the end-of-options flag `--`.
|
||||
|
||||
### require('yargs-parser').detailed(args, opts={})
|
||||
|
||||
Parses a command line string, returning detailed information required by the
|
||||
yargs engine.
|
||||
|
||||
**expects:**
|
||||
|
||||
* `args`: a string or array of strings representing options to parse.
|
||||
* `opts`: provide a set of hints indicating how `args`, inputs are identical to `require('yargs-parser')(args, opts={})`.
|
||||
|
||||
**returns:**
|
||||
|
||||
* `argv`: an object representing the parsed value of `args`
|
||||
* `key/value`: key value pairs for each argument and their aliases.
|
||||
* `_`: an array representing the positional arguments.
|
||||
* `error`: populated with an error object if an exception occurred during parsing.
|
||||
* `aliases`: the inferred list of aliases built by combining lists in `opts.alias`.
|
||||
* `newAliases`: any new aliases added via camel-case expansion.
|
||||
* `configuration`: the configuration loaded from the `yargs` stanza in package.json.
|
||||
|
||||
<a name="configuration"></a>
|
||||
|
||||
### Configuration
|
||||
|
||||
The yargs-parser applies several automated transformations on the keys provided
|
||||
in `args`. These features can be turned on and off using the `configuration` field
|
||||
of `opts`.
|
||||
|
||||
```js
|
||||
var parsed = parser(['--no-dice'], {
|
||||
configuration: {
|
||||
'boolean-negation': false
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
### short option groups
|
||||
|
||||
* default: `true`.
|
||||
* key: `short-option-groups`.
|
||||
|
||||
Should a group of short-options be treated as boolean flags?
|
||||
|
||||
```sh
|
||||
node example.js -abc
|
||||
{ _: [], a: true, b: true, c: true }
|
||||
```
|
||||
|
||||
_if disabled:_
|
||||
|
||||
```sh
|
||||
node example.js -abc
|
||||
{ _: [], abc: true }
|
||||
```
|
||||
|
||||
### camel-case expansion
|
||||
|
||||
* default: `true`.
|
||||
* key: `camel-case-expansion`.
|
||||
|
||||
Should hyphenated arguments be expanded into camel-case aliases?
|
||||
|
||||
```sh
|
||||
node example.js --foo-bar
|
||||
{ _: [], 'foo-bar': true, fooBar: true }
|
||||
```
|
||||
|
||||
_if disabled:_
|
||||
|
||||
```sh
|
||||
node example.js --foo-bar
|
||||
{ _: [], 'foo-bar': true }
|
||||
```
|
||||
|
||||
### dot-notation
|
||||
|
||||
* default: `true`
|
||||
* key: `dot-notation`
|
||||
|
||||
Should keys that contain `.` be treated as objects?
|
||||
|
||||
```sh
|
||||
node example.js --foo.bar
|
||||
{ _: [], foo: { bar: true } }
|
||||
```
|
||||
|
||||
_if disabled:_
|
||||
|
||||
```sh
|
||||
node example.js --foo.bar
|
||||
{ _: [], "foo.bar": true }
|
||||
```
|
||||
|
||||
### parse numbers
|
||||
|
||||
* default: `true`
|
||||
* key: `parse-numbers`
|
||||
|
||||
Should keys that look like numbers be treated as such?
|
||||
|
||||
```sh
|
||||
node example.js --foo=99.3
|
||||
{ _: [], foo: 99.3 }
|
||||
```
|
||||
|
||||
_if disabled:_
|
||||
|
||||
```sh
|
||||
node example.js --foo=99.3
|
||||
{ _: [], foo: "99.3" }
|
||||
```
|
||||
|
||||
### boolean negation
|
||||
|
||||
* default: `true`
|
||||
* key: `boolean-negation`
|
||||
|
||||
Should variables prefixed with `--no` be treated as negations?
|
||||
|
||||
```sh
|
||||
node example.js --no-foo
|
||||
{ _: [], foo: false }
|
||||
```
|
||||
|
||||
_if disabled:_
|
||||
|
||||
```sh
|
||||
node example.js --no-foo
|
||||
{ _: [], "no-foo": true }
|
||||
```
|
||||
|
||||
### combine arrays
|
||||
|
||||
* default: `false`
|
||||
* key: `combine-arrays`
|
||||
|
||||
Should arrays be combined when provided by both command line arguments and
|
||||
a configuration file.
|
||||
|
||||
### duplicate arguments array
|
||||
|
||||
* default: `true`
|
||||
* key: `duplicate-arguments-array`
|
||||
|
||||
Should arguments be coerced into an array when duplicated:
|
||||
|
||||
```sh
|
||||
node example.js -x 1 -x 2
|
||||
{ _: [], x: [1, 2] }
|
||||
```
|
||||
|
||||
_if disabled:_
|
||||
|
||||
```sh
|
||||
node example.js -x 1 -x 2
|
||||
{ _: [], x: 2 }
|
||||
```
|
||||
|
||||
### flatten duplicate arrays
|
||||
|
||||
* default: `true`
|
||||
* key: `flatten-duplicate-arrays`
|
||||
|
||||
Should array arguments be coerced into a single array when duplicated:
|
||||
|
||||
```sh
|
||||
node example.js -x 1 2 -x 3 4
|
||||
{ _: [], x: [1, 2, 3, 4] }
|
||||
```
|
||||
|
||||
_if disabled:_
|
||||
|
||||
```sh
|
||||
node example.js -x 1 2 -x 3 4
|
||||
{ _: [], x: [[1, 2], [3, 4]] }
|
||||
```
|
||||
|
||||
### negation prefix
|
||||
|
||||
* default: `no-`
|
||||
* key: `negation-prefix`
|
||||
|
||||
The prefix to use for negated boolean variables.
|
||||
|
||||
```sh
|
||||
node example.js --no-foo
|
||||
{ _: [], foo: false }
|
||||
```
|
||||
|
||||
_if set to `quux`:_
|
||||
|
||||
```sh
|
||||
node example.js --quuxfoo
|
||||
{ _: [], foo: false }
|
||||
```
|
||||
|
||||
### populate --
|
||||
|
||||
* default: `false`.
|
||||
* key: `populate--`
|
||||
|
||||
Should unparsed flags be stored in `--` or `_`.
|
||||
|
||||
_If disabled:_
|
||||
|
||||
```sh
|
||||
node example.js a -b -- x y
|
||||
{ _: [ 'a', 'x', 'y' ], b: true }
|
||||
```
|
||||
|
||||
_If enabled:_
|
||||
|
||||
```sh
|
||||
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 }
|
||||
```
|
||||
|
||||
### halt at non-option
|
||||
|
||||
* default: `false`.
|
||||
* key: `halt-at-non-option`.
|
||||
|
||||
Should parsing stop at the first positional argument? This is similar to how e.g. `ssh` parses its command line.
|
||||
|
||||
_If disabled:_
|
||||
|
||||
```sh
|
||||
node example.js -a run b -x y
|
||||
{ _: [ 'b' ], a: 'run', x: 'y' }
|
||||
```
|
||||
|
||||
_If enabled:_
|
||||
|
||||
```sh
|
||||
node example.js -a run b -x y
|
||||
{ _: [ 'b', '-x', 'y' ], a: 'run' }
|
||||
```
|
||||
|
||||
### strip aliased
|
||||
|
||||
* default: `false`
|
||||
* key: `strip-aliased`
|
||||
|
||||
Should aliases be removed before returning results?
|
||||
|
||||
_If disabled:_
|
||||
|
||||
```sh
|
||||
node example.js --test-field 1
|
||||
{ _: [], 'test-field': 1, testField: 1, 'test-alias': 1, testAlias: 1 }
|
||||
```
|
||||
|
||||
_If enabled:_
|
||||
|
||||
```sh
|
||||
node example.js --test-field 1
|
||||
{ _: [], 'test-field': 1, testField: 1 }
|
||||
```
|
||||
|
||||
### strip dashed
|
||||
|
||||
* default: `false`
|
||||
* key: `strip-dashed`
|
||||
|
||||
Should dashed keys be removed before returning results? This option has no effect if
|
||||
`camel-case-exansion` is disabled.
|
||||
|
||||
_If disabled:_
|
||||
|
||||
```sh
|
||||
node example.js --test-field 1
|
||||
{ _: [], 'test-field': 1, testField: 1 }
|
||||
```
|
||||
|
||||
_If enabled:_
|
||||
|
||||
```sh
|
||||
node example.js --test-field 1
|
||||
{ _: [], testField: 1 }
|
||||
```
|
||||
|
||||
## Special Thanks
|
||||
|
||||
The yargs project evolves from optimist and minimist. It owes its
|
||||
existence to a lot of James Halliday's hard work. Thanks [substack](https://github.com/substack) **beep** **boop** \o/
|
||||
|
||||
## License
|
||||
|
||||
ISC
|
916
backend/node_modules/yargs/node_modules/yargs-parser/index.js
generated
vendored
Normal file
916
backend/node_modules/yargs/node_modules/yargs-parser/index.js
generated
vendored
Normal file
@@ -0,0 +1,916 @@
|
||||
var camelCase = require('camelcase')
|
||||
var decamelize = require('decamelize')
|
||||
var path = require('path')
|
||||
var tokenizeArgString = require('./lib/tokenize-arg-string')
|
||||
var util = require('util')
|
||||
|
||||
function parse (args, opts) {
|
||||
if (!opts) opts = {}
|
||||
// allow a string argument to be passed in rather
|
||||
// than an argv array.
|
||||
args = tokenizeArgString(args)
|
||||
|
||||
// aliases might have transitive relationships, normalize this.
|
||||
var aliases = combineAliases(opts.alias || {})
|
||||
var configuration = Object.assign({
|
||||
'short-option-groups': true,
|
||||
'camel-case-expansion': true,
|
||||
'dot-notation': true,
|
||||
'parse-numbers': true,
|
||||
'boolean-negation': true,
|
||||
'negation-prefix': 'no-',
|
||||
'duplicate-arguments-array': true,
|
||||
'flatten-duplicate-arrays': true,
|
||||
'populate--': false,
|
||||
'combine-arrays': false,
|
||||
'set-placeholder-key': false,
|
||||
'halt-at-non-option': false,
|
||||
'strip-aliased': false,
|
||||
'strip-dashed': false
|
||||
}, opts.configuration)
|
||||
var defaults = opts.default || {}
|
||||
var configObjects = opts.configObjects || []
|
||||
var envPrefix = opts.envPrefix
|
||||
var notFlagsOption = configuration['populate--']
|
||||
var notFlagsArgv = notFlagsOption ? '--' : '_'
|
||||
var newAliases = {}
|
||||
// allow a i18n handler to be passed in, default to a fake one (util.format).
|
||||
var __ = opts.__ || util.format
|
||||
var error = null
|
||||
var flags = {
|
||||
aliases: {},
|
||||
arrays: {},
|
||||
bools: {},
|
||||
strings: {},
|
||||
numbers: {},
|
||||
counts: {},
|
||||
normalize: {},
|
||||
configs: {},
|
||||
defaulted: {},
|
||||
nargs: {},
|
||||
coercions: {},
|
||||
keys: []
|
||||
}
|
||||
var negative = /^-[0-9]+(\.[0-9]+)?/
|
||||
var negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)')
|
||||
|
||||
;[].concat(opts.array).filter(Boolean).forEach(function (opt) {
|
||||
var key = opt.key || opt
|
||||
|
||||
// assign to flags[bools|strings|numbers]
|
||||
const assignment = Object.keys(opt).map(function (key) {
|
||||
return ({
|
||||
boolean: 'bools',
|
||||
string: 'strings',
|
||||
number: 'numbers'
|
||||
})[key]
|
||||
}).filter(Boolean).pop()
|
||||
|
||||
// assign key to be coerced
|
||||
if (assignment) {
|
||||
flags[assignment][key] = true
|
||||
}
|
||||
|
||||
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') {
|
||||
;[].concat(opts.config).filter(Boolean).forEach(function (key) {
|
||||
flags.configs[key] = true
|
||||
})
|
||||
} else {
|
||||
Object.keys(opts.config || {}).forEach(function (k) {
|
||||
flags.configs[k] = opts.config[k]
|
||||
})
|
||||
}
|
||||
|
||||
// create a lookup table that takes into account all
|
||||
// combinations of aliases: {f: ['foo'], foo: ['f']}
|
||||
extendAliases(opts.key, aliases, opts.default, flags.arrays)
|
||||
|
||||
// apply default values to all aliases.
|
||||
Object.keys(defaults).forEach(function (key) {
|
||||
(flags.aliases[key] || []).forEach(function (alias) {
|
||||
defaults[alias] = defaults[key]
|
||||
})
|
||||
})
|
||||
|
||||
var argv = { _: [] }
|
||||
|
||||
Object.keys(flags.bools).forEach(function (key) {
|
||||
if (Object.prototype.hasOwnProperty.call(defaults, key)) {
|
||||
setArg(key, defaults[key])
|
||||
setDefaulted(key)
|
||||
}
|
||||
})
|
||||
|
||||
var notFlags = []
|
||||
|
||||
for (var i = 0; i < args.length; i++) {
|
||||
var arg = args[i]
|
||||
var broken
|
||||
var key
|
||||
var letters
|
||||
var m
|
||||
var next
|
||||
var value
|
||||
|
||||
// -- separated by =
|
||||
if (arg.match(/^--.+=/) || (
|
||||
!configuration['short-option-groups'] && arg.match(/^-.+=/)
|
||||
)) {
|
||||
// Using [\s\S] instead of . because js doesn't support the
|
||||
// 'dotall' regex modifier. See:
|
||||
// http://stackoverflow.com/a/1068308/13216
|
||||
m = arg.match(/^--?([^=]+)=([\s\S]*)$/)
|
||||
|
||||
// nargs format = '--f=monkey washing cat'
|
||||
if (checkAllAliases(m[1], flags.nargs)) {
|
||||
args.splice(i + 1, 0, m[2])
|
||||
i = eatNargs(i, m[1], args)
|
||||
// arrays format = '--f=a b c'
|
||||
} else if (checkAllAliases(m[1], flags.arrays) && args.length > i + 1) {
|
||||
args.splice(i + 1, 0, m[2])
|
||||
i = eatArray(i, m[1], args)
|
||||
} else {
|
||||
setArg(m[1], m[2])
|
||||
}
|
||||
} else if (arg.match(negatedBoolean) && configuration['boolean-negation']) {
|
||||
key = arg.match(negatedBoolean)[1]
|
||||
setArg(key, false)
|
||||
|
||||
// -- seperated by space.
|
||||
} else if (arg.match(/^--.+/) || (
|
||||
!configuration['short-option-groups'] && arg.match(/^-[^-]+/)
|
||||
)) {
|
||||
key = arg.match(/^--?(.+)/)[1]
|
||||
|
||||
// nargs format = '--foo a b c'
|
||||
if (checkAllAliases(key, flags.nargs)) {
|
||||
i = eatNargs(i, key, args)
|
||||
// array format = '--foo a b c'
|
||||
} else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
|
||||
i = eatArray(i, key, args)
|
||||
} else {
|
||||
next = flags.nargs[key] === 0 ? undefined : args[i + 1]
|
||||
|
||||
if (next !== undefined && (!next.match(/^-/) ||
|
||||
next.match(negative)) &&
|
||||
!checkAllAliases(key, flags.bools) &&
|
||||
!checkAllAliases(key, flags.counts)) {
|
||||
setArg(key, next)
|
||||
i++
|
||||
} else if (/^(true|false)$/.test(next)) {
|
||||
setArg(key, next)
|
||||
i++
|
||||
} else {
|
||||
setArg(key, defaultValue(key))
|
||||
}
|
||||
}
|
||||
|
||||
// dot-notation flag seperated by '='.
|
||||
} else if (arg.match(/^-.\..+=/)) {
|
||||
m = arg.match(/^-([^=]+)=([\s\S]*)$/)
|
||||
setArg(m[1], m[2])
|
||||
|
||||
// dot-notation flag seperated by space.
|
||||
} else if (arg.match(/^-.\..+/)) {
|
||||
next = args[i + 1]
|
||||
key = arg.match(/^-(.\..+)/)[1]
|
||||
|
||||
if (next !== undefined && !next.match(/^-/) &&
|
||||
!checkAllAliases(key, flags.bools) &&
|
||||
!checkAllAliases(key, flags.counts)) {
|
||||
setArg(key, next)
|
||||
i++
|
||||
} else {
|
||||
setArg(key, defaultValue(key))
|
||||
}
|
||||
} else if (arg.match(/^-[^-]+/) && !arg.match(negative)) {
|
||||
letters = arg.slice(1, -1).split('')
|
||||
broken = false
|
||||
|
||||
for (var j = 0; j < letters.length; j++) {
|
||||
next = arg.slice(j + 2)
|
||||
|
||||
if (letters[j + 1] && letters[j + 1] === '=') {
|
||||
value = arg.slice(j + 3)
|
||||
key = letters[j]
|
||||
|
||||
// nargs format = '-f=monkey washing cat'
|
||||
if (checkAllAliases(key, flags.nargs)) {
|
||||
args.splice(i + 1, 0, value)
|
||||
i = eatNargs(i, key, args)
|
||||
// array format = '-f=a b c'
|
||||
} else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
|
||||
args.splice(i + 1, 0, value)
|
||||
i = eatArray(i, key, args)
|
||||
} else {
|
||||
setArg(key, value)
|
||||
}
|
||||
|
||||
broken = true
|
||||
break
|
||||
}
|
||||
|
||||
if (next === '-') {
|
||||
setArg(letters[j], next)
|
||||
continue
|
||||
}
|
||||
|
||||
// current letter is an alphabetic character and next value is a number
|
||||
if (/[A-Za-z]/.test(letters[j]) &&
|
||||
/^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
|
||||
setArg(letters[j], next)
|
||||
broken = true
|
||||
break
|
||||
}
|
||||
|
||||
if (letters[j + 1] && letters[j + 1].match(/\W/)) {
|
||||
setArg(letters[j], next)
|
||||
broken = true
|
||||
break
|
||||
} else {
|
||||
setArg(letters[j], defaultValue(letters[j]))
|
||||
}
|
||||
}
|
||||
|
||||
key = arg.slice(-1)[0]
|
||||
|
||||
if (!broken && key !== '-') {
|
||||
// nargs format = '-f a b c'
|
||||
if (checkAllAliases(key, flags.nargs)) {
|
||||
i = eatNargs(i, key, args)
|
||||
// array format = '-f a b c'
|
||||
} else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
|
||||
i = eatArray(i, key, args)
|
||||
} else {
|
||||
next = args[i + 1]
|
||||
|
||||
if (next !== undefined && (!/^(-|--)[^-]/.test(next) ||
|
||||
next.match(negative)) &&
|
||||
!checkAllAliases(key, flags.bools) &&
|
||||
!checkAllAliases(key, flags.counts)) {
|
||||
setArg(key, next)
|
||||
i++
|
||||
} else if (/^(true|false)$/.test(next)) {
|
||||
setArg(key, next)
|
||||
i++
|
||||
} else {
|
||||
setArg(key, defaultValue(key))
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (arg === '--') {
|
||||
notFlags = args.slice(i + 1)
|
||||
break
|
||||
} else if (configuration['halt-at-non-option']) {
|
||||
notFlags = args.slice(i)
|
||||
break
|
||||
} else {
|
||||
argv._.push(maybeCoerceNumber('_', arg))
|
||||
}
|
||||
}
|
||||
|
||||
// order of precedence:
|
||||
// 1. command line arg
|
||||
// 2. value from env var
|
||||
// 3. value from config file
|
||||
// 4. value from config objects
|
||||
// 5. configured default value
|
||||
applyEnvVars(argv, true) // special case: check env vars that point to config file
|
||||
applyEnvVars(argv, false)
|
||||
setConfig(argv)
|
||||
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) {
|
||||
if (!hasKey(argv, key.split('.'))) setArg(key, 0)
|
||||
})
|
||||
|
||||
// '--' defaults to undefined.
|
||||
if (notFlagsOption && notFlags.length) argv[notFlagsArgv] = []
|
||||
notFlags.forEach(function (key) {
|
||||
argv[notFlagsArgv].push(key)
|
||||
})
|
||||
|
||||
if (configuration['camel-case-expansion'] && configuration['strip-dashed']) {
|
||||
Object.keys(argv).filter(key => key !== '--' && key.includes('-')).forEach(key => {
|
||||
delete argv[key]
|
||||
})
|
||||
}
|
||||
|
||||
if (configuration['strip-aliased']) {
|
||||
// XXX Switch to [].concat(...Object.values(aliases)) once node.js 6 is dropped
|
||||
;[].concat(...Object.keys(aliases).map(k => aliases[k])).forEach(alias => {
|
||||
if (configuration['camel-case-expansion']) {
|
||||
delete argv[alias.split('.').map(prop => camelCase(prop)).join('.')]
|
||||
}
|
||||
|
||||
delete argv[alias]
|
||||
})
|
||||
}
|
||||
|
||||
// how many arguments should we consume, based
|
||||
// on the nargs option?
|
||||
function eatNargs (i, key, args) {
|
||||
var ii
|
||||
const toEat = checkAllAliases(key, flags.nargs)
|
||||
|
||||
// nargs will not consume flag arguments, e.g., -abc, --foo,
|
||||
// and terminates when one is observed.
|
||||
var available = 0
|
||||
for (ii = i + 1; ii < args.length; ii++) {
|
||||
if (!args[ii].match(/^-[^0-9]/)) available++
|
||||
else break
|
||||
}
|
||||
|
||||
if (available < toEat) error = Error(__('Not enough arguments following: %s', key))
|
||||
|
||||
const consumed = Math.min(available, toEat)
|
||||
for (ii = i + 1; ii < (consumed + i + 1); ii++) {
|
||||
setArg(key, args[ii])
|
||||
}
|
||||
|
||||
return (i + consumed)
|
||||
}
|
||||
|
||||
// if an option is an array, eat all non-hyphenated arguments
|
||||
// following it... YUM!
|
||||
// e.g., --foo apple banana cat becomes ["apple", "banana", "cat"]
|
||||
function eatArray (i, key, args) {
|
||||
var start = i + 1
|
||||
var argsToSet = []
|
||||
var multipleArrayFlag = i > 0
|
||||
for (var ii = i + 1; ii < args.length; ii++) {
|
||||
if (/^-/.test(args[ii]) && !negative.test(args[ii])) {
|
||||
if (ii === start) {
|
||||
setArg(key, defaultForType('array'))
|
||||
}
|
||||
multipleArrayFlag = true
|
||||
break
|
||||
}
|
||||
i = ii
|
||||
argsToSet.push(args[ii])
|
||||
}
|
||||
if (multipleArrayFlag) {
|
||||
setArg(key, argsToSet.map(function (arg) {
|
||||
return processValue(key, arg)
|
||||
}))
|
||||
} else {
|
||||
argsToSet.forEach(function (arg) {
|
||||
setArg(key, arg)
|
||||
})
|
||||
}
|
||||
|
||||
return i
|
||||
}
|
||||
|
||||
function setArg (key, val) {
|
||||
unsetDefaulted(key)
|
||||
|
||||
if (/-/.test(key) && configuration['camel-case-expansion']) {
|
||||
var alias = key.split('.').map(function (prop) {
|
||||
return camelCase(prop)
|
||||
}).join('.')
|
||||
addNewAlias(key, alias)
|
||||
}
|
||||
|
||||
var value = processValue(key, val)
|
||||
|
||||
var splitKey = key.split('.')
|
||||
setKey(argv, splitKey, value)
|
||||
|
||||
// handle populating aliases of the full key
|
||||
if (flags.aliases[key] && flags.aliases[key].forEach) {
|
||||
flags.aliases[key].forEach(function (x) {
|
||||
x = x.split('.')
|
||||
setKey(argv, x, value)
|
||||
})
|
||||
}
|
||||
|
||||
// handle populating aliases of the first element of the dot-notation key
|
||||
if (splitKey.length > 1 && configuration['dot-notation']) {
|
||||
;(flags.aliases[splitKey[0]] || []).forEach(function (x) {
|
||||
x = x.split('.')
|
||||
|
||||
// expand alias with nested objects in key
|
||||
var a = [].concat(splitKey)
|
||||
a.shift() // nuke the old key.
|
||||
x = x.concat(a)
|
||||
|
||||
setKey(argv, x, value)
|
||||
})
|
||||
}
|
||||
|
||||
// Set normalize getter and setter when key is in 'normalize' but isn't an array
|
||||
if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) {
|
||||
var keys = [key].concat(flags.aliases[key] || [])
|
||||
keys.forEach(function (key) {
|
||||
argv.__defineSetter__(key, function (v) {
|
||||
val = path.normalize(v)
|
||||
})
|
||||
|
||||
argv.__defineGetter__(key, function () {
|
||||
return typeof val === 'string' ? path.normalize(val) : val
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function addNewAlias (key, alias) {
|
||||
if (!(flags.aliases[key] && flags.aliases[key].length)) {
|
||||
flags.aliases[key] = [alias]
|
||||
newAliases[alias] = true
|
||||
}
|
||||
if (!(flags.aliases[alias] && flags.aliases[alias].length)) {
|
||||
addNewAlias(alias, key)
|
||||
}
|
||||
}
|
||||
|
||||
function processValue (key, val) {
|
||||
// strings may be quoted, clean this up as we assign values.
|
||||
if (typeof val === 'string' &&
|
||||
(val[0] === "'" || val[0] === '"') &&
|
||||
val[val.length - 1] === val[0]
|
||||
) {
|
||||
val = val.substring(1, val.length - 1)
|
||||
}
|
||||
|
||||
// handle parsing boolean arguments --foo=true --bar false.
|
||||
if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) {
|
||||
if (typeof val === 'string') val = val === 'true'
|
||||
}
|
||||
|
||||
var value = maybeCoerceNumber(key, val)
|
||||
|
||||
// increment a count given as arg (either no value or value parsed as boolean)
|
||||
if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) {
|
||||
value = increment
|
||||
}
|
||||
|
||||
// Set normalized value when key is in 'normalize' and in 'arrays'
|
||||
if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) {
|
||||
if (Array.isArray(val)) value = val.map(path.normalize)
|
||||
else value = path.normalize(val)
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
function maybeCoerceNumber (key, value) {
|
||||
if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.coercions)) {
|
||||
const shouldCoerceNumber = isNumber(value) && configuration['parse-numbers'] && (
|
||||
Number.isSafeInteger(Math.floor(value))
|
||||
)
|
||||
if (shouldCoerceNumber || (!isUndefined(value) && checkAllAliases(key, flags.numbers))) value = Number(value)
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
// set args from config.json file, this should be
|
||||
// applied last so that defaults can be applied.
|
||||
function setConfig (argv) {
|
||||
var configLookup = {}
|
||||
|
||||
// expand defaults/aliases, in-case any happen to reference
|
||||
// the config.json file.
|
||||
applyDefaultsAndAliases(configLookup, flags.aliases, defaults)
|
||||
|
||||
Object.keys(flags.configs).forEach(function (configKey) {
|
||||
var configPath = argv[configKey] || configLookup[configKey]
|
||||
if (configPath) {
|
||||
try {
|
||||
var config = null
|
||||
var resolvedConfigPath = path.resolve(process.cwd(), configPath)
|
||||
|
||||
if (typeof flags.configs[configKey] === 'function') {
|
||||
try {
|
||||
config = flags.configs[configKey](resolvedConfigPath)
|
||||
} catch (e) {
|
||||
config = e
|
||||
}
|
||||
if (config instanceof Error) {
|
||||
error = config
|
||||
return
|
||||
}
|
||||
} else {
|
||||
config = require(resolvedConfigPath)
|
||||
}
|
||||
|
||||
setConfigObject(config)
|
||||
} catch (ex) {
|
||||
if (argv[configKey]) error = Error(__('Invalid JSON config file: %s', configPath))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// set args from config object.
|
||||
// it recursively checks nested objects.
|
||||
function setConfigObject (config, prev) {
|
||||
Object.keys(config).forEach(function (key) {
|
||||
var value = config[key]
|
||||
var fullKey = prev ? prev + '.' + key : key
|
||||
|
||||
// if the value is an inner object and we have dot-notation
|
||||
// enabled, treat inner objects in config the same as
|
||||
// heavily nested dot notations (foo.bar.apple).
|
||||
if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) {
|
||||
// if the value is an object but not an array, check nested object
|
||||
setConfigObject(value, fullKey)
|
||||
} 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'])) {
|
||||
setArg(fullKey, value)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// set all config objects passed in opts
|
||||
function setConfigObjects () {
|
||||
if (typeof configObjects === 'undefined') return
|
||||
configObjects.forEach(function (configObject) {
|
||||
setConfigObject(configObject)
|
||||
})
|
||||
}
|
||||
|
||||
function applyEnvVars (argv, configOnly) {
|
||||
if (typeof envPrefix === 'undefined') return
|
||||
|
||||
var prefix = typeof envPrefix === 'string' ? envPrefix : ''
|
||||
Object.keys(process.env).forEach(function (envVar) {
|
||||
if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) {
|
||||
// get array of nested keys and convert them to camel case
|
||||
var keys = envVar.split('__').map(function (key, i) {
|
||||
if (i === 0) {
|
||||
key = key.substring(prefix.length)
|
||||
}
|
||||
return camelCase(key)
|
||||
})
|
||||
|
||||
if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && (!hasKey(argv, keys) || flags.defaulted[keys.join('.')])) {
|
||||
setArg(keys.join('.'), process.env[envVar])
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function applyCoercions (argv) {
|
||||
var coerce
|
||||
var applied = {}
|
||||
Object.keys(argv).forEach(function (key) {
|
||||
if (!applied.hasOwnProperty(key)) { // If we haven't already coerced this option via one of its aliases
|
||||
coerce = checkAllAliases(key, flags.coercions)
|
||||
if (typeof coerce === 'function') {
|
||||
try {
|
||||
var value = coerce(argv[key])
|
||||
;([].concat(flags.aliases[key] || [], key)).forEach(ali => {
|
||||
applied[ali] = argv[ali] = value
|
||||
})
|
||||
} catch (err) {
|
||||
error = err
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
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('.'))) {
|
||||
setKey(obj, key.split('.'), defaults[key])
|
||||
|
||||
;(aliases[key] || []).forEach(function (x) {
|
||||
if (hasKey(obj, x.split('.'))) return
|
||||
setKey(obj, x.split('.'), defaults[key])
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function hasKey (obj, keys) {
|
||||
var o = obj
|
||||
|
||||
if (!configuration['dot-notation']) keys = [keys.join('.')]
|
||||
|
||||
keys.slice(0, -1).forEach(function (key) {
|
||||
o = (o[key] || {})
|
||||
})
|
||||
|
||||
var key = keys[keys.length - 1]
|
||||
|
||||
if (typeof o !== 'object') return false
|
||||
else return key in o
|
||||
}
|
||||
|
||||
function setKey (obj, keys, value) {
|
||||
var o = obj
|
||||
|
||||
if (!configuration['dot-notation']) keys = [keys.join('.')]
|
||||
|
||||
keys.slice(0, -1).forEach(function (key, index) {
|
||||
// TODO(bcoe): in the next major version of yargs, switch to
|
||||
// Object.create(null) for dot notation:
|
||||
key = sanitizeKey(key)
|
||||
|
||||
if (typeof o === 'object' && o[key] === undefined) {
|
||||
o[key] = {}
|
||||
}
|
||||
|
||||
if (typeof o[key] !== 'object' || Array.isArray(o[key])) {
|
||||
// ensure that o[key] is an array, and that the last item is an empty object.
|
||||
if (Array.isArray(o[key])) {
|
||||
o[key].push({})
|
||||
} else {
|
||||
o[key] = [o[key], {}]
|
||||
}
|
||||
|
||||
// we want to update the empty object at the end of the o[key] array, so set o to that object
|
||||
o = o[key][o[key].length - 1]
|
||||
} else {
|
||||
o = o[key]
|
||||
}
|
||||
})
|
||||
|
||||
// TODO(bcoe): in the next major version of yargs, switch to
|
||||
// Object.create(null) for dot notation:
|
||||
const key = sanitizeKey(keys[keys.length - 1])
|
||||
|
||||
const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays)
|
||||
const isValueArray = Array.isArray(value)
|
||||
let duplicate = configuration['duplicate-arguments-array']
|
||||
|
||||
// nargs has higher priority than duplicate
|
||||
if (!duplicate && checkAllAliases(key, flags.nargs)) {
|
||||
duplicate = true
|
||||
if ((!isUndefined(o[key]) && flags.nargs[key] === 1) || (Array.isArray(o[key]) && o[key].length === flags.nargs[key])) {
|
||||
o[key] = undefined
|
||||
}
|
||||
}
|
||||
|
||||
if (value === increment) {
|
||||
o[key] = increment(o[key])
|
||||
} else if (Array.isArray(o[key])) {
|
||||
if (duplicate && isTypeArray && isValueArray) {
|
||||
o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value])
|
||||
} else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) {
|
||||
o[key] = value
|
||||
} else {
|
||||
o[key] = o[key].concat([value])
|
||||
}
|
||||
} else if (o[key] === undefined && isTypeArray) {
|
||||
o[key] = isValueArray ? value : [value]
|
||||
} else if (duplicate && !(o[key] === undefined || checkAllAliases(key, flags.bools) || checkAllAliases(keys.join('.'), flags.bools) || checkAllAliases(key, flags.counts))) {
|
||||
o[key] = [ o[key], value ]
|
||||
} else {
|
||||
o[key] = value
|
||||
}
|
||||
}
|
||||
|
||||
// extend the aliases list with inferred aliases.
|
||||
function extendAliases (...args) {
|
||||
args.forEach(function (obj) {
|
||||
Object.keys(obj || {}).forEach(function (key) {
|
||||
// short-circuit if we've already added a key
|
||||
// to the aliases array, for example it might
|
||||
// exist in both 'opts.default' and 'opts.key'.
|
||||
if (flags.aliases[key]) return
|
||||
|
||||
flags.aliases[key] = [].concat(aliases[key] || [])
|
||||
// For "--option-name", also set argv.optionName
|
||||
flags.aliases[key].concat(key).forEach(function (x) {
|
||||
if (/-/.test(x) && configuration['camel-case-expansion']) {
|
||||
var c = camelCase(x)
|
||||
if (c !== key && flags.aliases[key].indexOf(c) === -1) {
|
||||
flags.aliases[key].push(c)
|
||||
newAliases[c] = true
|
||||
}
|
||||
}
|
||||
})
|
||||
// For "--optionName", also set argv['option-name']
|
||||
flags.aliases[key].concat(key).forEach(function (x) {
|
||||
if (x.length > 1 && /[A-Z]/.test(x) && configuration['camel-case-expansion']) {
|
||||
var c = decamelize(x, '-')
|
||||
if (c !== key && flags.aliases[key].indexOf(c) === -1) {
|
||||
flags.aliases[key].push(c)
|
||||
newAliases[c] = true
|
||||
}
|
||||
}
|
||||
})
|
||||
flags.aliases[key].forEach(function (x) {
|
||||
flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) {
|
||||
return x !== y
|
||||
}))
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// check if a flag is set for any of a key's aliases.
|
||||
function checkAllAliases (key, flag) {
|
||||
var isSet = false
|
||||
var toCheck = [].concat(flags.aliases[key] || [], key)
|
||||
|
||||
toCheck.forEach(function (key) {
|
||||
if (flag[key]) isSet = flag[key]
|
||||
})
|
||||
|
||||
return isSet
|
||||
}
|
||||
|
||||
function setDefaulted (key) {
|
||||
[].concat(flags.aliases[key] || [], key).forEach(function (k) {
|
||||
flags.defaulted[k] = true
|
||||
})
|
||||
}
|
||||
|
||||
function unsetDefaulted (key) {
|
||||
[].concat(flags.aliases[key] || [], key).forEach(function (k) {
|
||||
delete flags.defaulted[k]
|
||||
})
|
||||
}
|
||||
|
||||
// make a best effor to pick a default value
|
||||
// for an option based on name and type.
|
||||
function defaultValue (key) {
|
||||
if (!checkAllAliases(key, flags.bools) &&
|
||||
!checkAllAliases(key, flags.counts) &&
|
||||
`${key}` in defaults) {
|
||||
return defaults[key]
|
||||
} else {
|
||||
return defaultForType(guessType(key))
|
||||
}
|
||||
}
|
||||
|
||||
// return a default value, given the type of a flag.,
|
||||
// e.g., key of type 'string' will default to '', rather than 'true'.
|
||||
function defaultForType (type) {
|
||||
var def = {
|
||||
boolean: true,
|
||||
string: '',
|
||||
number: undefined,
|
||||
array: []
|
||||
}
|
||||
|
||||
return def[type]
|
||||
}
|
||||
|
||||
// given a flag, enforce a default type.
|
||||
function guessType (key) {
|
||||
var type = 'boolean'
|
||||
|
||||
if (checkAllAliases(key, flags.strings)) type = 'string'
|
||||
else if (checkAllAliases(key, flags.numbers)) type = 'number'
|
||||
else if (checkAllAliases(key, flags.arrays)) type = 'array'
|
||||
|
||||
return type
|
||||
}
|
||||
|
||||
function isNumber (x) {
|
||||
if (x === null || x === undefined) return false
|
||||
// if loaded from config, may already be a number.
|
||||
if (typeof x === 'number') return true
|
||||
// hexadecimal.
|
||||
if (/^0x[0-9a-f]+$/i.test(x)) return true
|
||||
// don't treat 0123 as a number; as it drops the leading '0'.
|
||||
if (x.length > 1 && x[0] === '0') return false
|
||||
return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x)
|
||||
}
|
||||
|
||||
function isUndefined (num) {
|
||||
return num === undefined
|
||||
}
|
||||
|
||||
return {
|
||||
argv: argv,
|
||||
error: error,
|
||||
aliases: flags.aliases,
|
||||
newAliases: newAliases,
|
||||
configuration: configuration
|
||||
}
|
||||
}
|
||||
|
||||
// if any aliases reference each other, we should
|
||||
// merge them together.
|
||||
function combineAliases (aliases) {
|
||||
var aliasArrays = []
|
||||
var change = true
|
||||
var combined = {}
|
||||
|
||||
// turn alias lookup hash {key: ['alias1', 'alias2']} into
|
||||
// a simple array ['key', 'alias1', 'alias2']
|
||||
Object.keys(aliases).forEach(function (key) {
|
||||
aliasArrays.push(
|
||||
[].concat(aliases[key], key)
|
||||
)
|
||||
})
|
||||
|
||||
// combine arrays until zero changes are
|
||||
// made in an iteration.
|
||||
while (change) {
|
||||
change = false
|
||||
for (var i = 0; i < aliasArrays.length; i++) {
|
||||
for (var ii = i + 1; ii < aliasArrays.length; ii++) {
|
||||
var intersect = aliasArrays[i].filter(function (v) {
|
||||
return aliasArrays[ii].indexOf(v) !== -1
|
||||
})
|
||||
|
||||
if (intersect.length) {
|
||||
aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii])
|
||||
aliasArrays.splice(ii, 1)
|
||||
change = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// map arrays back to the hash-lookup (de-dupe while
|
||||
// we're at it).
|
||||
aliasArrays.forEach(function (aliasArray) {
|
||||
aliasArray = aliasArray.filter(function (v, i, self) {
|
||||
return self.indexOf(v) === i
|
||||
})
|
||||
combined[aliasArray.pop()] = aliasArray
|
||||
})
|
||||
|
||||
return combined
|
||||
}
|
||||
|
||||
// this function should only be called when a count is given as an arg
|
||||
// it is NOT called to set a default value
|
||||
// thus we can start the count at 1 instead of 0
|
||||
function increment (orig) {
|
||||
return orig !== undefined ? orig + 1 : 1
|
||||
}
|
||||
|
||||
function Parser (args, opts) {
|
||||
var result = parse(args.slice(), opts)
|
||||
|
||||
return result.argv
|
||||
}
|
||||
|
||||
// parse arguments and return detailed
|
||||
// meta information, aliases, etc.
|
||||
Parser.detailed = function (args, opts) {
|
||||
return parse(args.slice(), opts)
|
||||
}
|
||||
|
||||
// TODO(bcoe): in the next major version of yargs, switch to
|
||||
// Object.create(null) for dot notation:
|
||||
function sanitizeKey (key) {
|
||||
if (key === '__proto__') return '___proto___'
|
||||
return key
|
||||
}
|
||||
|
||||
module.exports = Parser
|
40
backend/node_modules/yargs/node_modules/yargs-parser/lib/tokenize-arg-string.js
generated
vendored
Normal file
40
backend/node_modules/yargs/node_modules/yargs-parser/lib/tokenize-arg-string.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
// take an un-split argv string and tokenize it.
|
||||
module.exports = function (argString) {
|
||||
if (Array.isArray(argString)) {
|
||||
return argString.map(e => typeof e !== 'string' ? e + '' : e)
|
||||
}
|
||||
|
||||
argString = argString.trim()
|
||||
|
||||
var i = 0
|
||||
var prevC = null
|
||||
var c = null
|
||||
var opening = null
|
||||
var args = []
|
||||
|
||||
for (var ii = 0; ii < argString.length; ii++) {
|
||||
prevC = c
|
||||
c = argString.charAt(ii)
|
||||
|
||||
// split on spaces unless we're in quotes.
|
||||
if (c === ' ' && !opening) {
|
||||
if (!(prevC === ' ')) {
|
||||
i++
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
// don't split the string if we're in matching
|
||||
// opening or closing single and double quotes.
|
||||
if (c === opening) {
|
||||
opening = null
|
||||
} else if ((c === "'" || c === '"') && !opening) {
|
||||
opening = c
|
||||
}
|
||||
|
||||
if (!args[i]) args[i] = ''
|
||||
args[i] += c
|
||||
}
|
||||
|
||||
return args
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user