agmd 0.3.3 → 0.3.5-beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/bin.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../node_modules/commander/lib/error.js", "../node_modules/commander/lib/argument.js", "../node_modules/commander/lib/help.js", "../node_modules/commander/lib/option.js", "../node_modules/commander/lib/suggestSimilar.js", "../node_modules/commander/lib/command.js", "../node_modules/commander/index.js", "../node_modules/kleur/index.js", "../node_modules/prompts/dist/util/action.js", "../node_modules/prompts/dist/util/strip.js", "../node_modules/sisteransi/src/index.js", "../node_modules/prompts/dist/util/clear.js", "../node_modules/prompts/dist/util/figures.js", "../node_modules/prompts/dist/util/style.js", "../node_modules/prompts/dist/util/lines.js", "../node_modules/prompts/dist/util/wrap.js", "../node_modules/prompts/dist/util/entriesToDisplay.js", "../node_modules/prompts/dist/util/index.js", "../node_modules/prompts/dist/elements/prompt.js", "../node_modules/prompts/dist/elements/text.js", "../node_modules/prompts/dist/elements/select.js", "../node_modules/prompts/dist/elements/toggle.js", "../node_modules/prompts/dist/dateparts/datepart.js", "../node_modules/prompts/dist/dateparts/meridiem.js", "../node_modules/prompts/dist/dateparts/day.js", "../node_modules/prompts/dist/dateparts/hours.js", "../node_modules/prompts/dist/dateparts/milliseconds.js", "../node_modules/prompts/dist/dateparts/minutes.js", "../node_modules/prompts/dist/dateparts/month.js", "../node_modules/prompts/dist/dateparts/seconds.js", "../node_modules/prompts/dist/dateparts/year.js", "../node_modules/prompts/dist/dateparts/index.js", "../node_modules/prompts/dist/elements/date.js", "../node_modules/prompts/dist/elements/number.js", "../node_modules/prompts/dist/elements/multiselect.js", "../node_modules/prompts/dist/elements/autocomplete.js", "../node_modules/prompts/dist/elements/autocompleteMultiselect.js", "../node_modules/prompts/dist/elements/confirm.js", "../node_modules/prompts/dist/elements/index.js", "../node_modules/prompts/dist/prompts.js", "../node_modules/prompts/dist/index.js", "../node_modules/prompts/lib/util/action.js", "../node_modules/prompts/lib/util/strip.js", "../node_modules/prompts/lib/util/clear.js", "../node_modules/prompts/lib/util/figures.js", "../node_modules/prompts/lib/util/style.js", "../node_modules/prompts/lib/util/lines.js", "../node_modules/prompts/lib/util/wrap.js", "../node_modules/prompts/lib/util/entriesToDisplay.js", "../node_modules/prompts/lib/util/index.js", "../node_modules/prompts/lib/elements/prompt.js", "../node_modules/prompts/lib/elements/text.js", "../node_modules/prompts/lib/elements/select.js", "../node_modules/prompts/lib/elements/toggle.js", "../node_modules/prompts/lib/dateparts/datepart.js", "../node_modules/prompts/lib/dateparts/meridiem.js", "../node_modules/prompts/lib/dateparts/day.js", "../node_modules/prompts/lib/dateparts/hours.js", "../node_modules/prompts/lib/dateparts/milliseconds.js", "../node_modules/prompts/lib/dateparts/minutes.js", "../node_modules/prompts/lib/dateparts/month.js", "../node_modules/prompts/lib/dateparts/seconds.js", "../node_modules/prompts/lib/dateparts/year.js", "../node_modules/prompts/lib/dateparts/index.js", "../node_modules/prompts/lib/elements/date.js", "../node_modules/prompts/lib/elements/number.js", "../node_modules/prompts/lib/elements/multiselect.js", "../node_modules/prompts/lib/elements/autocomplete.js", "../node_modules/prompts/lib/elements/autocompleteMultiselect.js", "../node_modules/prompts/lib/elements/confirm.js", "../node_modules/prompts/lib/elements/index.js", "../node_modules/prompts/lib/prompts.js", "../node_modules/prompts/lib/index.js", "../node_modules/prompts/index.js", "../node_modules/ms/index.js", "../node_modules/debug/src/common.js", "../node_modules/debug/src/browser.js", "../node_modules/has-flag/index.js", "../node_modules/supports-color/index.js", "../node_modules/debug/src/node.js", "../node_modules/debug/src/index.js", "../node_modules/_node-environment@0.5.1@node-environment/lib/compare-aliases.js", "../node_modules/_node-environment@0.5.1@node-environment/lib/modes.enum.js", "../node_modules/_node-environment@0.5.1@node-environment/lib/inspector.js", "../node_modules/_node-environment@0.5.1@node-environment/lib/index.js", "../node_modules/universalify/index.js", "../node_modules/graceful-fs/polyfills.js", "../node_modules/graceful-fs/legacy-streams.js", "../node_modules/graceful-fs/clone.js", "../node_modules/graceful-fs/graceful-fs.js", "../node_modules/fs-extra/lib/fs/index.js", "../node_modules/fs-extra/lib/mkdirs/utils.js", "../node_modules/fs-extra/lib/mkdirs/make-dir.js", "../node_modules/fs-extra/lib/mkdirs/index.js", "../node_modules/fs-extra/lib/path-exists/index.js", "../node_modules/fs-extra/lib/util/utimes.js", "../node_modules/fs-extra/lib/util/stat.js", "../node_modules/fs-extra/lib/copy/copy.js", "../node_modules/fs-extra/lib/copy/copy-sync.js", "../node_modules/fs-extra/lib/copy/index.js", "../node_modules/fs-extra/lib/remove/rimraf.js", "../node_modules/fs-extra/lib/remove/index.js", "../node_modules/fs-extra/lib/empty/index.js", "../node_modules/fs-extra/lib/ensure/file.js", "../node_modules/fs-extra/lib/ensure/link.js", "../node_modules/fs-extra/lib/ensure/symlink-paths.js", "../node_modules/fs-extra/lib/ensure/symlink-type.js", "../node_modules/fs-extra/lib/ensure/symlink.js", "../node_modules/fs-extra/lib/ensure/index.js", "../node_modules/jsonfile/utils.js", "../node_modules/jsonfile/index.js", "../node_modules/fs-extra/lib/json/jsonfile.js", "../node_modules/fs-extra/lib/output-file/index.js", "../node_modules/fs-extra/lib/json/output-json.js", "../node_modules/fs-extra/lib/json/output-json-sync.js", "../node_modules/fs-extra/lib/json/index.js", "../node_modules/fs-extra/lib/move/move.js", "../node_modules/fs-extra/lib/move/move-sync.js", "../node_modules/fs-extra/lib/move/index.js", "../node_modules/fs-extra/lib/index.js", "../node_modules/arg/index.js", "../src/bin.ts", "../src/commands/base.ts", "../src/commands/wirte-md.ts", "../src/commands/get-file.ts", "../src/commands/change-path.ts", "../node_modules/kolorist/src/index.ts", "../src/shared/logger.ts", "../src/commands/rename-path.ts", "../script/cli/index.ts", "../script/help/index.ts", "../script/cli/handle.ts", "../src/commands/mark-file.ts", "../src/commands/mark-write-file.ts", "../src/commands/get-router.ts"],
4
- "sourcesContent": ["// @ts-check\n\n/**\n * CommanderError class\n * @class\n */\nclass CommanderError extends Error {\n /**\n * Constructs the CommanderError class\n * @param {number} exitCode suggested exit code which could be used with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n * @constructor\n */\n constructor(exitCode, code, message) {\n super(message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n this.code = code;\n this.exitCode = exitCode;\n this.nestedError = undefined;\n }\n}\n\n/**\n * InvalidArgumentError class\n * @class\n */\nclass InvalidArgumentError extends CommanderError {\n /**\n * Constructs the InvalidArgumentError class\n * @param {string} [message] explanation of why argument is invalid\n * @constructor\n */\n constructor(message) {\n super(1, 'commander.invalidArgument', message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n }\n}\n\nexports.CommanderError = CommanderError;\nexports.InvalidArgumentError = InvalidArgumentError;\n", "const { InvalidArgumentError } = require('./error.js');\n\n// @ts-check\n\nclass Argument {\n /**\n * Initialize a new command argument with the given name and description.\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @param {string} name\n * @param {string} [description]\n */\n\n constructor(name, description) {\n this.description = description || '';\n this.variadic = false;\n this.parseArg = undefined;\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.argChoices = undefined;\n\n switch (name[0]) {\n case '<': // e.g. <required>\n this.required = true;\n this._name = name.slice(1, -1);\n break;\n case '[': // e.g. [optional]\n this.required = false;\n this._name = name.slice(1, -1);\n break;\n default:\n this.required = true;\n this._name = name;\n break;\n }\n\n if (this._name.length > 3 && this._name.slice(-3) === '...') {\n this.variadic = true;\n this._name = this._name.slice(0, -3);\n }\n }\n\n /**\n * Return argument name.\n *\n * @return {string}\n */\n\n name() {\n return this._name;\n };\n\n /**\n * @api private\n */\n\n _concatValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n return previous.concat(value);\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {any} value\n * @param {string} [description]\n * @return {Argument}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n };\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n *\n * @param {Function} [fn]\n * @return {Argument}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n };\n\n /**\n * Only allow option value to be one of choices.\n *\n * @param {string[]} values\n * @return {Argument}\n */\n\n choices(values) {\n this.argChoices = values;\n this.parseArg = (arg, previous) => {\n if (!values.includes(arg)) {\n throw new InvalidArgumentError(`Allowed choices are ${values.join(', ')}.`);\n }\n if (this.variadic) {\n return this._concatValue(arg, previous);\n }\n return arg;\n };\n return this;\n };\n\n /**\n * Make option-argument required.\n */\n argRequired() {\n this.required = true;\n return this;\n }\n\n /**\n * Make option-argument optional.\n */\n argOptional() {\n this.required = false;\n return this;\n }\n}\n\n/**\n * Takes an argument and returns its human readable equivalent for help usage.\n *\n * @param {Argument} arg\n * @return {string}\n * @api private\n */\n\nfunction humanReadableArgName(arg) {\n const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');\n\n return arg.required\n ? '<' + nameOutput + '>'\n : '[' + nameOutput + ']';\n}\n\nexports.Argument = Argument;\nexports.humanReadableArgName = humanReadableArgName;\n", "const { humanReadableArgName } = require('./argument.js');\n\n/**\n * TypeScript import types for JSDoc, used by Visual Studio Code IntelliSense and `npm run typescript-checkJS`\n * https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types\n * @typedef { import(\"./argument.js\").Argument } Argument\n * @typedef { import(\"./command.js\").Command } Command\n * @typedef { import(\"./option.js\").Option } Option\n */\n\n// @ts-check\n\n// Although this is a class, methods are static in style to allow override using subclass or just functions.\nclass Help {\n constructor() {\n this.helpWidth = undefined;\n this.sortSubcommands = false;\n this.sortOptions = false;\n }\n\n /**\n * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.\n *\n * @param {Command} cmd\n * @returns {Command[]}\n */\n\n visibleCommands(cmd) {\n const visibleCommands = cmd.commands.filter(cmd => !cmd._hidden);\n if (cmd._hasImplicitHelpCommand()) {\n // Create a command matching the implicit help command.\n const [, helpName, helpArgs] = cmd._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/);\n const helpCommand = cmd.createCommand(helpName)\n .helpOption(false);\n helpCommand.description(cmd._helpCommandDescription);\n if (helpArgs) helpCommand.arguments(helpArgs);\n visibleCommands.push(helpCommand);\n }\n if (this.sortSubcommands) {\n visibleCommands.sort((a, b) => {\n // @ts-ignore: overloaded return type\n return a.name().localeCompare(b.name());\n });\n }\n return visibleCommands;\n }\n\n /**\n * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleOptions(cmd) {\n const visibleOptions = cmd.options.filter((option) => !option.hidden);\n // Implicit help\n const showShortHelpFlag = cmd._hasHelpOption && cmd._helpShortFlag && !cmd._findOption(cmd._helpShortFlag);\n const showLongHelpFlag = cmd._hasHelpOption && !cmd._findOption(cmd._helpLongFlag);\n if (showShortHelpFlag || showLongHelpFlag) {\n let helpOption;\n if (!showShortHelpFlag) {\n helpOption = cmd.createOption(cmd._helpLongFlag, cmd._helpDescription);\n } else if (!showLongHelpFlag) {\n helpOption = cmd.createOption(cmd._helpShortFlag, cmd._helpDescription);\n } else {\n helpOption = cmd.createOption(cmd._helpFlags, cmd._helpDescription);\n }\n visibleOptions.push(helpOption);\n }\n if (this.sortOptions) {\n const getSortKey = (option) => {\n // WYSIWYG for order displayed in help with short before long, no special handling for negated.\n return option.short ? option.short.replace(/^-/, '') : option.long.replace(/^--/, '');\n };\n visibleOptions.sort((a, b) => {\n return getSortKey(a).localeCompare(getSortKey(b));\n });\n }\n return visibleOptions;\n }\n\n /**\n * Get an array of the arguments if any have a description.\n *\n * @param {Command} cmd\n * @returns {Argument[]}\n */\n\n visibleArguments(cmd) {\n // Side effect! Apply the legacy descriptions before the arguments are displayed.\n if (cmd._argsDescription) {\n cmd._args.forEach(argument => {\n argument.description = argument.description || cmd._argsDescription[argument.name()] || '';\n });\n }\n\n // If there are any arguments with a description then return all the arguments.\n if (cmd._args.find(argument => argument.description)) {\n return cmd._args;\n };\n return [];\n }\n\n /**\n * Get the command term to show in the list of subcommands.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandTerm(cmd) {\n // Legacy. Ignores custom usage string, and nested commands.\n const args = cmd._args.map(arg => humanReadableArgName(arg)).join(' ');\n return cmd._name +\n (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +\n (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option\n (args ? ' ' + args : '');\n }\n\n /**\n * Get the option term to show in the list of options.\n *\n * @param {Option} option\n * @returns {string}\n */\n\n optionTerm(option) {\n return option.flags;\n }\n\n /**\n * Get the argument term to show in the list of arguments.\n *\n * @param {Argument} argument\n * @returns {string}\n */\n\n argumentTerm(argument) {\n return argument.name();\n }\n\n /**\n * Get the longest command term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestSubcommandTermLength(cmd, helper) {\n return helper.visibleCommands(cmd).reduce((max, command) => {\n return Math.max(max, helper.subcommandTerm(command).length);\n }, 0);\n };\n\n /**\n * Get the longest option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestOptionTermLength(cmd, helper) {\n return helper.visibleOptions(cmd).reduce((max, option) => {\n return Math.max(max, helper.optionTerm(option).length);\n }, 0);\n };\n\n /**\n * Get the longest argument term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestArgumentTermLength(cmd, helper) {\n return helper.visibleArguments(cmd).reduce((max, argument) => {\n return Math.max(max, helper.argumentTerm(argument).length);\n }, 0);\n };\n\n /**\n * Get the command usage to be displayed at the top of the built-in help.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandUsage(cmd) {\n // Usage\n let cmdName = cmd._name;\n if (cmd._aliases[0]) {\n cmdName = cmdName + '|' + cmd._aliases[0];\n }\n let parentCmdNames = '';\n for (let parentCmd = cmd.parent; parentCmd; parentCmd = parentCmd.parent) {\n parentCmdNames = parentCmd.name() + ' ' + parentCmdNames;\n }\n return parentCmdNames + cmdName + ' ' + cmd.usage();\n }\n\n /**\n * Get the description for the command.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandDescription(cmd) {\n // @ts-ignore: overloaded return type\n return cmd.description();\n }\n\n /**\n * Get the command description to show in the list of subcommands.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandDescription(cmd) {\n // @ts-ignore: overloaded return type\n return cmd.description();\n }\n\n /**\n * Get the option description to show in the list of options.\n *\n * @param {Option} option\n * @return {string}\n */\n\n optionDescription(option) {\n const extraInfo = [];\n // Some of these do not make sense for negated boolean and suppress for backwards compatibility.\n\n if (option.argChoices && !option.negate) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`);\n }\n if (option.defaultValue !== undefined && !option.negate) {\n extraInfo.push(`default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`);\n }\n if (option.envVar !== undefined) {\n extraInfo.push(`env: ${option.envVar}`);\n }\n if (extraInfo.length > 0) {\n return `${option.description} (${extraInfo.join(', ')})`;\n }\n\n return option.description;\n };\n\n /**\n * Get the argument description to show in the list of arguments.\n *\n * @param {Argument} argument\n * @return {string}\n */\n\n argumentDescription(argument) {\n const extraInfo = [];\n if (argument.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`);\n }\n if (argument.defaultValue !== undefined) {\n extraInfo.push(`default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`);\n }\n if (extraInfo.length > 0) {\n const extraDescripton = `(${extraInfo.join(', ')})`;\n if (argument.description) {\n return `${argument.description} ${extraDescripton}`;\n }\n return extraDescripton;\n }\n return argument.description;\n }\n\n /**\n * Generate the built-in help text.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {string}\n */\n\n formatHelp(cmd, helper) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth || 80;\n const itemIndentWidth = 2;\n const itemSeparatorWidth = 2; // between term and description\n function formatItem(term, description) {\n if (description) {\n const fullText = `${term.padEnd(termWidth + itemSeparatorWidth)}${description}`;\n return helper.wrap(fullText, helpWidth - itemIndentWidth, termWidth + itemSeparatorWidth);\n }\n return term;\n };\n function formatList(textArray) {\n return textArray.join('\\n').replace(/^/gm, ' '.repeat(itemIndentWidth));\n }\n\n // Usage\n let output = [`Usage: ${helper.commandUsage(cmd)}`, ''];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([commandDescription, '']);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument) => {\n return formatItem(helper.argumentTerm(argument), helper.argumentDescription(argument));\n });\n if (argumentList.length > 0) {\n output = output.concat(['Arguments:', formatList(argumentList), '']);\n }\n\n // Options\n const optionList = helper.visibleOptions(cmd).map((option) => {\n return formatItem(helper.optionTerm(option), helper.optionDescription(option));\n });\n if (optionList.length > 0) {\n output = output.concat(['Options:', formatList(optionList), '']);\n }\n\n // Commands\n const commandList = helper.visibleCommands(cmd).map((cmd) => {\n return formatItem(helper.subcommandTerm(cmd), helper.subcommandDescription(cmd));\n });\n if (commandList.length > 0) {\n output = output.concat(['Commands:', formatList(commandList), '']);\n }\n\n return output.join('\\n');\n }\n\n /**\n * Calculate the pad width from the maximum term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n padWidth(cmd, helper) {\n return Math.max(\n helper.longestOptionTermLength(cmd, helper),\n helper.longestSubcommandTermLength(cmd, helper),\n helper.longestArgumentTermLength(cmd, helper)\n );\n };\n\n /**\n * Wrap the given string to width characters per line, with lines after the first indented.\n * Do not wrap if insufficient room for wrapping (minColumnWidth), or string is manually formatted.\n *\n * @param {string} str\n * @param {number} width\n * @param {number} indent\n * @param {number} [minColumnWidth=40]\n * @return {string}\n *\n */\n\n wrap(str, width, indent, minColumnWidth = 40) {\n // Detect manually wrapped and indented strings by searching for line breaks\n // followed by multiple spaces/tabs.\n if (str.match(/[\\n]\\s+/)) return str;\n // Do not wrap if not enough room for a wrapped column of text (as could end up with a word per line).\n const columnWidth = width - indent;\n if (columnWidth < minColumnWidth) return str;\n\n const leadingStr = str.substr(0, indent);\n const columnText = str.substr(indent);\n\n const indentString = ' '.repeat(indent);\n const regex = new RegExp('.{1,' + (columnWidth - 1) + '}([\\\\s\\u200B]|$)|[^\\\\s\\u200B]+?([\\\\s\\u200B]|$)', 'g');\n const lines = columnText.match(regex) || [];\n return leadingStr + lines.map((line, i) => {\n if (line.slice(-1) === '\\n') {\n line = line.slice(0, line.length - 1);\n }\n return ((i > 0) ? indentString : '') + line.trimRight();\n }).join('\\n');\n }\n}\n\nexports.Help = Help;\n", "const { InvalidArgumentError } = require('./error.js');\n\n// @ts-check\n\nclass Option {\n /**\n * Initialize a new `Option` with the given `flags` and `description`.\n *\n * @param {string} flags\n * @param {string} [description]\n */\n\n constructor(flags, description) {\n this.flags = flags;\n this.description = description || '';\n\n this.required = flags.includes('<'); // A value must be supplied when the option is specified.\n this.optional = flags.includes('['); // A value is optional when the option is specified.\n // variadic test ignores <value,...> et al which might be used to describe custom splitting of single argument\n this.variadic = /\\w\\.\\.\\.[>\\]]$/.test(flags); // The option can take multiple values.\n this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.\n const optionFlags = splitOptionFlags(flags);\n this.short = optionFlags.shortFlag;\n this.long = optionFlags.longFlag;\n this.negate = false;\n if (this.long) {\n this.negate = this.long.startsWith('--no-');\n }\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.envVar = undefined;\n this.parseArg = undefined;\n this.hidden = false;\n this.argChoices = undefined;\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {any} value\n * @param {string} [description]\n * @return {Option}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n };\n\n /**\n * Set environment variable to check for option value.\n * Priority order of option values is default < env < cli\n *\n * @param {string} name\n * @return {Option}\n */\n\n env(name) {\n this.envVar = name;\n return this;\n };\n\n /**\n * Set the custom handler for processing CLI option arguments into option values.\n *\n * @param {Function} [fn]\n * @return {Option}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n };\n\n /**\n * Whether the option is mandatory and must have a value after parsing.\n *\n * @param {boolean} [mandatory=true]\n * @return {Option}\n */\n\n makeOptionMandatory(mandatory = true) {\n this.mandatory = !!mandatory;\n return this;\n };\n\n /**\n * Hide option in help.\n *\n * @param {boolean} [hide=true]\n * @return {Option}\n */\n\n hideHelp(hide = true) {\n this.hidden = !!hide;\n return this;\n };\n\n /**\n * @api private\n */\n\n _concatValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n return previous.concat(value);\n }\n\n /**\n * Only allow option value to be one of choices.\n *\n * @param {string[]} values\n * @return {Option}\n */\n\n choices(values) {\n this.argChoices = values;\n this.parseArg = (arg, previous) => {\n if (!values.includes(arg)) {\n throw new InvalidArgumentError(`Allowed choices are ${values.join(', ')}.`);\n }\n if (this.variadic) {\n return this._concatValue(arg, previous);\n }\n return arg;\n };\n return this;\n };\n\n /**\n * Return option name.\n *\n * @return {string}\n */\n\n name() {\n if (this.long) {\n return this.long.replace(/^--/, '');\n }\n return this.short.replace(/^-/, '');\n };\n\n /**\n * Return option name, in a camelcase format that can be used\n * as a object attribute key.\n *\n * @return {string}\n * @api private\n */\n\n attributeName() {\n return camelcase(this.name().replace(/^no-/, ''));\n };\n\n /**\n * Check if `arg` matches the short or long flag.\n *\n * @param {string} arg\n * @return {boolean}\n * @api private\n */\n\n is(arg) {\n return this.short === arg || this.long === arg;\n };\n}\n\n/**\n * Convert string from kebab-case to camelCase.\n *\n * @param {string} str\n * @return {string}\n * @api private\n */\n\nfunction camelcase(str) {\n return str.split('-').reduce((str, word) => {\n return str + word[0].toUpperCase() + word.slice(1);\n });\n}\n\n/**\n * Split the short and long flag out of something like '-m,--mixed <value>'\n *\n * @api private\n */\n\nfunction splitOptionFlags(flags) {\n let shortFlag;\n let longFlag;\n // Use original very loose parsing to maintain backwards compatibility for now,\n // which allowed for example unintended `-sw, --short-word` [sic].\n const flagParts = flags.split(/[ |,]+/);\n if (flagParts.length > 1 && !/^[[<]/.test(flagParts[1])) shortFlag = flagParts.shift();\n longFlag = flagParts.shift();\n // Add support for lone short flag without significantly changing parsing!\n if (!shortFlag && /^-[^-]$/.test(longFlag)) {\n shortFlag = longFlag;\n longFlag = undefined;\n }\n return { shortFlag, longFlag };\n}\n\nexports.Option = Option;\nexports.splitOptionFlags = splitOptionFlags;\n", "const maxDistance = 3;\n\nfunction editDistance(a, b) {\n // https://en.wikipedia.org/wiki/Damerau\u2013Levenshtein_distance\n // Calculating optimal string alignment distance, no substring is edited more than once.\n // (Simple implementation.)\n\n // Quick early exit, return worst case.\n if (Math.abs(a.length - b.length) > maxDistance) return Math.max(a.length, b.length);\n\n // distance between prefix substrings of a and b\n const d = [];\n\n // pure deletions turn a into empty string\n for (let i = 0; i <= a.length; i++) {\n d[i] = [i];\n }\n // pure insertions turn empty string into b\n for (let j = 0; j <= b.length; j++) {\n d[0][j] = j;\n }\n\n // fill matrix\n for (let j = 1; j <= b.length; j++) {\n for (let i = 1; i <= a.length; i++) {\n let cost = 1;\n if (a[i - 1] === b[j - 1]) {\n cost = 0;\n } else {\n cost = 1;\n }\n d[i][j] = Math.min(\n d[i - 1][j] + 1, // deletion\n d[i][j - 1] + 1, // insertion\n d[i - 1][j - 1] + cost // substitution\n );\n // transposition\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);\n }\n }\n }\n\n return d[a.length][b.length];\n}\n\n/**\n * Find close matches, restricted to same number of edits.\n *\n * @param {string} word\n * @param {string[]} candidates\n * @returns {string}\n */\n\nfunction suggestSimilar(word, candidates) {\n if (!candidates || candidates.length === 0) return '';\n // remove possible duplicates\n candidates = Array.from(new Set(candidates));\n\n const searchingOptions = word.startsWith('--');\n if (searchingOptions) {\n word = word.slice(2);\n candidates = candidates.map(candidate => candidate.slice(2));\n }\n\n let similar = [];\n let bestDistance = maxDistance;\n const minSimilarity = 0.4;\n candidates.forEach((candidate) => {\n if (candidate.length <= 1) return; // no one character guesses\n\n const distance = editDistance(word, candidate);\n const length = Math.max(word.length, candidate.length);\n const similarity = (length - distance) / length;\n if (similarity > minSimilarity) {\n if (distance < bestDistance) {\n // better edit distance, throw away previous worse matches\n bestDistance = distance;\n similar = [candidate];\n } else if (distance === bestDistance) {\n similar.push(candidate);\n }\n }\n });\n\n similar.sort((a, b) => a.localeCompare(b));\n if (searchingOptions) {\n similar = similar.map(candidate => `--${candidate}`);\n }\n\n if (similar.length > 1) {\n return `\\n(Did you mean one of ${similar.join(', ')}?)`;\n }\n if (similar.length === 1) {\n return `\\n(Did you mean ${similar[0]}?)`;\n }\n return '';\n}\n\nexports.suggestSimilar = suggestSimilar;\n", "const EventEmitter = require('events').EventEmitter;\nconst childProcess = require('child_process');\nconst path = require('path');\nconst fs = require('fs');\n\nconst { Argument, humanReadableArgName } = require('./argument.js');\nconst { CommanderError } = require('./error.js');\nconst { Help } = require('./help.js');\nconst { Option, splitOptionFlags } = require('./option.js');\nconst { suggestSimilar } = require('./suggestSimilar');\n\n// @ts-check\n\nclass Command extends EventEmitter {\n /**\n * Initialize a new `Command`.\n *\n * @param {string} [name]\n */\n\n constructor(name) {\n super();\n /** @type {Command[]} */\n this.commands = [];\n /** @type {Option[]} */\n this.options = [];\n this.parent = null;\n this._allowUnknownOption = false;\n this._allowExcessArguments = true;\n /** @type {Argument[]} */\n this._args = [];\n /** @type {string[]} */\n this.args = []; // cli args with options removed\n this.rawArgs = [];\n this.processedArgs = []; // like .args but after custom processing and collecting variadic\n this._scriptPath = null;\n this._name = name || '';\n this._optionValues = {};\n this._optionValueSources = {}; // default < config < env < cli\n this._storeOptionsAsProperties = false;\n this._actionHandler = null;\n this._executableHandler = false;\n this._executableFile = null; // custom name for executable\n this._defaultCommandName = null;\n this._exitCallback = null;\n this._aliases = [];\n this._combineFlagAndOptionalValue = true;\n this._description = '';\n this._argsDescription = undefined; // legacy\n this._enablePositionalOptions = false;\n this._passThroughOptions = false;\n this._lifeCycleHooks = {}; // a hash of arrays\n /** @type {boolean | string} */\n this._showHelpAfterError = false;\n this._showSuggestionAfterError = false;\n\n // see .configureOutput() for docs\n this._outputConfiguration = {\n writeOut: (str) => process.stdout.write(str),\n writeErr: (str) => process.stderr.write(str),\n getOutHelpWidth: () => process.stdout.isTTY ? process.stdout.columns : undefined,\n getErrHelpWidth: () => process.stderr.isTTY ? process.stderr.columns : undefined,\n outputError: (str, write) => write(str)\n };\n\n this._hidden = false;\n this._hasHelpOption = true;\n this._helpFlags = '-h, --help';\n this._helpDescription = 'display help for command';\n this._helpShortFlag = '-h';\n this._helpLongFlag = '--help';\n this._addImplicitHelpCommand = undefined; // Deliberately undefined, not decided whether true or false\n this._helpCommandName = 'help';\n this._helpCommandnameAndArgs = 'help [command]';\n this._helpCommandDescription = 'display help for command';\n this._helpConfiguration = {};\n }\n\n /**\n * Copy settings that are useful to have in common across root command and subcommands.\n *\n * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)\n *\n * @param {Command} sourceCommand\n * @return {Command} returns `this` for executable command\n */\n copyInheritedSettings(sourceCommand) {\n this._outputConfiguration = sourceCommand._outputConfiguration;\n this._hasHelpOption = sourceCommand._hasHelpOption;\n this._helpFlags = sourceCommand._helpFlags;\n this._helpDescription = sourceCommand._helpDescription;\n this._helpShortFlag = sourceCommand._helpShortFlag;\n this._helpLongFlag = sourceCommand._helpLongFlag;\n this._helpCommandName = sourceCommand._helpCommandName;\n this._helpCommandnameAndArgs = sourceCommand._helpCommandnameAndArgs;\n this._helpCommandDescription = sourceCommand._helpCommandDescription;\n this._helpConfiguration = sourceCommand._helpConfiguration;\n this._exitCallback = sourceCommand._exitCallback;\n this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;\n this._combineFlagAndOptionalValue = sourceCommand._combineFlagAndOptionalValue;\n this._allowExcessArguments = sourceCommand._allowExcessArguments;\n this._enablePositionalOptions = sourceCommand._enablePositionalOptions;\n this._showHelpAfterError = sourceCommand._showHelpAfterError;\n this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;\n\n return this;\n }\n\n /**\n * Define a command.\n *\n * There are two styles of command: pay attention to where to put the description.\n *\n * @example\n * // Command implemented using action handler (description is supplied separately to `.command`)\n * program\n * .command('clone <source> [destination]')\n * .description('clone a repository into a newly created directory')\n * .action((source, destination) => {\n * console.log('clone command called');\n * });\n *\n * // Command implemented using separate executable file (description is second parameter to `.command`)\n * program\n * .command('start <service>', 'start named service')\n * .command('stop [service]', 'stop named service, or all if no name supplied');\n *\n * @param {string} nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`\n * @param {Object|string} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)\n * @param {Object} [execOpts] - configuration options (for executable)\n * @return {Command} returns new command for action handler, or `this` for executable command\n */\n\n command(nameAndArgs, actionOptsOrExecDesc, execOpts) {\n let desc = actionOptsOrExecDesc;\n let opts = execOpts;\n if (typeof desc === 'object' && desc !== null) {\n opts = desc;\n desc = null;\n }\n opts = opts || {};\n const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);\n\n const cmd = this.createCommand(name);\n if (desc) {\n cmd.description(desc);\n cmd._executableHandler = true;\n }\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden\n cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor\n if (args) cmd.arguments(args);\n this.commands.push(cmd);\n cmd.parent = this;\n cmd.copyInheritedSettings(this);\n\n if (desc) return this;\n return cmd;\n };\n\n /**\n * Factory routine to create a new unattached command.\n *\n * See .command() for creating an attached subcommand, which uses this routine to\n * create the command. You can override createCommand to customise subcommands.\n *\n * @param {string} [name]\n * @return {Command} new command\n */\n\n createCommand(name) {\n return new Command(name);\n };\n\n /**\n * You can customise the help with a subclass of Help by overriding createHelp,\n * or by overriding Help properties using configureHelp().\n *\n * @return {Help}\n */\n\n createHelp() {\n return Object.assign(new Help(), this.configureHelp());\n };\n\n /**\n * You can customise the help by overriding Help properties using configureHelp(),\n * or with a subclass of Help by overriding createHelp().\n *\n * @param {Object} [configuration] - configuration options\n * @return {Command|Object} `this` command for chaining, or stored configuration\n */\n\n configureHelp(configuration) {\n if (configuration === undefined) return this._helpConfiguration;\n\n this._helpConfiguration = configuration;\n return this;\n }\n\n /**\n * The default output goes to stdout and stderr. You can customise this for special\n * applications. You can also customise the display of errors by overriding outputError.\n *\n * The configuration properties are all functions:\n *\n * // functions to change where being written, stdout and stderr\n * writeOut(str)\n * writeErr(str)\n * // matching functions to specify width for wrapping help\n * getOutHelpWidth()\n * getErrHelpWidth()\n * // functions based on what is being written out\n * outputError(str, write) // used for displaying errors, and not used for displaying help\n *\n * @param {Object} [configuration] - configuration options\n * @return {Command|Object} `this` command for chaining, or stored configuration\n */\n\n configureOutput(configuration) {\n if (configuration === undefined) return this._outputConfiguration;\n\n Object.assign(this._outputConfiguration, configuration);\n return this;\n }\n\n /**\n * Display the help or a custom message after an error occurs.\n *\n * @param {boolean|string} [displayHelp]\n * @return {Command} `this` command for chaining\n */\n showHelpAfterError(displayHelp = true) {\n if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;\n this._showHelpAfterError = displayHelp;\n return this;\n }\n\n /**\n * Display suggestion of similar commands for unknown commands, or options for unknown options.\n *\n * @param {boolean} [displaySuggestion]\n * @return {Command} `this` command for chaining\n */\n showSuggestionAfterError(displaySuggestion = true) {\n this._showSuggestionAfterError = !!displaySuggestion;\n return this;\n }\n\n /**\n * Add a prepared subcommand.\n *\n * See .command() for creating an attached subcommand which inherits settings from its parent.\n *\n * @param {Command} cmd - new subcommand\n * @param {Object} [opts] - configuration options\n * @return {Command} `this` command for chaining\n */\n\n addCommand(cmd, opts) {\n if (!cmd._name) throw new Error('Command passed to .addCommand() must have a name');\n\n // To keep things simple, block automatic name generation for deeply nested executables.\n // Fail fast and detect when adding rather than later when parsing.\n function checkExplicitNames(commandArray) {\n commandArray.forEach((cmd) => {\n if (cmd._executableHandler && !cmd._executableFile) {\n throw new Error(`Must specify executableFile for deeply nested executable: ${cmd.name()}`);\n }\n checkExplicitNames(cmd.commands);\n });\n }\n checkExplicitNames(cmd.commands);\n\n opts = opts || {};\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation\n\n this.commands.push(cmd);\n cmd.parent = this;\n return this;\n };\n\n /**\n * Factory routine to create a new unattached argument.\n *\n * See .argument() for creating an attached argument, which uses this routine to\n * create the argument. You can override createArgument to return a custom argument.\n *\n * @param {string} name\n * @param {string} [description]\n * @return {Argument} new argument\n */\n\n createArgument(name, description) {\n return new Argument(name, description);\n };\n\n /**\n * Define argument syntax for command.\n *\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @example\n * program.argument('<input-file>');\n * program.argument('[output-file]');\n *\n * @param {string} name\n * @param {string} [description]\n * @param {Function|*} [fn] - custom argument processing function\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n argument(name, description, fn, defaultValue) {\n const argument = this.createArgument(name, description);\n if (typeof fn === 'function') {\n argument.default(defaultValue).argParser(fn);\n } else {\n argument.default(fn);\n }\n this.addArgument(argument);\n return this;\n }\n\n /**\n * Define argument syntax for command, adding multiple at once (without descriptions).\n *\n * See also .argument().\n *\n * @example\n * program.arguments('<cmd> [env]');\n *\n * @param {string} names\n * @return {Command} `this` command for chaining\n */\n\n arguments(names) {\n names.split(/ +/).forEach((detail) => {\n this.argument(detail);\n });\n return this;\n };\n\n /**\n * Define argument syntax for command, adding a prepared argument.\n *\n * @param {Argument} argument\n * @return {Command} `this` command for chaining\n */\n addArgument(argument) {\n const previousArgument = this._args.slice(-1)[0];\n if (previousArgument && previousArgument.variadic) {\n throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`);\n }\n if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) {\n throw new Error(`a default value for a required argument is never used: '${argument.name()}'`);\n }\n this._args.push(argument);\n return this;\n }\n\n /**\n * Override default decision whether to add implicit help command.\n *\n * addHelpCommand() // force on\n * addHelpCommand(false); // force off\n * addHelpCommand('help [cmd]', 'display help for [cmd]'); // force on with custom details\n *\n * @return {Command} `this` command for chaining\n */\n\n addHelpCommand(enableOrNameAndArgs, description) {\n if (enableOrNameAndArgs === false) {\n this._addImplicitHelpCommand = false;\n } else {\n this._addImplicitHelpCommand = true;\n if (typeof enableOrNameAndArgs === 'string') {\n this._helpCommandName = enableOrNameAndArgs.split(' ')[0];\n this._helpCommandnameAndArgs = enableOrNameAndArgs;\n }\n this._helpCommandDescription = description || this._helpCommandDescription;\n }\n return this;\n };\n\n /**\n * @return {boolean}\n * @api private\n */\n\n _hasImplicitHelpCommand() {\n if (this._addImplicitHelpCommand === undefined) {\n return this.commands.length && !this._actionHandler && !this._findCommand('help');\n }\n return this._addImplicitHelpCommand;\n };\n\n /**\n * Add hook for life cycle event.\n *\n * @param {string} event\n * @param {Function} listener\n * @return {Command} `this` command for chaining\n */\n\n hook(event, listener) {\n const allowedValues = ['preAction', 'postAction'];\n if (!allowedValues.includes(event)) {\n throw new Error(`Unexpected value for event passed to hook : '${event}'.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n if (this._lifeCycleHooks[event]) {\n this._lifeCycleHooks[event].push(listener);\n } else {\n this._lifeCycleHooks[event] = [listener];\n }\n return this;\n }\n\n /**\n * Register callback to use as replacement for calling process.exit.\n *\n * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing\n * @return {Command} `this` command for chaining\n */\n\n exitOverride(fn) {\n if (fn) {\n this._exitCallback = fn;\n } else {\n this._exitCallback = (err) => {\n if (err.code !== 'commander.executeSubCommandAsync') {\n throw err;\n } else {\n // Async callback from spawn events, not useful to throw.\n }\n };\n }\n return this;\n };\n\n /**\n * Call process.exit, and _exitCallback if defined.\n *\n * @param {number} exitCode exit code for using with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n * @return never\n * @api private\n */\n\n _exit(exitCode, code, message) {\n if (this._exitCallback) {\n this._exitCallback(new CommanderError(exitCode, code, message));\n // Expecting this line is not reached.\n }\n process.exit(exitCode);\n };\n\n /**\n * Register callback `fn` for the command.\n *\n * @example\n * program\n * .command('serve')\n * .description('start service')\n * .action(function() {\n * // do work here\n * });\n *\n * @param {Function} fn\n * @return {Command} `this` command for chaining\n */\n\n action(fn) {\n const listener = (args) => {\n // The .action callback takes an extra parameter which is the command or options.\n const expectedArgsCount = this._args.length;\n const actionArgs = args.slice(0, expectedArgsCount);\n if (this._storeOptionsAsProperties) {\n actionArgs[expectedArgsCount] = this; // backwards compatible \"options\"\n } else {\n actionArgs[expectedArgsCount] = this.opts();\n }\n actionArgs.push(this);\n\n return fn.apply(this, actionArgs);\n };\n this._actionHandler = listener;\n return this;\n };\n\n /**\n * Factory routine to create a new unattached option.\n *\n * See .option() for creating an attached option, which uses this routine to\n * create the option. You can override createOption to return a custom option.\n *\n * @param {string} flags\n * @param {string} [description]\n * @return {Option} new option\n */\n\n createOption(flags, description) {\n return new Option(flags, description);\n };\n\n /**\n * Add an option.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addOption(option) {\n const oname = option.name();\n const name = option.attributeName();\n\n let defaultValue = option.defaultValue;\n\n // preassign default value for --no-*, [optional], <required>, or plain flag if boolean value\n if (option.negate || option.optional || option.required || typeof defaultValue === 'boolean') {\n // when --no-foo we make sure default is true, unless a --foo option is already defined\n if (option.negate) {\n const positiveLongFlag = option.long.replace(/^--no-/, '--');\n defaultValue = this._findOption(positiveLongFlag) ? this.getOptionValue(name) : true;\n }\n // preassign only if we have a default\n if (defaultValue !== undefined) {\n this.setOptionValueWithSource(name, defaultValue, 'default');\n }\n }\n\n // register the option\n this.options.push(option);\n\n // handler for cli and env supplied values\n const handleOptionValue = (val, invalidValueMessage, valueSource) => {\n // Note: using closure to access lots of lexical scoped variables.\n const oldValue = this.getOptionValue(name);\n\n // custom processing\n if (val !== null && option.parseArg) {\n try {\n val = option.parseArg(val, oldValue === undefined ? defaultValue : oldValue);\n } catch (err) {\n if (err.code === 'commander.invalidArgument') {\n const message = `${invalidValueMessage} ${err.message}`;\n this._displayError(err.exitCode, err.code, message);\n }\n throw err;\n }\n } else if (val !== null && option.variadic) {\n val = option._concatValue(val, oldValue);\n }\n\n // unassigned or boolean value\n if (typeof oldValue === 'boolean' || typeof oldValue === 'undefined') {\n // if no value, negate false, and we have a default, then use it!\n if (val == null) {\n this.setOptionValueWithSource(name, option.negate ? false : defaultValue || true, valueSource);\n } else {\n this.setOptionValueWithSource(name, val, valueSource);\n }\n } else if (val !== null) {\n // reassign\n this.setOptionValueWithSource(name, option.negate ? false : val, valueSource);\n }\n };\n\n this.on('option:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'cli');\n });\n\n if (option.envVar) {\n this.on('optionEnv:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'env');\n });\n }\n\n return this;\n }\n\n /**\n * Internal implementation shared by .option() and .requiredOption()\n *\n * @api private\n */\n _optionEx(config, flags, description, fn, defaultValue) {\n const option = this.createOption(flags, description);\n option.makeOptionMandatory(!!config.mandatory);\n if (typeof fn === 'function') {\n option.default(defaultValue).argParser(fn);\n } else if (fn instanceof RegExp) {\n // deprecated\n const regex = fn;\n fn = (val, def) => {\n const m = regex.exec(val);\n return m ? m[0] : def;\n };\n option.default(defaultValue).argParser(fn);\n } else {\n option.default(fn);\n }\n\n return this.addOption(option);\n }\n\n /**\n * Define option with `flags`, `description` and optional\n * coercion `fn`.\n *\n * The `flags` string contains the short and/or long flags,\n * separated by comma, a pipe or space. The following are all valid\n * all will output this way when `--help` is used.\n *\n * \"-p, --pepper\"\n * \"-p|--pepper\"\n * \"-p --pepper\"\n *\n * @example\n * // simple boolean defaulting to undefined\n * program.option('-p, --pepper', 'add pepper');\n *\n * program.pepper\n * // => undefined\n *\n * --pepper\n * program.pepper\n * // => true\n *\n * // simple boolean defaulting to true (unless non-negated option is also defined)\n * program.option('-C, --no-cheese', 'remove cheese');\n *\n * program.cheese\n * // => true\n *\n * --no-cheese\n * program.cheese\n * // => false\n *\n * // required argument\n * program.option('-C, --chdir <path>', 'change the working directory');\n *\n * --chdir /tmp\n * program.chdir\n * // => \"/tmp\"\n *\n * // optional argument\n * program.option('-c, --cheese [type]', 'add cheese [marble]');\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {Function|*} [fn] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n option(flags, description, fn, defaultValue) {\n return this._optionEx({}, flags, description, fn, defaultValue);\n };\n\n /**\n * Add a required option which must have a value after parsing. This usually means\n * the option must be specified on the command line. (Otherwise the same as .option().)\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {Function|*} [fn] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n requiredOption(flags, description, fn, defaultValue) {\n return this._optionEx({ mandatory: true }, flags, description, fn, defaultValue);\n };\n\n /**\n * Alter parsing of short flags with optional values.\n *\n * @example\n * // for `.option('-f,--flag [value]'):\n * program.combineFlagAndOptionalValue(true); // `-f80` is treated like `--flag=80`, this is the default behaviour\n * program.combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`\n *\n * @param {Boolean} [combine=true] - if `true` or omitted, an optional value can be specified directly after the flag.\n */\n combineFlagAndOptionalValue(combine = true) {\n this._combineFlagAndOptionalValue = !!combine;\n return this;\n };\n\n /**\n * Allow unknown options on the command line.\n *\n * @param {Boolean} [allowUnknown=true] - if `true` or omitted, no error will be thrown\n * for unknown options.\n */\n allowUnknownOption(allowUnknown = true) {\n this._allowUnknownOption = !!allowUnknown;\n return this;\n };\n\n /**\n * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.\n *\n * @param {Boolean} [allowExcess=true] - if `true` or omitted, no error will be thrown\n * for excess arguments.\n */\n allowExcessArguments(allowExcess = true) {\n this._allowExcessArguments = !!allowExcess;\n return this;\n };\n\n /**\n * Enable positional options. Positional means global options are specified before subcommands which lets\n * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.\n * The default behaviour is non-positional and global options may appear anywhere on the command line.\n *\n * @param {Boolean} [positional=true]\n */\n enablePositionalOptions(positional = true) {\n this._enablePositionalOptions = !!positional;\n return this;\n };\n\n /**\n * Pass through options that come after command-arguments rather than treat them as command-options,\n * so actual command-options come before command-arguments. Turning this on for a subcommand requires\n * positional options to have been enabled on the program (parent commands).\n * The default behaviour is non-positional and options may appear before or after command-arguments.\n *\n * @param {Boolean} [passThrough=true]\n * for unknown options.\n */\n passThroughOptions(passThrough = true) {\n this._passThroughOptions = !!passThrough;\n if (!!this.parent && passThrough && !this.parent._enablePositionalOptions) {\n throw new Error('passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)');\n }\n return this;\n };\n\n /**\n * Whether to store option values as properties on command object,\n * or store separately (specify false). In both cases the option values can be accessed using .opts().\n *\n * @param {boolean} [storeAsProperties=true]\n * @return {Command} `this` command for chaining\n */\n\n storeOptionsAsProperties(storeAsProperties = true) {\n this._storeOptionsAsProperties = !!storeAsProperties;\n if (this.options.length) {\n throw new Error('call .storeOptionsAsProperties() before adding options');\n }\n return this;\n };\n\n /**\n * Retrieve option value.\n *\n * @param {string} key\n * @return {Object} value\n */\n\n getOptionValue(key) {\n if (this._storeOptionsAsProperties) {\n return this[key];\n }\n return this._optionValues[key];\n };\n\n /**\n * Store option value.\n *\n * @param {string} key\n * @param {Object} value\n * @return {Command} `this` command for chaining\n */\n\n setOptionValue(key, value) {\n if (this._storeOptionsAsProperties) {\n this[key] = value;\n } else {\n this._optionValues[key] = value;\n }\n return this;\n };\n\n /**\n * Store option value and where the value came from.\n *\n * @param {string} key\n * @param {Object} value\n * @param {string} source - expected values are default/config/env/cli\n * @return {Command} `this` command for chaining\n */\n\n setOptionValueWithSource(key, value, source) {\n this.setOptionValue(key, value);\n this._optionValueSources[key] = source;\n return this;\n }\n\n /**\n * Get source of option value.\n * Expected values are default | config | env | cli\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSource(key) {\n return this._optionValueSources[key];\n };\n\n /**\n * Get user arguments implied or explicit arguments.\n * Side-effects: set _scriptPath if args included application, and use that to set implicit command name.\n *\n * @api private\n */\n\n _prepareUserArgs(argv, parseOptions) {\n if (argv !== undefined && !Array.isArray(argv)) {\n throw new Error('first parameter to parse must be array or undefined');\n }\n parseOptions = parseOptions || {};\n\n // Default to using process.argv\n if (argv === undefined) {\n argv = process.argv;\n // @ts-ignore: unknown property\n if (process.versions && process.versions.electron) {\n parseOptions.from = 'electron';\n }\n }\n this.rawArgs = argv.slice();\n\n // make it a little easier for callers by supporting various argv conventions\n let userArgs;\n switch (parseOptions.from) {\n case undefined:\n case 'node':\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n break;\n case 'electron':\n // @ts-ignore: unknown property\n if (process.defaultApp) {\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n } else {\n userArgs = argv.slice(1);\n }\n break;\n case 'user':\n userArgs = argv.slice(0);\n break;\n default:\n throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`);\n }\n if (!this._scriptPath && require.main) {\n this._scriptPath = require.main.filename;\n }\n\n // Guess name, used in usage in help.\n this._name = this._name || (this._scriptPath && path.basename(this._scriptPath, path.extname(this._scriptPath)));\n\n return userArgs;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * The default expectation is that the arguments are from node and have the application as argv[0]\n * and the script being run in argv[1], with user parameters after that.\n *\n * @example\n * program.parse(process.argv);\n * program.parse(); // implicitly use process.argv and auto-detect node vs electron conventions\n * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv] - optional, defaults to process.argv\n * @param {Object} [parseOptions] - optionally specify style of options with from: node/user/electron\n * @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron'\n * @return {Command} `this` command for chaining\n */\n\n parse(argv, parseOptions) {\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n this._parseCommand([], userArgs);\n\n return this;\n };\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise.\n *\n * The default expectation is that the arguments are from node and have the application as argv[0]\n * and the script being run in argv[1], with user parameters after that.\n *\n * @example\n * await program.parseAsync(process.argv);\n * await program.parseAsync(); // implicitly use process.argv and auto-detect node vs electron conventions\n * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv]\n * @param {Object} [parseOptions]\n * @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron'\n * @return {Promise}\n */\n\n async parseAsync(argv, parseOptions) {\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n await this._parseCommand([], userArgs);\n\n return this;\n };\n\n /**\n * Execute a sub-command executable.\n *\n * @api private\n */\n\n _executeSubCommand(subcommand, args) {\n args = args.slice();\n let launchWithNode = false; // Use node for source targets so do not need to get permissions correct, and on Windows.\n const sourceExt = ['.js', '.ts', '.tsx', '.mjs', '.cjs'];\n\n // Not checking for help first. Unlikely to have mandatory and executable, and can't robustly test for help flags in external command.\n this._checkForMissingMandatoryOptions();\n\n // Want the entry script as the reference for command name and directory for searching for other files.\n let scriptPath = this._scriptPath;\n // Fallback in case not set, due to how Command created or called.\n if (!scriptPath && require.main) {\n scriptPath = require.main.filename;\n }\n\n let baseDir;\n try {\n const resolvedLink = fs.realpathSync(scriptPath);\n baseDir = path.dirname(resolvedLink);\n } catch (e) {\n baseDir = '.'; // dummy, probably not going to find executable!\n }\n\n // name of the subcommand, like `pm-install`\n let bin = path.basename(scriptPath, path.extname(scriptPath)) + '-' + subcommand._name;\n if (subcommand._executableFile) {\n bin = subcommand._executableFile;\n }\n\n const localBin = path.join(baseDir, bin);\n if (fs.existsSync(localBin)) {\n // prefer local `./<bin>` to bin in the $PATH\n bin = localBin;\n } else {\n // Look for source files.\n sourceExt.forEach((ext) => {\n if (fs.existsSync(`${localBin}${ext}`)) {\n bin = `${localBin}${ext}`;\n }\n });\n }\n launchWithNode = sourceExt.includes(path.extname(bin));\n\n let proc;\n if (process.platform !== 'win32') {\n if (launchWithNode) {\n args.unshift(bin);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n\n proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });\n } else {\n proc = childProcess.spawn(bin, args, { stdio: 'inherit' });\n }\n } else {\n args.unshift(bin);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });\n }\n\n const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];\n signals.forEach((signal) => {\n // @ts-ignore\n process.on(signal, () => {\n if (proc.killed === false && proc.exitCode === null) {\n proc.kill(signal);\n }\n });\n });\n\n // By default terminate process when spawned process terminates.\n // Suppressing the exit if exitCallback defined is a bit messy and of limited use, but does allow process to stay running!\n const exitCallback = this._exitCallback;\n if (!exitCallback) {\n proc.on('close', process.exit.bind(process));\n } else {\n proc.on('close', () => {\n exitCallback(new CommanderError(process.exitCode || 0, 'commander.executeSubCommandAsync', '(close)'));\n });\n }\n proc.on('error', (err) => {\n // @ts-ignore\n if (err.code === 'ENOENT') {\n const executableMissing = `'${bin}' does not exist\n - if '${subcommand._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name`;\n throw new Error(executableMissing);\n // @ts-ignore\n } else if (err.code === 'EACCES') {\n throw new Error(`'${bin}' not executable`);\n }\n if (!exitCallback) {\n process.exit(1);\n } else {\n const wrappedError = new CommanderError(1, 'commander.executeSubCommandAsync', '(error)');\n wrappedError.nestedError = err;\n exitCallback(wrappedError);\n }\n });\n\n // Store the reference to the child process\n this.runningCommand = proc;\n };\n\n /**\n * @api private\n */\n\n _dispatchSubcommand(commandName, operands, unknown) {\n const subCommand = this._findCommand(commandName);\n if (!subCommand) this.help({ error: true });\n\n if (subCommand._executableHandler) {\n this._executeSubCommand(subCommand, operands.concat(unknown));\n } else {\n return subCommand._parseCommand(operands, unknown);\n }\n };\n\n /**\n * Check this.args against expected this._args.\n *\n * @api private\n */\n\n _checkNumberOfArguments() {\n // too few\n this._args.forEach((arg, i) => {\n if (arg.required && this.args[i] == null) {\n this.missingArgument(arg.name());\n }\n });\n // too many\n if (this._args.length > 0 && this._args[this._args.length - 1].variadic) {\n return;\n }\n if (this.args.length > this._args.length) {\n this._excessArguments(this.args);\n }\n };\n\n /**\n * Process this.args using this._args and save as this.processedArgs!\n *\n * @api private\n */\n\n _processArguments() {\n const myParseArg = (argument, value, previous) => {\n // Extra processing for nice error message on parsing failure.\n let parsedValue = value;\n if (value !== null && argument.parseArg) {\n try {\n parsedValue = argument.parseArg(value, previous);\n } catch (err) {\n if (err.code === 'commander.invalidArgument') {\n const message = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'. ${err.message}`;\n this._displayError(err.exitCode, err.code, message);\n }\n throw err;\n }\n }\n return parsedValue;\n };\n\n this._checkNumberOfArguments();\n\n const processedArgs = [];\n this._args.forEach((declaredArg, index) => {\n let value = declaredArg.defaultValue;\n if (declaredArg.variadic) {\n // Collect together remaining arguments for passing together as an array.\n if (index < this.args.length) {\n value = this.args.slice(index);\n if (declaredArg.parseArg) {\n value = value.reduce((processed, v) => {\n return myParseArg(declaredArg, v, processed);\n }, declaredArg.defaultValue);\n }\n } else if (value === undefined) {\n value = [];\n }\n } else if (index < this.args.length) {\n value = this.args[index];\n if (declaredArg.parseArg) {\n value = myParseArg(declaredArg, value, declaredArg.defaultValue);\n }\n }\n processedArgs[index] = value;\n });\n this.processedArgs = processedArgs;\n }\n\n /**\n * Once we have a promise we chain, but call synchronously until then.\n *\n * @param {Promise|undefined} promise\n * @param {Function} fn\n * @return {Promise|undefined}\n * @api private\n */\n\n _chainOrCall(promise, fn) {\n // thenable\n if (promise && promise.then && typeof promise.then === 'function') {\n // already have a promise, chain callback\n return promise.then(() => fn());\n }\n // callback might return a promise\n return fn();\n }\n\n /**\n *\n * @param {Promise|undefined} promise\n * @param {string} event\n * @return {Promise|undefined}\n * @api private\n */\n\n _chainOrCallHooks(promise, event) {\n let result = promise;\n const hooks = [];\n getCommandAndParents(this)\n .reverse()\n .filter(cmd => cmd._lifeCycleHooks[event] !== undefined)\n .forEach(hookedCommand => {\n hookedCommand._lifeCycleHooks[event].forEach((callback) => {\n hooks.push({ hookedCommand, callback });\n });\n });\n if (event === 'postAction') {\n hooks.reverse();\n }\n\n hooks.forEach((hookDetail) => {\n result = this._chainOrCall(result, () => {\n return hookDetail.callback(hookDetail.hookedCommand, this);\n });\n });\n return result;\n }\n\n /**\n * Process arguments in context of this command.\n * Returns action result, in case it is a promise.\n *\n * @api private\n */\n\n _parseCommand(operands, unknown) {\n const parsed = this.parseOptions(unknown);\n this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env\n operands = operands.concat(parsed.operands);\n unknown = parsed.unknown;\n this.args = operands.concat(unknown);\n\n if (operands && this._findCommand(operands[0])) {\n return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);\n }\n if (this._hasImplicitHelpCommand() && operands[0] === this._helpCommandName) {\n if (operands.length === 1) {\n this.help();\n }\n return this._dispatchSubcommand(operands[1], [], [this._helpLongFlag]);\n }\n if (this._defaultCommandName) {\n outputHelpIfRequested(this, unknown); // Run the help for default command from parent rather than passing to default command\n return this._dispatchSubcommand(this._defaultCommandName, operands, unknown);\n }\n if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) {\n // probably missing subcommand and no handler, user needs help (and exit)\n this.help({ error: true });\n }\n\n outputHelpIfRequested(this, parsed.unknown);\n this._checkForMissingMandatoryOptions();\n\n // We do not always call this check to avoid masking a \"better\" error, like unknown command.\n const checkForUnknownOptions = () => {\n if (parsed.unknown.length > 0) {\n this.unknownOption(parsed.unknown[0]);\n }\n };\n\n const commandEvent = `command:${this.name()}`;\n if (this._actionHandler) {\n checkForUnknownOptions();\n this._processArguments();\n\n let actionResult;\n actionResult = this._chainOrCallHooks(actionResult, 'preAction');\n actionResult = this._chainOrCall(actionResult, () => this._actionHandler(this.processedArgs));\n if (this.parent) this.parent.emit(commandEvent, operands, unknown); // legacy\n actionResult = this._chainOrCallHooks(actionResult, 'postAction');\n return actionResult;\n }\n if (this.parent && this.parent.listenerCount(commandEvent)) {\n checkForUnknownOptions();\n this._processArguments();\n this.parent.emit(commandEvent, operands, unknown); // legacy\n } else if (operands.length) {\n if (this._findCommand('*')) { // legacy default command\n return this._dispatchSubcommand('*', operands, unknown);\n }\n if (this.listenerCount('command:*')) {\n // skip option check, emit event for possible misspelling suggestion\n this.emit('command:*', operands, unknown);\n } else if (this.commands.length) {\n this.unknownCommand();\n } else {\n checkForUnknownOptions();\n this._processArguments();\n }\n } else if (this.commands.length) {\n checkForUnknownOptions();\n // This command has subcommands and nothing hooked up at this level, so display help (and exit).\n this.help({ error: true });\n } else {\n checkForUnknownOptions();\n this._processArguments();\n // fall through for caller to handle after calling .parse()\n }\n };\n\n /**\n * Find matching command.\n *\n * @api private\n */\n _findCommand(name) {\n if (!name) return undefined;\n return this.commands.find(cmd => cmd._name === name || cmd._aliases.includes(name));\n };\n\n /**\n * Return an option matching `arg` if any.\n *\n * @param {string} arg\n * @return {Option}\n * @api private\n */\n\n _findOption(arg) {\n return this.options.find(option => option.is(arg));\n };\n\n /**\n * Display an error message if a mandatory option does not have a value.\n * Lazy calling after checking for help flags from leaf subcommand.\n *\n * @api private\n */\n\n _checkForMissingMandatoryOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n for (let cmd = this; cmd; cmd = cmd.parent) {\n cmd.options.forEach((anOption) => {\n if (anOption.mandatory && (cmd.getOptionValue(anOption.attributeName()) === undefined)) {\n cmd.missingMandatoryOptionValue(anOption);\n }\n });\n }\n };\n\n /**\n * Parse options from `argv` removing known options,\n * and return argv split into operands and unknown arguments.\n *\n * Examples:\n *\n * argv => operands, unknown\n * --known kkk op => [op], []\n * op --known kkk => [op], []\n * sub --unknown uuu op => [sub], [--unknown uuu op]\n * sub -- --unknown uuu op => [sub --unknown uuu op], []\n *\n * @param {String[]} argv\n * @return {{operands: String[], unknown: String[]}}\n */\n\n parseOptions(argv) {\n const operands = []; // operands, not options or values\n const unknown = []; // first unknown option and remaining unknown args\n let dest = operands;\n const args = argv.slice();\n\n function maybeOption(arg) {\n return arg.length > 1 && arg[0] === '-';\n }\n\n // parse options\n let activeVariadicOption = null;\n while (args.length) {\n const arg = args.shift();\n\n // literal\n if (arg === '--') {\n if (dest === unknown) dest.push(arg);\n dest.push(...args);\n break;\n }\n\n if (activeVariadicOption && !maybeOption(arg)) {\n this.emit(`option:${activeVariadicOption.name()}`, arg);\n continue;\n }\n activeVariadicOption = null;\n\n if (maybeOption(arg)) {\n const option = this._findOption(arg);\n // recognised option, call listener to assign value with possible custom processing\n if (option) {\n if (option.required) {\n const value = args.shift();\n if (value === undefined) this.optionMissingArgument(option);\n this.emit(`option:${option.name()}`, value);\n } else if (option.optional) {\n let value = null;\n // historical behaviour is optional value is following arg unless an option\n if (args.length > 0 && !maybeOption(args[0])) {\n value = args.shift();\n }\n this.emit(`option:${option.name()}`, value);\n } else { // boolean flag\n this.emit(`option:${option.name()}`);\n }\n activeVariadicOption = option.variadic ? option : null;\n continue;\n }\n }\n\n // Look for combo options following single dash, eat first one if known.\n if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {\n const option = this._findOption(`-${arg[1]}`);\n if (option) {\n if (option.required || (option.optional && this._combineFlagAndOptionalValue)) {\n // option with value following in same argument\n this.emit(`option:${option.name()}`, arg.slice(2));\n } else {\n // boolean option, emit and put back remainder of arg for further processing\n this.emit(`option:${option.name()}`);\n args.unshift(`-${arg.slice(2)}`);\n }\n continue;\n }\n }\n\n // Look for known long flag with value, like --foo=bar\n if (/^--[^=]+=/.test(arg)) {\n const index = arg.indexOf('=');\n const option = this._findOption(arg.slice(0, index));\n if (option && (option.required || option.optional)) {\n this.emit(`option:${option.name()}`, arg.slice(index + 1));\n continue;\n }\n }\n\n // Not a recognised option by this command.\n // Might be a command-argument, or subcommand option, or unknown option, or help command or option.\n\n // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.\n if (maybeOption(arg)) {\n dest = unknown;\n }\n\n // If using positionalOptions, stop processing our options at subcommand.\n if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) {\n if (this._findCommand(arg)) {\n operands.push(arg);\n if (args.length > 0) unknown.push(...args);\n break;\n } else if (arg === this._helpCommandName && this._hasImplicitHelpCommand()) {\n operands.push(arg);\n if (args.length > 0) operands.push(...args);\n break;\n } else if (this._defaultCommandName) {\n unknown.push(arg);\n if (args.length > 0) unknown.push(...args);\n break;\n }\n }\n\n // If using passThroughOptions, stop processing options at first command-argument.\n if (this._passThroughOptions) {\n dest.push(arg);\n if (args.length > 0) dest.push(...args);\n break;\n }\n\n // add arg\n dest.push(arg);\n }\n\n return { operands, unknown };\n };\n\n /**\n * Return an object containing options as key-value pairs\n *\n * @return {Object}\n */\n opts() {\n if (this._storeOptionsAsProperties) {\n // Preserve original behaviour so backwards compatible when still using properties\n const result = {};\n const len = this.options.length;\n\n for (let i = 0; i < len; i++) {\n const key = this.options[i].attributeName();\n result[key] = key === this._versionOptionName ? this._version : this[key];\n }\n return result;\n }\n\n return this._optionValues;\n };\n\n /**\n * Internal bottleneck for handling of parsing errors.\n *\n * @api private\n */\n _displayError(exitCode, code, message) {\n this._outputConfiguration.outputError(`${message}\\n`, this._outputConfiguration.writeErr);\n if (typeof this._showHelpAfterError === 'string') {\n this._outputConfiguration.writeErr(`${this._showHelpAfterError}\\n`);\n } else if (this._showHelpAfterError) {\n this._outputConfiguration.writeErr('\\n');\n this.outputHelp({ error: true });\n }\n this._exit(exitCode, code, message);\n }\n\n /**\n * Apply any option related environment variables, if option does\n * not have a value from cli or client code.\n *\n * @api private\n */\n _parseOptionsEnv() {\n this.options.forEach((option) => {\n if (option.envVar && option.envVar in process.env) {\n const optionKey = option.attributeName();\n // Priority check. Do not overwrite cli or options from unknown source (client-code).\n if (this.getOptionValue(optionKey) === undefined || ['default', 'config', 'env'].includes(this.getOptionValueSource(optionKey))) {\n if (option.required || option.optional) { // option can take a value\n // keep very simple, optional always takes value\n this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);\n } else { // boolean\n // keep very simple, only care that envVar defined and not the value\n this.emit(`optionEnv:${option.name()}`);\n }\n }\n }\n });\n }\n\n /**\n * Argument `name` is missing.\n *\n * @param {string} name\n * @api private\n */\n\n missingArgument(name) {\n const message = `error: missing required argument '${name}'`;\n this._displayError(1, 'commander.missingArgument', message);\n };\n\n /**\n * `Option` is missing an argument.\n *\n * @param {Option} option\n * @api private\n */\n\n optionMissingArgument(option) {\n const message = `error: option '${option.flags}' argument missing`;\n this._displayError(1, 'commander.optionMissingArgument', message);\n };\n\n /**\n * `Option` does not have a value, and is a mandatory option.\n *\n * @param {Option} option\n * @api private\n */\n\n missingMandatoryOptionValue(option) {\n const message = `error: required option '${option.flags}' not specified`;\n this._displayError(1, 'commander.missingMandatoryOptionValue', message);\n };\n\n /**\n * Unknown option `flag`.\n *\n * @param {string} flag\n * @api private\n */\n\n unknownOption(flag) {\n if (this._allowUnknownOption) return;\n let suggestion = '';\n\n if (flag.startsWith('--') && this._showSuggestionAfterError) {\n // Looping to pick up the global options too\n let candidateFlags = [];\n let command = this;\n do {\n const moreFlags = command.createHelp().visibleOptions(command)\n .filter(option => option.long)\n .map(option => option.long);\n candidateFlags = candidateFlags.concat(moreFlags);\n command = command.parent;\n } while (command && !command._enablePositionalOptions);\n suggestion = suggestSimilar(flag, candidateFlags);\n }\n\n const message = `error: unknown option '${flag}'${suggestion}`;\n this._displayError(1, 'commander.unknownOption', message);\n };\n\n /**\n * Excess arguments, more than expected.\n *\n * @param {string[]} receivedArgs\n * @api private\n */\n\n _excessArguments(receivedArgs) {\n if (this._allowExcessArguments) return;\n\n const expected = this._args.length;\n const s = (expected === 1) ? '' : 's';\n const forSubcommand = this.parent ? ` for '${this.name()}'` : '';\n const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;\n this._displayError(1, 'commander.excessArguments', message);\n };\n\n /**\n * Unknown command.\n *\n * @api private\n */\n\n unknownCommand() {\n const unknownName = this.args[0];\n let suggestion = '';\n\n if (this._showSuggestionAfterError) {\n const candidateNames = [];\n this.createHelp().visibleCommands(this).forEach((command) => {\n candidateNames.push(command.name());\n // just visible alias\n if (command.alias()) candidateNames.push(command.alias());\n });\n suggestion = suggestSimilar(unknownName, candidateNames);\n }\n\n const message = `error: unknown command '${unknownName}'${suggestion}`;\n this._displayError(1, 'commander.unknownCommand', message);\n };\n\n /**\n * Set the program version to `str`.\n *\n * This method auto-registers the \"-V, --version\" flag\n * which will print the version number when passed.\n *\n * You can optionally supply the flags and description to override the defaults.\n *\n * @param {string} str\n * @param {string} [flags]\n * @param {string} [description]\n * @return {this | string} `this` command for chaining, or version string if no arguments\n */\n\n version(str, flags, description) {\n if (str === undefined) return this._version;\n this._version = str;\n flags = flags || '-V, --version';\n description = description || 'output the version number';\n const versionOption = this.createOption(flags, description);\n this._versionOptionName = versionOption.attributeName();\n this.options.push(versionOption);\n this.on('option:' + versionOption.name(), () => {\n this._outputConfiguration.writeOut(`${str}\\n`);\n this._exit(0, 'commander.version', str);\n });\n return this;\n };\n\n /**\n * Set the description to `str`.\n *\n * @param {string} [str]\n * @param {Object} [argsDescription]\n * @return {string|Command}\n */\n description(str, argsDescription) {\n if (str === undefined && argsDescription === undefined) return this._description;\n this._description = str;\n if (argsDescription) {\n this._argsDescription = argsDescription;\n }\n return this;\n };\n\n /**\n * Set an alias for the command.\n *\n * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.\n *\n * @param {string} [alias]\n * @return {string|Command}\n */\n\n alias(alias) {\n if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility\n\n /** @type {Command} */\n let command = this;\n if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler) {\n // assume adding alias for last added executable subcommand, rather than this\n command = this.commands[this.commands.length - 1];\n }\n\n if (alias === command._name) throw new Error('Command alias can\\'t be the same as its name');\n\n command._aliases.push(alias);\n return this;\n };\n\n /**\n * Set aliases for the command.\n *\n * Only the first alias is shown in the auto-generated help.\n *\n * @param {string[]} [aliases]\n * @return {string[]|Command}\n */\n\n aliases(aliases) {\n // Getter for the array of aliases is the main reason for having aliases() in addition to alias().\n if (aliases === undefined) return this._aliases;\n\n aliases.forEach((alias) => this.alias(alias));\n return this;\n };\n\n /**\n * Set / get the command usage `str`.\n *\n * @param {string} [str]\n * @return {String|Command}\n */\n\n usage(str) {\n if (str === undefined) {\n if (this._usage) return this._usage;\n\n const args = this._args.map((arg) => {\n return humanReadableArgName(arg);\n });\n return [].concat(\n (this.options.length || this._hasHelpOption ? '[options]' : []),\n (this.commands.length ? '[command]' : []),\n (this._args.length ? args : [])\n ).join(' ');\n }\n\n this._usage = str;\n return this;\n };\n\n /**\n * Get or set the name of the command\n *\n * @param {string} [str]\n * @return {string|Command}\n */\n\n name(str) {\n if (str === undefined) return this._name;\n this._name = str;\n return this;\n };\n\n /**\n * Return program help documentation.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout\n * @return {string}\n */\n\n helpInformation(contextOptions) {\n const helper = this.createHelp();\n if (helper.helpWidth === undefined) {\n helper.helpWidth = (contextOptions && contextOptions.error) ? this._outputConfiguration.getErrHelpWidth() : this._outputConfiguration.getOutHelpWidth();\n }\n return helper.formatHelp(this, helper);\n };\n\n /**\n * @api private\n */\n\n _getHelpContext(contextOptions) {\n contextOptions = contextOptions || {};\n const context = { error: !!contextOptions.error };\n let write;\n if (context.error) {\n write = (arg) => this._outputConfiguration.writeErr(arg);\n } else {\n write = (arg) => this._outputConfiguration.writeOut(arg);\n }\n context.write = contextOptions.write || write;\n context.command = this;\n return context;\n }\n\n /**\n * Output help information for this command.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n outputHelp(contextOptions) {\n let deprecatedCallback;\n if (typeof contextOptions === 'function') {\n deprecatedCallback = contextOptions;\n contextOptions = undefined;\n }\n const context = this._getHelpContext(contextOptions);\n\n getCommandAndParents(this).reverse().forEach(command => command.emit('beforeAllHelp', context));\n this.emit('beforeHelp', context);\n\n let helpInformation = this.helpInformation(context);\n if (deprecatedCallback) {\n helpInformation = deprecatedCallback(helpInformation);\n if (typeof helpInformation !== 'string' && !Buffer.isBuffer(helpInformation)) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n }\n context.write(helpInformation);\n\n this.emit(this._helpLongFlag); // deprecated\n this.emit('afterHelp', context);\n getCommandAndParents(this).forEach(command => command.emit('afterAllHelp', context));\n };\n\n /**\n * You can pass in flags and a description to override the help\n * flags and help description for your command. Pass in false to\n * disable the built-in help option.\n *\n * @param {string | boolean} [flags]\n * @param {string} [description]\n * @return {Command} `this` command for chaining\n */\n\n helpOption(flags, description) {\n if (typeof flags === 'boolean') {\n this._hasHelpOption = flags;\n return this;\n }\n this._helpFlags = flags || this._helpFlags;\n this._helpDescription = description || this._helpDescription;\n\n const helpFlags = splitOptionFlags(this._helpFlags);\n this._helpShortFlag = helpFlags.shortFlag;\n this._helpLongFlag = helpFlags.longFlag;\n\n return this;\n };\n\n /**\n * Output help information and exit.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n help(contextOptions) {\n this.outputHelp(contextOptions);\n let exitCode = process.exitCode || 0;\n if (exitCode === 0 && contextOptions && typeof contextOptions !== 'function' && contextOptions.error) {\n exitCode = 1;\n }\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(exitCode, 'commander.help', '(outputHelp)');\n };\n\n /**\n * Add additional text to be displayed with the built-in help.\n *\n * Position is 'before' or 'after' to affect just this command,\n * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.\n *\n * @param {string} position - before or after built-in help\n * @param {string | Function} text - string to add, or a function returning a string\n * @return {Command} `this` command for chaining\n */\n addHelpText(position, text) {\n const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];\n if (!allowedValues.includes(position)) {\n throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n const helpEvent = `${position}Help`;\n this.on(helpEvent, (context) => {\n let helpStr;\n if (typeof text === 'function') {\n helpStr = text({ error: context.error, command: context.command });\n } else {\n helpStr = text;\n }\n // Ignore falsy value when nothing to output.\n if (helpStr) {\n context.write(`${helpStr}\\n`);\n }\n });\n return this;\n }\n};\n\n/**\n * Output help information if help flags specified\n *\n * @param {Command} cmd - command to output help for\n * @param {Array} args - array of options to search for help flags\n * @api private\n */\n\nfunction outputHelpIfRequested(cmd, args) {\n const helpOption = cmd._hasHelpOption && args.find(arg => arg === cmd._helpLongFlag || arg === cmd._helpShortFlag);\n if (helpOption) {\n cmd.outputHelp();\n // (Do not have all displayed text available so only passing placeholder.)\n cmd._exit(0, 'commander.helpDisplayed', '(outputHelp)');\n }\n}\n\n/**\n * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).\n *\n * @param {string[]} args - array of arguments from node.execArgv\n * @returns {string[]}\n * @api private\n */\n\nfunction incrementNodeInspectorPort(args) {\n // Testing for these options:\n // --inspect[=[host:]port]\n // --inspect-brk[=[host:]port]\n // --inspect-port=[host:]port\n return args.map((arg) => {\n if (!arg.startsWith('--inspect')) {\n return arg;\n }\n let debugOption;\n let debugHost = '127.0.0.1';\n let debugPort = '9229';\n let match;\n if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {\n // e.g. --inspect\n debugOption = match[1];\n } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {\n debugOption = match[1];\n if (/^\\d+$/.test(match[3])) {\n // e.g. --inspect=1234\n debugPort = match[3];\n } else {\n // e.g. --inspect=localhost\n debugHost = match[3];\n }\n } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\\d+)$/)) !== null) {\n // e.g. --inspect=localhost:1234\n debugOption = match[1];\n debugHost = match[3];\n debugPort = match[4];\n }\n\n if (debugOption && debugPort !== '0') {\n return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;\n }\n return arg;\n });\n}\n\n/**\n * @param {Command} startCommand\n * @returns {Command[]}\n * @api private\n */\n\nfunction getCommandAndParents(startCommand) {\n const result = [];\n for (let command = startCommand; command; command = command.parent) {\n result.push(command);\n }\n return result;\n}\n\nexports.Command = Command;\n", "const { Argument } = require('./lib/argument.js');\nconst { Command } = require('./lib/command.js');\nconst { CommanderError, InvalidArgumentError } = require('./lib/error.js');\nconst { Help } = require('./lib/help.js');\nconst { Option } = require('./lib/option.js');\n\n// @ts-check\n\n/**\n * Expose the root command.\n */\n\nexports = module.exports = new Command();\nexports.program = exports; // More explicit access to global command.\n// Implicit export of createArgument, createCommand, and createOption.\n\n/**\n * Expose classes\n */\n\nexports.Argument = Argument;\nexports.Command = Command;\nexports.CommanderError = CommanderError;\nexports.Help = Help;\nexports.InvalidArgumentError = InvalidArgumentError;\nexports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated\nexports.Option = Option;\n", "'use strict';\n\nconst { FORCE_COLOR, NODE_DISABLE_COLORS, TERM } = process.env;\n\nconst $ = {\n\tenabled: !NODE_DISABLE_COLORS && TERM !== 'dumb' && FORCE_COLOR !== '0',\n\n\t// modifiers\n\treset: init(0, 0),\n\tbold: init(1, 22),\n\tdim: init(2, 22),\n\titalic: init(3, 23),\n\tunderline: init(4, 24),\n\tinverse: init(7, 27),\n\thidden: init(8, 28),\n\tstrikethrough: init(9, 29),\n\n\t// colors\n\tblack: init(30, 39),\n\tred: init(31, 39),\n\tgreen: init(32, 39),\n\tyellow: init(33, 39),\n\tblue: init(34, 39),\n\tmagenta: init(35, 39),\n\tcyan: init(36, 39),\n\twhite: init(37, 39),\n\tgray: init(90, 39),\n\tgrey: init(90, 39),\n\n\t// background colors\n\tbgBlack: init(40, 49),\n\tbgRed: init(41, 49),\n\tbgGreen: init(42, 49),\n\tbgYellow: init(43, 49),\n\tbgBlue: init(44, 49),\n\tbgMagenta: init(45, 49),\n\tbgCyan: init(46, 49),\n\tbgWhite: init(47, 49)\n};\n\nfunction run(arr, str) {\n\tlet i=0, tmp, beg='', end='';\n\tfor (; i < arr.length; i++) {\n\t\ttmp = arr[i];\n\t\tbeg += tmp.open;\n\t\tend += tmp.close;\n\t\tif (str.includes(tmp.close)) {\n\t\t\tstr = str.replace(tmp.rgx, tmp.close + tmp.open);\n\t\t}\n\t}\n\treturn beg + str + end;\n}\n\nfunction chain(has, keys) {\n\tlet ctx = { has, keys };\n\n\tctx.reset = $.reset.bind(ctx);\n\tctx.bold = $.bold.bind(ctx);\n\tctx.dim = $.dim.bind(ctx);\n\tctx.italic = $.italic.bind(ctx);\n\tctx.underline = $.underline.bind(ctx);\n\tctx.inverse = $.inverse.bind(ctx);\n\tctx.hidden = $.hidden.bind(ctx);\n\tctx.strikethrough = $.strikethrough.bind(ctx);\n\n\tctx.black = $.black.bind(ctx);\n\tctx.red = $.red.bind(ctx);\n\tctx.green = $.green.bind(ctx);\n\tctx.yellow = $.yellow.bind(ctx);\n\tctx.blue = $.blue.bind(ctx);\n\tctx.magenta = $.magenta.bind(ctx);\n\tctx.cyan = $.cyan.bind(ctx);\n\tctx.white = $.white.bind(ctx);\n\tctx.gray = $.gray.bind(ctx);\n\tctx.grey = $.grey.bind(ctx);\n\n\tctx.bgBlack = $.bgBlack.bind(ctx);\n\tctx.bgRed = $.bgRed.bind(ctx);\n\tctx.bgGreen = $.bgGreen.bind(ctx);\n\tctx.bgYellow = $.bgYellow.bind(ctx);\n\tctx.bgBlue = $.bgBlue.bind(ctx);\n\tctx.bgMagenta = $.bgMagenta.bind(ctx);\n\tctx.bgCyan = $.bgCyan.bind(ctx);\n\tctx.bgWhite = $.bgWhite.bind(ctx);\n\n\treturn ctx;\n}\n\nfunction init(open, close) {\n\tlet blk = {\n\t\topen: `\\x1b[${open}m`,\n\t\tclose: `\\x1b[${close}m`,\n\t\trgx: new RegExp(`\\\\x1b\\\\[${close}m`, 'g')\n\t};\n\treturn function (txt) {\n\t\tif (this !== void 0 && this.has !== void 0) {\n\t\t\tthis.has.includes(open) || (this.has.push(open),this.keys.push(blk));\n\t\t\treturn txt === void 0 ? this : $.enabled ? run(this.keys, txt+'') : txt+'';\n\t\t}\n\t\treturn txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+'';\n\t};\n}\n\nmodule.exports = $;\n", "'use strict';\n\nmodule.exports = (key, isSelect) => {\n if (key.meta && key.name !== 'escape') return;\n\n if (key.ctrl) {\n if (key.name === 'a') return 'first';\n if (key.name === 'c') return 'abort';\n if (key.name === 'd') return 'abort';\n if (key.name === 'e') return 'last';\n if (key.name === 'g') return 'reset';\n }\n\n if (isSelect) {\n if (key.name === 'j') return 'down';\n if (key.name === 'k') return 'up';\n }\n\n if (key.name === 'return') return 'submit';\n if (key.name === 'enter') return 'submit'; // ctrl + J\n\n if (key.name === 'backspace') return 'delete';\n if (key.name === 'delete') return 'deleteForward';\n if (key.name === 'abort') return 'abort';\n if (key.name === 'escape') return 'exit';\n if (key.name === 'tab') return 'next';\n if (key.name === 'pagedown') return 'nextPage';\n if (key.name === 'pageup') return 'prevPage'; // TODO create home() in prompt types (e.g. TextPrompt)\n\n if (key.name === 'home') return 'home'; // TODO create end() in prompt types (e.g. TextPrompt)\n\n if (key.name === 'end') return 'end';\n if (key.name === 'up') return 'up';\n if (key.name === 'down') return 'down';\n if (key.name === 'right') return 'right';\n if (key.name === 'left') return 'left';\n return false;\n};", "'use strict';\n\nmodule.exports = str => {\n const pattern = ['[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)', '(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PRZcf-ntqry=><~]))'].join('|');\n const RGX = new RegExp(pattern, 'g');\n return typeof str === 'string' ? str.replace(RGX, '') : str;\n};", "'use strict';\n\nconst ESC = '\\x1B';\nconst CSI = `${ESC}[`;\nconst beep = '\\u0007';\n\nconst cursor = {\n to(x, y) {\n if (!y) return `${CSI}${x + 1}G`;\n return `${CSI}${y + 1};${x + 1}H`;\n },\n move(x, y) {\n let ret = '';\n\n if (x < 0) ret += `${CSI}${-x}D`;\n else if (x > 0) ret += `${CSI}${x}C`;\n\n if (y < 0) ret += `${CSI}${-y}A`;\n else if (y > 0) ret += `${CSI}${y}B`;\n\n return ret;\n },\n up: (count = 1) => `${CSI}${count}A`,\n down: (count = 1) => `${CSI}${count}B`,\n forward: (count = 1) => `${CSI}${count}C`,\n backward: (count = 1) => `${CSI}${count}D`,\n nextLine: (count = 1) => `${CSI}E`.repeat(count),\n prevLine: (count = 1) => `${CSI}F`.repeat(count),\n left: `${CSI}G`,\n hide: `${CSI}?25l`,\n show: `${CSI}?25h`,\n save: `${ESC}7`,\n restore: `${ESC}8`\n}\n\nconst scroll = {\n up: (count = 1) => `${CSI}S`.repeat(count),\n down: (count = 1) => `${CSI}T`.repeat(count)\n}\n\nconst erase = {\n screen: `${CSI}2J`,\n up: (count = 1) => `${CSI}1J`.repeat(count),\n down: (count = 1) => `${CSI}J`.repeat(count),\n line: `${CSI}2K`,\n lineEnd: `${CSI}K`,\n lineStart: `${CSI}1K`,\n lines(count) {\n let clear = '';\n for (let i = 0; i < count; i++)\n clear += this.line + (i < count - 1 ? cursor.up() : '');\n if (count)\n clear += cursor.left;\n return clear;\n }\n}\n\nmodule.exports = { cursor, scroll, erase, beep };\n", "'use strict';\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\n\nconst strip = require('./strip');\n\nconst _require = require('sisteransi'),\n erase = _require.erase,\n cursor = _require.cursor;\n\nconst width = str => [...strip(str)].length;\n/**\n * @param {string} prompt\n * @param {number} perLine\n */\n\n\nmodule.exports = function (prompt, perLine) {\n if (!perLine) return erase.line + cursor.to(0);\n let rows = 0;\n const lines = prompt.split(/\\r?\\n/);\n\n var _iterator = _createForOfIteratorHelper(lines),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n let line = _step.value;\n rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / perLine);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return erase.lines(rows);\n};", "'use strict';\n\nconst main = {\n arrowUp: '\u2191',\n arrowDown: '\u2193',\n arrowLeft: '\u2190',\n arrowRight: '\u2192',\n radioOn: '\u25C9',\n radioOff: '\u25EF',\n tick: '\u2714',\n cross: '\u2716',\n ellipsis: '\u2026',\n pointerSmall: '\u203A',\n line: '\u2500',\n pointer: '\u276F'\n};\nconst win = {\n arrowUp: main.arrowUp,\n arrowDown: main.arrowDown,\n arrowLeft: main.arrowLeft,\n arrowRight: main.arrowRight,\n radioOn: '(*)',\n radioOff: '( )',\n tick: '\u221A',\n cross: '\u00D7',\n ellipsis: '...',\n pointerSmall: '\u00BB',\n line: '\u2500',\n pointer: '>'\n};\nconst figures = process.platform === 'win32' ? win : main;\nmodule.exports = figures;", "'use strict';\n\nconst c = require('kleur');\n\nconst figures = require('./figures'); // rendering user input.\n\n\nconst styles = Object.freeze({\n password: {\n scale: 1,\n render: input => '*'.repeat(input.length)\n },\n emoji: {\n scale: 2,\n render: input => '\uD83D\uDE03'.repeat(input.length)\n },\n invisible: {\n scale: 0,\n render: input => ''\n },\n default: {\n scale: 1,\n render: input => `${input}`\n }\n});\n\nconst render = type => styles[type] || styles.default; // icon to signalize a prompt.\n\n\nconst symbols = Object.freeze({\n aborted: c.red(figures.cross),\n done: c.green(figures.tick),\n exited: c.yellow(figures.cross),\n default: c.cyan('?')\n});\n\nconst symbol = (done, aborted, exited) => aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default; // between the question and the user's input.\n\n\nconst delimiter = completing => c.gray(completing ? figures.ellipsis : figures.pointerSmall);\n\nconst item = (expandable, expanded) => c.gray(expandable ? expanded ? figures.pointerSmall : '+' : figures.line);\n\nmodule.exports = {\n styles,\n render,\n symbols,\n symbol,\n delimiter,\n item\n};", "'use strict';\n\nconst strip = require('./strip');\n/**\n * @param {string} msg\n * @param {number} perLine\n */\n\n\nmodule.exports = function (msg, perLine) {\n let lines = String(strip(msg) || '').split(/\\r?\\n/);\n if (!perLine) return lines.length;\n return lines.map(l => Math.ceil(l.length / perLine)).reduce((a, b) => a + b);\n};", "'use strict';\n/**\n * @param {string} msg The message to wrap\n * @param {object} opts\n * @param {number|string} [opts.margin] Left margin\n * @param {number} opts.width Maximum characters per line including the margin\n */\n\nmodule.exports = (msg, opts = {}) => {\n const tab = Number.isSafeInteger(parseInt(opts.margin)) ? new Array(parseInt(opts.margin)).fill(' ').join('') : opts.margin || '';\n const width = opts.width;\n return (msg || '').split(/\\r?\\n/g).map(line => line.split(/\\s+/g).reduce((arr, w) => {\n if (w.length + tab.length >= width || arr[arr.length - 1].length + w.length + 1 < width) arr[arr.length - 1] += ` ${w}`;else arr.push(`${tab}${w}`);\n return arr;\n }, [tab]).join('\\n')).join('\\n');\n};", "'use strict';\n/**\n * Determine what entries should be displayed on the screen, based on the\n * currently selected index and the maximum visible. Used in list-based\n * prompts like `select` and `multiselect`.\n *\n * @param {number} cursor the currently selected entry\n * @param {number} total the total entries available to display\n * @param {number} [maxVisible] the number of entries that can be displayed\n */\n\nmodule.exports = (cursor, total, maxVisible) => {\n maxVisible = maxVisible || total;\n let startIndex = Math.min(total - maxVisible, cursor - Math.floor(maxVisible / 2));\n if (startIndex < 0) startIndex = 0;\n let endIndex = Math.min(startIndex + maxVisible, total);\n return {\n startIndex,\n endIndex\n };\n};", "'use strict';\n\nmodule.exports = {\n action: require('./action'),\n clear: require('./clear'),\n style: require('./style'),\n strip: require('./strip'),\n figures: require('./figures'),\n lines: require('./lines'),\n wrap: require('./wrap'),\n entriesToDisplay: require('./entriesToDisplay')\n};", "'use strict';\n\nconst readline = require('readline');\n\nconst _require = require('../util'),\n action = _require.action;\n\nconst EventEmitter = require('events');\n\nconst _require2 = require('sisteransi'),\n beep = _require2.beep,\n cursor = _require2.cursor;\n\nconst color = require('kleur');\n/**\n * Base prompt skeleton\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\n\n\nclass Prompt extends EventEmitter {\n constructor(opts = {}) {\n super();\n this.firstRender = true;\n this.in = opts.stdin || process.stdin;\n this.out = opts.stdout || process.stdout;\n\n this.onRender = (opts.onRender || (() => void 0)).bind(this);\n\n const rl = readline.createInterface({\n input: this.in,\n escapeCodeTimeout: 50\n });\n readline.emitKeypressEvents(this.in, rl);\n if (this.in.isTTY) this.in.setRawMode(true);\n const isSelect = ['SelectPrompt', 'MultiselectPrompt'].indexOf(this.constructor.name) > -1;\n\n const keypress = (str, key) => {\n let a = action(key, isSelect);\n\n if (a === false) {\n this._ && this._(str, key);\n } else if (typeof this[a] === 'function') {\n this[a](key);\n } else {\n this.bell();\n }\n };\n\n this.close = () => {\n this.out.write(cursor.show);\n this.in.removeListener('keypress', keypress);\n if (this.in.isTTY) this.in.setRawMode(false);\n rl.close();\n this.emit(this.aborted ? 'abort' : this.exited ? 'exit' : 'submit', this.value);\n this.closed = true;\n };\n\n this.in.on('keypress', keypress);\n }\n\n fire() {\n this.emit('state', {\n value: this.value,\n aborted: !!this.aborted,\n exited: !!this.exited\n });\n }\n\n bell() {\n this.out.write(beep);\n }\n\n render() {\n this.onRender(color);\n if (this.firstRender) this.firstRender = false;\n }\n\n}\n\nmodule.exports = Prompt;", "\"use strict\";\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nconst color = require('kleur');\n\nconst Prompt = require('./prompt');\n\nconst _require = require('sisteransi'),\n erase = _require.erase,\n cursor = _require.cursor;\n\nconst _require2 = require('../util'),\n style = _require2.style,\n clear = _require2.clear,\n lines = _require2.lines,\n figures = _require2.figures;\n/**\n * TextPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {String} [opts.style='default'] Render style\n * @param {String} [opts.initial] Default value\n * @param {Function} [opts.validate] Validate function\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {String} [opts.error] The invalid error label\n */\n\n\nclass TextPrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.transform = style.render(opts.style);\n this.scale = this.transform.scale;\n this.msg = opts.message;\n this.initial = opts.initial || ``;\n\n this.validator = opts.validate || (() => true);\n\n this.value = ``;\n this.errorMsg = opts.error || `Please Enter A Valid Value`;\n this.cursor = Number(!!this.initial);\n this.cursorOffset = 0;\n this.clear = clear(``, this.out.columns);\n this.render();\n }\n\n set value(v) {\n if (!v && this.initial) {\n this.placeholder = true;\n this.rendered = color.gray(this.transform.render(this.initial));\n } else {\n this.placeholder = false;\n this.rendered = this.transform.render(v);\n }\n\n this._value = v;\n this.fire();\n }\n\n get value() {\n return this._value;\n }\n\n reset() {\n this.value = ``;\n this.cursor = Number(!!this.initial);\n this.cursorOffset = 0;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.value = this.value || this.initial;\n this.done = this.aborted = true;\n this.error = false;\n this.red = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n validate() {\n var _this = this;\n\n return _asyncToGenerator(function* () {\n let valid = yield _this.validator(_this.value);\n\n if (typeof valid === `string`) {\n _this.errorMsg = valid;\n valid = false;\n }\n\n _this.error = !valid;\n })();\n }\n\n submit() {\n var _this2 = this;\n\n return _asyncToGenerator(function* () {\n _this2.value = _this2.value || _this2.initial;\n _this2.cursorOffset = 0;\n _this2.cursor = _this2.rendered.length;\n yield _this2.validate();\n\n if (_this2.error) {\n _this2.red = true;\n\n _this2.fire();\n\n _this2.render();\n\n return;\n }\n\n _this2.done = true;\n _this2.aborted = false;\n\n _this2.fire();\n\n _this2.render();\n\n _this2.out.write('\\n');\n\n _this2.close();\n })();\n }\n\n next() {\n if (!this.placeholder) return this.bell();\n this.value = this.initial;\n this.cursor = this.rendered.length;\n this.fire();\n this.render();\n }\n\n moveCursor(n) {\n if (this.placeholder) return;\n this.cursor = this.cursor + n;\n this.cursorOffset += n;\n }\n\n _(c, key) {\n let s1 = this.value.slice(0, this.cursor);\n let s2 = this.value.slice(this.cursor);\n this.value = `${s1}${c}${s2}`;\n this.red = false;\n this.cursor = this.placeholder ? 0 : s1.length + 1;\n this.render();\n }\n\n delete() {\n if (this.isCursorAtStart()) return this.bell();\n let s1 = this.value.slice(0, this.cursor - 1);\n let s2 = this.value.slice(this.cursor);\n this.value = `${s1}${s2}`;\n this.red = false;\n\n if (this.isCursorAtStart()) {\n this.cursorOffset = 0;\n } else {\n this.cursorOffset++;\n this.moveCursor(-1);\n }\n\n this.render();\n }\n\n deleteForward() {\n if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell();\n let s1 = this.value.slice(0, this.cursor);\n let s2 = this.value.slice(this.cursor + 1);\n this.value = `${s1}${s2}`;\n this.red = false;\n\n if (this.isCursorAtEnd()) {\n this.cursorOffset = 0;\n } else {\n this.cursorOffset++;\n }\n\n this.render();\n }\n\n first() {\n this.cursor = 0;\n this.render();\n }\n\n last() {\n this.cursor = this.value.length;\n this.render();\n }\n\n left() {\n if (this.cursor <= 0 || this.placeholder) return this.bell();\n this.moveCursor(-1);\n this.render();\n }\n\n right() {\n if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell();\n this.moveCursor(1);\n this.render();\n }\n\n isCursorAtStart() {\n return this.cursor === 0 || this.placeholder && this.cursor === 1;\n }\n\n isCursorAtEnd() {\n return this.cursor === this.rendered.length || this.placeholder && this.cursor === this.rendered.length + 1;\n }\n\n render() {\n if (this.closed) return;\n\n if (!this.firstRender) {\n if (this.outputError) this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));\n this.out.write(clear(this.outputText, this.out.columns));\n }\n\n super.render();\n this.outputError = '';\n this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.red ? color.red(this.rendered) : this.rendered].join(` `);\n\n if (this.error) {\n this.outputError += this.errorMsg.split(`\\n`).reduce((a, l, i) => a + `\\n${i ? ' ' : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n }\n\n this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore + cursor.move(this.cursorOffset, 0));\n }\n\n}\n\nmodule.exports = TextPrompt;", "'use strict';\n\nconst color = require('kleur');\n\nconst Prompt = require('./prompt');\n\nconst _require = require('../util'),\n style = _require.style,\n clear = _require.clear,\n figures = _require.figures,\n wrap = _require.wrap,\n entriesToDisplay = _require.entriesToDisplay;\n\nconst _require2 = require('sisteransi'),\n cursor = _require2.cursor;\n/**\n * SelectPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Array} opts.choices Array of choice objects\n * @param {String} [opts.hint] Hint to display\n * @param {Number} [opts.initial] Index of default value\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {Number} [opts.optionsPerPage=10] Max options to display at once\n */\n\n\nclass SelectPrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.msg = opts.message;\n this.hint = opts.hint || '- Use arrow-keys. Return to submit.';\n this.warn = opts.warn || '- This option is disabled';\n this.cursor = opts.initial || 0;\n this.choices = opts.choices.map((ch, idx) => {\n if (typeof ch === 'string') ch = {\n title: ch,\n value: idx\n };\n return {\n title: ch && (ch.title || ch.value || ch),\n value: ch && (ch.value === undefined ? idx : ch.value),\n description: ch && ch.description,\n selected: ch && ch.selected,\n disabled: ch && ch.disabled\n };\n });\n this.optionsPerPage = opts.optionsPerPage || 10;\n this.value = (this.choices[this.cursor] || {}).value;\n this.clear = clear('', this.out.columns);\n this.render();\n }\n\n moveCursor(n) {\n this.cursor = n;\n this.value = this.choices[n].value;\n this.fire();\n }\n\n reset() {\n this.moveCursor(0);\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n if (!this.selection.disabled) {\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n } else this.bell();\n }\n\n first() {\n this.moveCursor(0);\n this.render();\n }\n\n last() {\n this.moveCursor(this.choices.length - 1);\n this.render();\n }\n\n up() {\n if (this.cursor === 0) {\n this.moveCursor(this.choices.length - 1);\n } else {\n this.moveCursor(this.cursor - 1);\n }\n\n this.render();\n }\n\n down() {\n if (this.cursor === this.choices.length - 1) {\n this.moveCursor(0);\n } else {\n this.moveCursor(this.cursor + 1);\n }\n\n this.render();\n }\n\n next() {\n this.moveCursor((this.cursor + 1) % this.choices.length);\n this.render();\n }\n\n _(c, key) {\n if (c === ' ') return this.submit();\n }\n\n get selection() {\n return this.choices[this.cursor];\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n\n let _entriesToDisplay = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage),\n startIndex = _entriesToDisplay.startIndex,\n endIndex = _entriesToDisplay.endIndex; // Print prompt\n\n\n this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.done ? this.selection.title : this.selection.disabled ? color.yellow(this.warn) : color.gray(this.hint)].join(' '); // Print choices\n\n if (!this.done) {\n this.outputText += '\\n';\n\n for (let i = startIndex; i < endIndex; i++) {\n let title,\n prefix,\n desc = '',\n v = this.choices[i]; // Determine whether to display \"more choices\" indicators\n\n if (i === startIndex && startIndex > 0) {\n prefix = figures.arrowUp;\n } else if (i === endIndex - 1 && endIndex < this.choices.length) {\n prefix = figures.arrowDown;\n } else {\n prefix = ' ';\n }\n\n if (v.disabled) {\n title = this.cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);\n prefix = (this.cursor === i ? color.bold().gray(figures.pointer) + ' ' : ' ') + prefix;\n } else {\n title = this.cursor === i ? color.cyan().underline(v.title) : v.title;\n prefix = (this.cursor === i ? color.cyan(figures.pointer) + ' ' : ' ') + prefix;\n\n if (v.description && this.cursor === i) {\n desc = ` - ${v.description}`;\n\n if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\\r?\\n/).length > 1) {\n desc = '\\n' + wrap(v.description, {\n margin: 3,\n width: this.out.columns\n });\n }\n }\n }\n\n this.outputText += `${prefix} ${title}${color.gray(desc)}\\n`;\n }\n }\n\n this.out.write(this.outputText);\n }\n\n}\n\nmodule.exports = SelectPrompt;", "\"use strict\";\n\nconst color = require('kleur');\n\nconst Prompt = require('./prompt');\n\nconst _require = require('../util'),\n style = _require.style,\n clear = _require.clear;\n\nconst _require2 = require('sisteransi'),\n cursor = _require2.cursor,\n erase = _require2.erase;\n/**\n * TogglePrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Boolean} [opts.initial=false] Default value\n * @param {String} [opts.active='no'] Active label\n * @param {String} [opts.inactive='off'] Inactive label\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\n\n\nclass TogglePrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.msg = opts.message;\n this.value = !!opts.initial;\n this.active = opts.active || 'on';\n this.inactive = opts.inactive || 'off';\n this.initialValue = this.value;\n this.render();\n }\n\n reset() {\n this.value = this.initialValue;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n deactivate() {\n if (this.value === false) return this.bell();\n this.value = false;\n this.render();\n }\n\n activate() {\n if (this.value === true) return this.bell();\n this.value = true;\n this.render();\n }\n\n delete() {\n this.deactivate();\n }\n\n left() {\n this.deactivate();\n }\n\n right() {\n this.activate();\n }\n\n down() {\n this.deactivate();\n }\n\n up() {\n this.activate();\n }\n\n next() {\n this.value = !this.value;\n this.fire();\n this.render();\n }\n\n _(c, key) {\n if (c === ' ') {\n this.value = !this.value;\n } else if (c === '1') {\n this.value = true;\n } else if (c === '0') {\n this.value = false;\n } else return this.bell();\n\n this.render();\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.value ? this.inactive : color.cyan().underline(this.inactive), color.gray('/'), this.value ? color.cyan().underline(this.active) : this.active].join(' ');\n this.out.write(erase.line + cursor.to(0) + this.outputText);\n }\n\n}\n\nmodule.exports = TogglePrompt;", "'use strict';\n\nclass DatePart {\n constructor({\n token,\n date,\n parts,\n locales\n }) {\n this.token = token;\n this.date = date || new Date();\n this.parts = parts || [this];\n this.locales = locales || {};\n }\n\n up() {}\n\n down() {}\n\n next() {\n const currentIdx = this.parts.indexOf(this);\n return this.parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);\n }\n\n setTo(val) {}\n\n prev() {\n let parts = [].concat(this.parts).reverse();\n const currentIdx = parts.indexOf(this);\n return parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);\n }\n\n toString() {\n return String(this.date);\n }\n\n}\n\nmodule.exports = DatePart;", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Meridiem extends DatePart {\n constructor(opts = {}) {\n super(opts);\n }\n\n up() {\n this.date.setHours((this.date.getHours() + 12) % 24);\n }\n\n down() {\n this.up();\n }\n\n toString() {\n let meridiem = this.date.getHours() > 12 ? 'pm' : 'am';\n return /\\A/.test(this.token) ? meridiem.toUpperCase() : meridiem;\n }\n\n}\n\nmodule.exports = Meridiem;", "'use strict';\n\nconst DatePart = require('./datepart');\n\nconst pos = n => {\n n = n % 10;\n return n === 1 ? 'st' : n === 2 ? 'nd' : n === 3 ? 'rd' : 'th';\n};\n\nclass Day extends DatePart {\n constructor(opts = {}) {\n super(opts);\n }\n\n up() {\n this.date.setDate(this.date.getDate() + 1);\n }\n\n down() {\n this.date.setDate(this.date.getDate() - 1);\n }\n\n setTo(val) {\n this.date.setDate(parseInt(val.substr(-2)));\n }\n\n toString() {\n let date = this.date.getDate();\n let day = this.date.getDay();\n return this.token === 'DD' ? String(date).padStart(2, '0') : this.token === 'Do' ? date + pos(date) : this.token === 'd' ? day + 1 : this.token === 'ddd' ? this.locales.weekdaysShort[day] : this.token === 'dddd' ? this.locales.weekdays[day] : date;\n }\n\n}\n\nmodule.exports = Day;", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Hours extends DatePart {\n constructor(opts = {}) {\n super(opts);\n }\n\n up() {\n this.date.setHours(this.date.getHours() + 1);\n }\n\n down() {\n this.date.setHours(this.date.getHours() - 1);\n }\n\n setTo(val) {\n this.date.setHours(parseInt(val.substr(-2)));\n }\n\n toString() {\n let hours = this.date.getHours();\n if (/h/.test(this.token)) hours = hours % 12 || 12;\n return this.token.length > 1 ? String(hours).padStart(2, '0') : hours;\n }\n\n}\n\nmodule.exports = Hours;", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Milliseconds extends DatePart {\n constructor(opts = {}) {\n super(opts);\n }\n\n up() {\n this.date.setMilliseconds(this.date.getMilliseconds() + 1);\n }\n\n down() {\n this.date.setMilliseconds(this.date.getMilliseconds() - 1);\n }\n\n setTo(val) {\n this.date.setMilliseconds(parseInt(val.substr(-this.token.length)));\n }\n\n toString() {\n return String(this.date.getMilliseconds()).padStart(4, '0').substr(0, this.token.length);\n }\n\n}\n\nmodule.exports = Milliseconds;", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Minutes extends DatePart {\n constructor(opts = {}) {\n super(opts);\n }\n\n up() {\n this.date.setMinutes(this.date.getMinutes() + 1);\n }\n\n down() {\n this.date.setMinutes(this.date.getMinutes() - 1);\n }\n\n setTo(val) {\n this.date.setMinutes(parseInt(val.substr(-2)));\n }\n\n toString() {\n let m = this.date.getMinutes();\n return this.token.length > 1 ? String(m).padStart(2, '0') : m;\n }\n\n}\n\nmodule.exports = Minutes;", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Month extends DatePart {\n constructor(opts = {}) {\n super(opts);\n }\n\n up() {\n this.date.setMonth(this.date.getMonth() + 1);\n }\n\n down() {\n this.date.setMonth(this.date.getMonth() - 1);\n }\n\n setTo(val) {\n val = parseInt(val.substr(-2)) - 1;\n this.date.setMonth(val < 0 ? 0 : val);\n }\n\n toString() {\n let month = this.date.getMonth();\n let tl = this.token.length;\n return tl === 2 ? String(month + 1).padStart(2, '0') : tl === 3 ? this.locales.monthsShort[month] : tl === 4 ? this.locales.months[month] : String(month + 1);\n }\n\n}\n\nmodule.exports = Month;", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Seconds extends DatePart {\n constructor(opts = {}) {\n super(opts);\n }\n\n up() {\n this.date.setSeconds(this.date.getSeconds() + 1);\n }\n\n down() {\n this.date.setSeconds(this.date.getSeconds() - 1);\n }\n\n setTo(val) {\n this.date.setSeconds(parseInt(val.substr(-2)));\n }\n\n toString() {\n let s = this.date.getSeconds();\n return this.token.length > 1 ? String(s).padStart(2, '0') : s;\n }\n\n}\n\nmodule.exports = Seconds;", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Year extends DatePart {\n constructor(opts = {}) {\n super(opts);\n }\n\n up() {\n this.date.setFullYear(this.date.getFullYear() + 1);\n }\n\n down() {\n this.date.setFullYear(this.date.getFullYear() - 1);\n }\n\n setTo(val) {\n this.date.setFullYear(val.substr(-4));\n }\n\n toString() {\n let year = String(this.date.getFullYear()).padStart(4, '0');\n return this.token.length === 2 ? year.substr(-2) : year;\n }\n\n}\n\nmodule.exports = Year;", "'use strict';\n\nmodule.exports = {\n DatePart: require('./datepart'),\n Meridiem: require('./meridiem'),\n Day: require('./day'),\n Hours: require('./hours'),\n Milliseconds: require('./milliseconds'),\n Minutes: require('./minutes'),\n Month: require('./month'),\n Seconds: require('./seconds'),\n Year: require('./year')\n};", "'use strict';\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nconst color = require('kleur');\n\nconst Prompt = require('./prompt');\n\nconst _require = require('../util'),\n style = _require.style,\n clear = _require.clear,\n figures = _require.figures;\n\nconst _require2 = require('sisteransi'),\n erase = _require2.erase,\n cursor = _require2.cursor;\n\nconst _require3 = require('../dateparts'),\n DatePart = _require3.DatePart,\n Meridiem = _require3.Meridiem,\n Day = _require3.Day,\n Hours = _require3.Hours,\n Milliseconds = _require3.Milliseconds,\n Minutes = _require3.Minutes,\n Month = _require3.Month,\n Seconds = _require3.Seconds,\n Year = _require3.Year;\n\nconst regex = /\\\\(.)|\"((?:\\\\[\"\\\\]|[^\"])+)\"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;\nconst regexGroups = {\n 1: ({\n token\n }) => token.replace(/\\\\(.)/g, '$1'),\n 2: opts => new Day(opts),\n // Day // TODO\n 3: opts => new Month(opts),\n // Month\n 4: opts => new Year(opts),\n // Year\n 5: opts => new Meridiem(opts),\n // AM/PM // TODO (special)\n 6: opts => new Hours(opts),\n // Hours\n 7: opts => new Minutes(opts),\n // Minutes\n 8: opts => new Seconds(opts),\n // Seconds\n 9: opts => new Milliseconds(opts) // Fractional seconds\n\n};\nconst dfltLocales = {\n months: 'January,February,March,April,May,June,July,August,September,October,November,December'.split(','),\n monthsShort: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),\n weekdays: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),\n weekdaysShort: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(',')\n};\n/**\n * DatePrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Number} [opts.initial] Index of default value\n * @param {String} [opts.mask] The format mask\n * @param {object} [opts.locales] The date locales\n * @param {String} [opts.error] The error message shown on invalid value\n * @param {Function} [opts.validate] Function to validate the submitted value\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\n\nclass DatePrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.msg = opts.message;\n this.cursor = 0;\n this.typed = '';\n this.locales = Object.assign(dfltLocales, opts.locales);\n this._date = opts.initial || new Date();\n this.errorMsg = opts.error || 'Please Enter A Valid Value';\n\n this.validator = opts.validate || (() => true);\n\n this.mask = opts.mask || 'YYYY-MM-DD HH:mm:ss';\n this.clear = clear('', this.out.columns);\n this.render();\n }\n\n get value() {\n return this.date;\n }\n\n get date() {\n return this._date;\n }\n\n set date(date) {\n if (date) this._date.setTime(date.getTime());\n }\n\n set mask(mask) {\n let result;\n this.parts = [];\n\n while (result = regex.exec(mask)) {\n let match = result.shift();\n let idx = result.findIndex(gr => gr != null);\n this.parts.push(idx in regexGroups ? regexGroups[idx]({\n token: result[idx] || match,\n date: this.date,\n parts: this.parts,\n locales: this.locales\n }) : result[idx] || match);\n }\n\n let parts = this.parts.reduce((arr, i) => {\n if (typeof i === 'string' && typeof arr[arr.length - 1] === 'string') arr[arr.length - 1] += i;else arr.push(i);\n return arr;\n }, []);\n this.parts.splice(0);\n this.parts.push(...parts);\n this.reset();\n }\n\n moveCursor(n) {\n this.typed = '';\n this.cursor = n;\n this.fire();\n }\n\n reset() {\n this.moveCursor(this.parts.findIndex(p => p instanceof DatePart));\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.error = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n validate() {\n var _this = this;\n\n return _asyncToGenerator(function* () {\n let valid = yield _this.validator(_this.value);\n\n if (typeof valid === 'string') {\n _this.errorMsg = valid;\n valid = false;\n }\n\n _this.error = !valid;\n })();\n }\n\n submit() {\n var _this2 = this;\n\n return _asyncToGenerator(function* () {\n yield _this2.validate();\n\n if (_this2.error) {\n _this2.color = 'red';\n\n _this2.fire();\n\n _this2.render();\n\n return;\n }\n\n _this2.done = true;\n _this2.aborted = false;\n\n _this2.fire();\n\n _this2.render();\n\n _this2.out.write('\\n');\n\n _this2.close();\n })();\n }\n\n up() {\n this.typed = '';\n this.parts[this.cursor].up();\n this.render();\n }\n\n down() {\n this.typed = '';\n this.parts[this.cursor].down();\n this.render();\n }\n\n left() {\n let prev = this.parts[this.cursor].prev();\n if (prev == null) return this.bell();\n this.moveCursor(this.parts.indexOf(prev));\n this.render();\n }\n\n right() {\n let next = this.parts[this.cursor].next();\n if (next == null) return this.bell();\n this.moveCursor(this.parts.indexOf(next));\n this.render();\n }\n\n next() {\n let next = this.parts[this.cursor].next();\n this.moveCursor(next ? this.parts.indexOf(next) : this.parts.findIndex(part => part instanceof DatePart));\n this.render();\n }\n\n _(c) {\n if (/\\d/.test(c)) {\n this.typed += c;\n this.parts[this.cursor].setTo(this.typed);\n this.render();\n }\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);else this.out.write(clear(this.outputText, this.out.columns));\n super.render(); // Print prompt\n\n this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.parts.reduce((arr, p, idx) => arr.concat(idx === this.cursor && !this.done ? color.cyan().underline(p.toString()) : p), []).join('')].join(' '); // Print error\n\n if (this.error) {\n this.outputText += this.errorMsg.split('\\n').reduce((a, l, i) => a + `\\n${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n }\n\n this.out.write(erase.line + cursor.to(0) + this.outputText);\n }\n\n}\n\nmodule.exports = DatePrompt;", "\"use strict\";\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nconst color = require('kleur');\n\nconst Prompt = require('./prompt');\n\nconst _require = require('sisteransi'),\n cursor = _require.cursor,\n erase = _require.erase;\n\nconst _require2 = require('../util'),\n style = _require2.style,\n figures = _require2.figures,\n clear = _require2.clear,\n lines = _require2.lines;\n\nconst isNumber = /[0-9]/;\n\nconst isDef = any => any !== undefined;\n\nconst round = (number, precision) => {\n let factor = Math.pow(10, precision);\n return Math.round(number * factor) / factor;\n};\n/**\n * NumberPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {String} [opts.style='default'] Render style\n * @param {Number} [opts.initial] Default value\n * @param {Number} [opts.max=+Infinity] Max value\n * @param {Number} [opts.min=-Infinity] Min value\n * @param {Boolean} [opts.float=false] Parse input as floats\n * @param {Number} [opts.round=2] Round floats to x decimals\n * @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n * @param {Function} [opts.validate] Validate function\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {String} [opts.error] The invalid error label\n */\n\n\nclass NumberPrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.transform = style.render(opts.style);\n this.msg = opts.message;\n this.initial = isDef(opts.initial) ? opts.initial : '';\n this.float = !!opts.float;\n this.round = opts.round || 2;\n this.inc = opts.increment || 1;\n this.min = isDef(opts.min) ? opts.min : -Infinity;\n this.max = isDef(opts.max) ? opts.max : Infinity;\n this.errorMsg = opts.error || `Please Enter A Valid Value`;\n\n this.validator = opts.validate || (() => true);\n\n this.color = `cyan`;\n this.value = ``;\n this.typed = ``;\n this.lastHit = 0;\n this.render();\n }\n\n set value(v) {\n if (!v && v !== 0) {\n this.placeholder = true;\n this.rendered = color.gray(this.transform.render(`${this.initial}`));\n this._value = ``;\n } else {\n this.placeholder = false;\n this.rendered = this.transform.render(`${round(v, this.round)}`);\n this._value = round(v, this.round);\n }\n\n this.fire();\n }\n\n get value() {\n return this._value;\n }\n\n parse(x) {\n return this.float ? parseFloat(x) : parseInt(x);\n }\n\n valid(c) {\n return c === `-` || c === `.` && this.float || isNumber.test(c);\n }\n\n reset() {\n this.typed = ``;\n this.value = ``;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n let x = this.value;\n this.value = x !== `` ? x : this.initial;\n this.done = this.aborted = true;\n this.error = false;\n this.fire();\n this.render();\n this.out.write(`\\n`);\n this.close();\n }\n\n validate() {\n var _this = this;\n\n return _asyncToGenerator(function* () {\n let valid = yield _this.validator(_this.value);\n\n if (typeof valid === `string`) {\n _this.errorMsg = valid;\n valid = false;\n }\n\n _this.error = !valid;\n })();\n }\n\n submit() {\n var _this2 = this;\n\n return _asyncToGenerator(function* () {\n yield _this2.validate();\n\n if (_this2.error) {\n _this2.color = `red`;\n\n _this2.fire();\n\n _this2.render();\n\n return;\n }\n\n let x = _this2.value;\n _this2.value = x !== `` ? x : _this2.initial;\n _this2.done = true;\n _this2.aborted = false;\n _this2.error = false;\n\n _this2.fire();\n\n _this2.render();\n\n _this2.out.write(`\\n`);\n\n _this2.close();\n })();\n }\n\n up() {\n this.typed = ``;\n\n if (this.value === '') {\n this.value = this.min - this.inc;\n }\n\n if (this.value >= this.max) return this.bell();\n this.value += this.inc;\n this.color = `cyan`;\n this.fire();\n this.render();\n }\n\n down() {\n this.typed = ``;\n\n if (this.value === '') {\n this.value = this.min + this.inc;\n }\n\n if (this.value <= this.min) return this.bell();\n this.value -= this.inc;\n this.color = `cyan`;\n this.fire();\n this.render();\n }\n\n delete() {\n let val = this.value.toString();\n if (val.length === 0) return this.bell();\n this.value = this.parse(val = val.slice(0, -1)) || ``;\n\n if (this.value !== '' && this.value < this.min) {\n this.value = this.min;\n }\n\n this.color = `cyan`;\n this.fire();\n this.render();\n }\n\n next() {\n this.value = this.initial;\n this.fire();\n this.render();\n }\n\n _(c, key) {\n if (!this.valid(c)) return this.bell();\n const now = Date.now();\n if (now - this.lastHit > 1000) this.typed = ``; // 1s elapsed\n\n this.typed += c;\n this.lastHit = now;\n this.color = `cyan`;\n if (c === `.`) return this.fire();\n this.value = Math.min(this.parse(this.typed), this.max);\n if (this.value > this.max) this.value = this.max;\n if (this.value < this.min) this.value = this.min;\n this.fire();\n this.render();\n }\n\n render() {\n if (this.closed) return;\n\n if (!this.firstRender) {\n if (this.outputError) this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));\n this.out.write(clear(this.outputText, this.out.columns));\n }\n\n super.render();\n this.outputError = ''; // Print prompt\n\n this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), !this.done || !this.done && !this.placeholder ? color[this.color]().underline(this.rendered) : this.rendered].join(` `); // Print error\n\n if (this.error) {\n this.outputError += this.errorMsg.split(`\\n`).reduce((a, l, i) => a + `\\n${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n }\n\n this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore);\n }\n\n}\n\nmodule.exports = NumberPrompt;", "'use strict';\n\nconst color = require('kleur');\n\nconst _require = require('sisteransi'),\n cursor = _require.cursor;\n\nconst Prompt = require('./prompt');\n\nconst _require2 = require('../util'),\n clear = _require2.clear,\n figures = _require2.figures,\n style = _require2.style,\n wrap = _require2.wrap,\n entriesToDisplay = _require2.entriesToDisplay;\n/**\n * MultiselectPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Array} opts.choices Array of choice objects\n * @param {String} [opts.hint] Hint to display\n * @param {String} [opts.warn] Hint shown for disabled choices\n * @param {Number} [opts.max] Max choices\n * @param {Number} [opts.cursor=0] Cursor start position\n * @param {Number} [opts.optionsPerPage=10] Max options to display at once\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\n\n\nclass MultiselectPrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.msg = opts.message;\n this.cursor = opts.cursor || 0;\n this.scrollIndex = opts.cursor || 0;\n this.hint = opts.hint || '';\n this.warn = opts.warn || '- This option is disabled -';\n this.minSelected = opts.min;\n this.showMinError = false;\n this.maxChoices = opts.max;\n this.instructions = opts.instructions;\n this.optionsPerPage = opts.optionsPerPage || 10;\n this.value = opts.choices.map((ch, idx) => {\n if (typeof ch === 'string') ch = {\n title: ch,\n value: idx\n };\n return {\n title: ch && (ch.title || ch.value || ch),\n description: ch && ch.description,\n value: ch && (ch.value === undefined ? idx : ch.value),\n selected: ch && ch.selected,\n disabled: ch && ch.disabled\n };\n });\n this.clear = clear('', this.out.columns);\n\n if (!opts.overrideRender) {\n this.render();\n }\n }\n\n reset() {\n this.value.map(v => !v.selected);\n this.cursor = 0;\n this.fire();\n this.render();\n }\n\n selected() {\n return this.value.filter(v => v.selected);\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n const selected = this.value.filter(e => e.selected);\n\n if (this.minSelected && selected.length < this.minSelected) {\n this.showMinError = true;\n this.render();\n } else {\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n }\n\n first() {\n this.cursor = 0;\n this.render();\n }\n\n last() {\n this.cursor = this.value.length - 1;\n this.render();\n }\n\n next() {\n this.cursor = (this.cursor + 1) % this.value.length;\n this.render();\n }\n\n up() {\n if (this.cursor === 0) {\n this.cursor = this.value.length - 1;\n } else {\n this.cursor--;\n }\n\n this.render();\n }\n\n down() {\n if (this.cursor === this.value.length - 1) {\n this.cursor = 0;\n } else {\n this.cursor++;\n }\n\n this.render();\n }\n\n left() {\n this.value[this.cursor].selected = false;\n this.render();\n }\n\n right() {\n if (this.value.filter(e => e.selected).length >= this.maxChoices) return this.bell();\n this.value[this.cursor].selected = true;\n this.render();\n }\n\n handleSpaceToggle() {\n const v = this.value[this.cursor];\n\n if (v.selected) {\n v.selected = false;\n this.render();\n } else if (v.disabled || this.value.filter(e => e.selected).length >= this.maxChoices) {\n return this.bell();\n } else {\n v.selected = true;\n this.render();\n }\n }\n\n toggleAll() {\n if (this.maxChoices !== undefined || this.value[this.cursor].disabled) {\n return this.bell();\n }\n\n const newSelected = !this.value[this.cursor].selected;\n this.value.filter(v => !v.disabled).forEach(v => v.selected = newSelected);\n this.render();\n }\n\n _(c, key) {\n if (c === ' ') {\n this.handleSpaceToggle();\n } else if (c === 'a') {\n this.toggleAll();\n } else {\n return this.bell();\n }\n }\n\n renderInstructions() {\n if (this.instructions === undefined || this.instructions) {\n if (typeof this.instructions === 'string') {\n return this.instructions;\n }\n\n return '\\nInstructions:\\n' + ` ${figures.arrowUp}/${figures.arrowDown}: Highlight option\\n` + ` ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection\\n` + (this.maxChoices === undefined ? ` a: Toggle all\\n` : '') + ` enter/return: Complete answer`;\n }\n\n return '';\n }\n\n renderOption(cursor, v, i, arrowIndicator) {\n const prefix = (v.selected ? color.green(figures.radioOn) : figures.radioOff) + ' ' + arrowIndicator + ' ';\n let title, desc;\n\n if (v.disabled) {\n title = cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);\n } else {\n title = cursor === i ? color.cyan().underline(v.title) : v.title;\n\n if (cursor === i && v.description) {\n desc = ` - ${v.description}`;\n\n if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\\r?\\n/).length > 1) {\n desc = '\\n' + wrap(v.description, {\n margin: prefix.length,\n width: this.out.columns\n });\n }\n }\n }\n\n return prefix + title + color.gray(desc || '');\n } // shared with autocompleteMultiselect\n\n\n paginateOptions(options) {\n if (options.length === 0) {\n return color.red('No matches for this query.');\n }\n\n let _entriesToDisplay = entriesToDisplay(this.cursor, options.length, this.optionsPerPage),\n startIndex = _entriesToDisplay.startIndex,\n endIndex = _entriesToDisplay.endIndex;\n\n let prefix,\n styledOptions = [];\n\n for (let i = startIndex; i < endIndex; i++) {\n if (i === startIndex && startIndex > 0) {\n prefix = figures.arrowUp;\n } else if (i === endIndex - 1 && endIndex < options.length) {\n prefix = figures.arrowDown;\n } else {\n prefix = ' ';\n }\n\n styledOptions.push(this.renderOption(this.cursor, options[i], i, prefix));\n }\n\n return '\\n' + styledOptions.join('\\n');\n } // shared with autocomleteMultiselect\n\n\n renderOptions(options) {\n if (!this.done) {\n return this.paginateOptions(options);\n }\n\n return '';\n }\n\n renderDoneOrInstructions() {\n if (this.done) {\n return this.value.filter(e => e.selected).map(v => v.title).join(', ');\n }\n\n const output = [color.gray(this.hint), this.renderInstructions()];\n\n if (this.value[this.cursor].disabled) {\n output.push(color.yellow(this.warn));\n }\n\n return output.join(' ');\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n super.render(); // print prompt\n\n let prompt = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(' ');\n\n if (this.showMinError) {\n prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`);\n this.showMinError = false;\n }\n\n prompt += this.renderOptions(this.value);\n this.out.write(this.clear + prompt);\n this.clear = clear(prompt, this.out.columns);\n }\n\n}\n\nmodule.exports = MultiselectPrompt;", "'use strict';\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nconst color = require('kleur');\n\nconst Prompt = require('./prompt');\n\nconst _require = require('sisteransi'),\n erase = _require.erase,\n cursor = _require.cursor;\n\nconst _require2 = require('../util'),\n style = _require2.style,\n clear = _require2.clear,\n figures = _require2.figures,\n wrap = _require2.wrap,\n entriesToDisplay = _require2.entriesToDisplay;\n\nconst getVal = (arr, i) => arr[i] && (arr[i].value || arr[i].title || arr[i]);\n\nconst getTitle = (arr, i) => arr[i] && (arr[i].title || arr[i].value || arr[i]);\n\nconst getIndex = (arr, valOrTitle) => {\n const index = arr.findIndex(el => el.value === valOrTitle || el.title === valOrTitle);\n return index > -1 ? index : undefined;\n};\n/**\n * TextPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Array} opts.choices Array of auto-complete choices objects\n * @param {Function} [opts.suggest] Filter function. Defaults to sort by title\n * @param {Number} [opts.limit=10] Max number of results to show\n * @param {Number} [opts.cursor=0] Cursor start position\n * @param {String} [opts.style='default'] Render style\n * @param {String} [opts.fallback] Fallback message - initial to default value\n * @param {String} [opts.initial] Index of the default value\n * @param {Boolean} [opts.clearFirst] The first ESCAPE keypress will clear the input\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {String} [opts.noMatches] The no matches found label\n */\n\n\nclass AutocompletePrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.msg = opts.message;\n this.suggest = opts.suggest;\n this.choices = opts.choices;\n this.initial = typeof opts.initial === 'number' ? opts.initial : getIndex(opts.choices, opts.initial);\n this.select = this.initial || opts.cursor || 0;\n this.i18n = {\n noMatches: opts.noMatches || 'no matches found'\n };\n this.fallback = opts.fallback || this.initial;\n this.clearFirst = opts.clearFirst || false;\n this.suggestions = [];\n this.input = '';\n this.limit = opts.limit || 10;\n this.cursor = 0;\n this.transform = style.render(opts.style);\n this.scale = this.transform.scale;\n this.render = this.render.bind(this);\n this.complete = this.complete.bind(this);\n this.clear = clear('', this.out.columns);\n this.complete(this.render);\n this.render();\n }\n\n set fallback(fb) {\n this._fb = Number.isSafeInteger(parseInt(fb)) ? parseInt(fb) : fb;\n }\n\n get fallback() {\n let choice;\n if (typeof this._fb === 'number') choice = this.choices[this._fb];else if (typeof this._fb === 'string') choice = {\n title: this._fb\n };\n return choice || this._fb || {\n title: this.i18n.noMatches\n };\n }\n\n moveSelect(i) {\n this.select = i;\n if (this.suggestions.length > 0) this.value = getVal(this.suggestions, i);else this.value = this.fallback.value;\n this.fire();\n }\n\n complete(cb) {\n var _this = this;\n\n return _asyncToGenerator(function* () {\n const p = _this.completing = _this.suggest(_this.input, _this.choices);\n\n const suggestions = yield p;\n if (_this.completing !== p) return;\n _this.suggestions = suggestions.map((s, i, arr) => ({\n title: getTitle(arr, i),\n value: getVal(arr, i),\n description: s.description\n }));\n _this.completing = false;\n const l = Math.max(suggestions.length - 1, 0);\n\n _this.moveSelect(Math.min(l, _this.select));\n\n cb && cb();\n })();\n }\n\n reset() {\n this.input = '';\n this.complete(() => {\n this.moveSelect(this.initial !== void 0 ? this.initial : 0);\n this.render();\n });\n this.render();\n }\n\n exit() {\n if (this.clearFirst && this.input.length > 0) {\n this.reset();\n } else {\n this.done = this.exited = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n }\n\n abort() {\n this.done = this.aborted = true;\n this.exited = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n this.done = true;\n this.aborted = this.exited = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n _(c, key) {\n let s1 = this.input.slice(0, this.cursor);\n let s2 = this.input.slice(this.cursor);\n this.input = `${s1}${c}${s2}`;\n this.cursor = s1.length + 1;\n this.complete(this.render);\n this.render();\n }\n\n delete() {\n if (this.cursor === 0) return this.bell();\n let s1 = this.input.slice(0, this.cursor - 1);\n let s2 = this.input.slice(this.cursor);\n this.input = `${s1}${s2}`;\n this.complete(this.render);\n this.cursor = this.cursor - 1;\n this.render();\n }\n\n deleteForward() {\n if (this.cursor * this.scale >= this.rendered.length) return this.bell();\n let s1 = this.input.slice(0, this.cursor);\n let s2 = this.input.slice(this.cursor + 1);\n this.input = `${s1}${s2}`;\n this.complete(this.render);\n this.render();\n }\n\n first() {\n this.moveSelect(0);\n this.render();\n }\n\n last() {\n this.moveSelect(this.suggestions.length - 1);\n this.render();\n }\n\n up() {\n if (this.select === 0) {\n this.moveSelect(this.suggestions.length - 1);\n } else {\n this.moveSelect(this.select - 1);\n }\n\n this.render();\n }\n\n down() {\n if (this.select === this.suggestions.length - 1) {\n this.moveSelect(0);\n } else {\n this.moveSelect(this.select + 1);\n }\n\n this.render();\n }\n\n next() {\n if (this.select === this.suggestions.length - 1) {\n this.moveSelect(0);\n } else this.moveSelect(this.select + 1);\n\n this.render();\n }\n\n nextPage() {\n this.moveSelect(Math.min(this.select + this.limit, this.suggestions.length - 1));\n this.render();\n }\n\n prevPage() {\n this.moveSelect(Math.max(this.select - this.limit, 0));\n this.render();\n }\n\n left() {\n if (this.cursor <= 0) return this.bell();\n this.cursor = this.cursor - 1;\n this.render();\n }\n\n right() {\n if (this.cursor * this.scale >= this.rendered.length) return this.bell();\n this.cursor = this.cursor + 1;\n this.render();\n }\n\n renderOption(v, hovered, isStart, isEnd) {\n let desc;\n let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : ' ';\n let title = hovered ? color.cyan().underline(v.title) : v.title;\n prefix = (hovered ? color.cyan(figures.pointer) + ' ' : ' ') + prefix;\n\n if (v.description) {\n desc = ` - ${v.description}`;\n\n if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\\r?\\n/).length > 1) {\n desc = '\\n' + wrap(v.description, {\n margin: 3,\n width: this.out.columns\n });\n }\n }\n\n return prefix + ' ' + title + color.gray(desc || '');\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n\n let _entriesToDisplay = entriesToDisplay(this.select, this.choices.length, this.limit),\n startIndex = _entriesToDisplay.startIndex,\n endIndex = _entriesToDisplay.endIndex;\n\n this.outputText = [style.symbol(this.done, this.aborted, this.exited), color.bold(this.msg), style.delimiter(this.completing), this.done && this.suggestions[this.select] ? this.suggestions[this.select].title : this.rendered = this.transform.render(this.input)].join(' ');\n\n if (!this.done) {\n const suggestions = this.suggestions.slice(startIndex, endIndex).map((item, i) => this.renderOption(item, this.select === i + startIndex, i === 0 && startIndex > 0, i + startIndex === endIndex - 1 && endIndex < this.choices.length)).join('\\n');\n this.outputText += `\\n` + (suggestions || color.gray(this.fallback.title));\n }\n\n this.out.write(erase.line + cursor.to(0) + this.outputText);\n }\n\n}\n\nmodule.exports = AutocompletePrompt;", "'use strict';\n\nconst color = require('kleur');\n\nconst _require = require('sisteransi'),\n cursor = _require.cursor;\n\nconst MultiselectPrompt = require('./multiselect');\n\nconst _require2 = require('../util'),\n clear = _require2.clear,\n style = _require2.style,\n figures = _require2.figures;\n/**\n * MultiselectPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Array} opts.choices Array of choice objects\n * @param {String} [opts.hint] Hint to display\n * @param {String} [opts.warn] Hint shown for disabled choices\n * @param {Number} [opts.max] Max choices\n * @param {Number} [opts.cursor=0] Cursor start position\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\n\n\nclass AutocompleteMultiselectPrompt extends MultiselectPrompt {\n constructor(opts = {}) {\n opts.overrideRender = true;\n super(opts);\n this.inputValue = '';\n this.clear = clear('', this.out.columns);\n this.filteredOptions = this.value;\n this.render();\n }\n\n last() {\n this.cursor = this.filteredOptions.length - 1;\n this.render();\n }\n\n next() {\n this.cursor = (this.cursor + 1) % this.filteredOptions.length;\n this.render();\n }\n\n up() {\n if (this.cursor === 0) {\n this.cursor = this.filteredOptions.length - 1;\n } else {\n this.cursor--;\n }\n\n this.render();\n }\n\n down() {\n if (this.cursor === this.filteredOptions.length - 1) {\n this.cursor = 0;\n } else {\n this.cursor++;\n }\n\n this.render();\n }\n\n left() {\n this.filteredOptions[this.cursor].selected = false;\n this.render();\n }\n\n right() {\n if (this.value.filter(e => e.selected).length >= this.maxChoices) return this.bell();\n this.filteredOptions[this.cursor].selected = true;\n this.render();\n }\n\n delete() {\n if (this.inputValue.length) {\n this.inputValue = this.inputValue.substr(0, this.inputValue.length - 1);\n this.updateFilteredOptions();\n }\n }\n\n updateFilteredOptions() {\n const currentHighlight = this.filteredOptions[this.cursor];\n this.filteredOptions = this.value.filter(v => {\n if (this.inputValue) {\n if (typeof v.title === 'string') {\n if (v.title.toLowerCase().includes(this.inputValue.toLowerCase())) {\n return true;\n }\n }\n\n if (typeof v.value === 'string') {\n if (v.value.toLowerCase().includes(this.inputValue.toLowerCase())) {\n return true;\n }\n }\n\n return false;\n }\n\n return true;\n });\n const newHighlightIndex = this.filteredOptions.findIndex(v => v === currentHighlight);\n this.cursor = newHighlightIndex < 0 ? 0 : newHighlightIndex;\n this.render();\n }\n\n handleSpaceToggle() {\n const v = this.filteredOptions[this.cursor];\n\n if (v.selected) {\n v.selected = false;\n this.render();\n } else if (v.disabled || this.value.filter(e => e.selected).length >= this.maxChoices) {\n return this.bell();\n } else {\n v.selected = true;\n this.render();\n }\n }\n\n handleInputChange(c) {\n this.inputValue = this.inputValue + c;\n this.updateFilteredOptions();\n }\n\n _(c, key) {\n if (c === ' ') {\n this.handleSpaceToggle();\n } else {\n this.handleInputChange(c);\n }\n }\n\n renderInstructions() {\n if (this.instructions === undefined || this.instructions) {\n if (typeof this.instructions === 'string') {\n return this.instructions;\n }\n\n return `\nInstructions:\n ${figures.arrowUp}/${figures.arrowDown}: Highlight option\n ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`;\n }\n\n return '';\n }\n\n renderCurrentInput() {\n return `\nFiltered results for: ${this.inputValue ? this.inputValue : color.gray('Enter something to filter')}\\n`;\n }\n\n renderOption(cursor, v, i) {\n let title;\n if (v.disabled) title = cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);else title = cursor === i ? color.cyan().underline(v.title) : v.title;\n return (v.selected ? color.green(figures.radioOn) : figures.radioOff) + ' ' + title;\n }\n\n renderDoneOrInstructions() {\n if (this.done) {\n return this.value.filter(e => e.selected).map(v => v.title).join(', ');\n }\n\n const output = [color.gray(this.hint), this.renderInstructions(), this.renderCurrentInput()];\n\n if (this.filteredOptions.length && this.filteredOptions[this.cursor].disabled) {\n output.push(color.yellow(this.warn));\n }\n\n return output.join(' ');\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n super.render(); // print prompt\n\n let prompt = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(' ');\n\n if (this.showMinError) {\n prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`);\n this.showMinError = false;\n }\n\n prompt += this.renderOptions(this.filteredOptions);\n this.out.write(this.clear + prompt);\n this.clear = clear(prompt, this.out.columns);\n }\n\n}\n\nmodule.exports = AutocompleteMultiselectPrompt;", "\"use strict\";\n\nconst color = require('kleur');\n\nconst Prompt = require('./prompt');\n\nconst _require = require('../util'),\n style = _require.style,\n clear = _require.clear;\n\nconst _require2 = require('sisteransi'),\n erase = _require2.erase,\n cursor = _require2.cursor;\n/**\n * ConfirmPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Boolean} [opts.initial] Default value (true/false)\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {String} [opts.yes] The \"Yes\" label\n * @param {String} [opts.yesOption] The \"Yes\" option when choosing between yes/no\n * @param {String} [opts.no] The \"No\" label\n * @param {String} [opts.noOption] The \"No\" option when choosing between yes/no\n */\n\n\nclass ConfirmPrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.msg = opts.message;\n this.value = opts.initial;\n this.initialValue = !!opts.initial;\n this.yesMsg = opts.yes || 'yes';\n this.yesOption = opts.yesOption || '(Y/n)';\n this.noMsg = opts.no || 'no';\n this.noOption = opts.noOption || '(y/N)';\n this.render();\n }\n\n reset() {\n this.value = this.initialValue;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n this.value = this.value || false;\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n _(c, key) {\n if (c.toLowerCase() === 'y') {\n this.value = true;\n return this.submit();\n }\n\n if (c.toLowerCase() === 'n') {\n this.value = false;\n return this.submit();\n }\n\n return this.bell();\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.done ? this.value ? this.yesMsg : this.noMsg : color.gray(this.initialValue ? this.yesOption : this.noOption)].join(' ');\n this.out.write(erase.line + cursor.to(0) + this.outputText);\n }\n\n}\n\nmodule.exports = ConfirmPrompt;", "'use strict';\n\nmodule.exports = {\n TextPrompt: require('./text'),\n SelectPrompt: require('./select'),\n TogglePrompt: require('./toggle'),\n DatePrompt: require('./date'),\n NumberPrompt: require('./number'),\n MultiselectPrompt: require('./multiselect'),\n AutocompletePrompt: require('./autocomplete'),\n AutocompleteMultiselectPrompt: require('./autocompleteMultiselect'),\n ConfirmPrompt: require('./confirm')\n};", "'use strict';\n\nconst $ = exports;\n\nconst el = require('./elements');\n\nconst noop = v => v;\n\nfunction toPrompt(type, args, opts = {}) {\n return new Promise((res, rej) => {\n const p = new el[type](args);\n const onAbort = opts.onAbort || noop;\n const onSubmit = opts.onSubmit || noop;\n const onExit = opts.onExit || noop;\n p.on('state', args.onState || noop);\n p.on('submit', x => res(onSubmit(x)));\n p.on('exit', x => res(onExit(x)));\n p.on('abort', x => rej(onAbort(x)));\n });\n}\n/**\n * Text prompt\n * @param {string} args.message Prompt message to display\n * @param {string} [args.initial] Default string value\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {function} [args.onState] On state change callback\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.text = args => toPrompt('TextPrompt', args);\n/**\n * Password prompt with masked input\n * @param {string} args.message Prompt message to display\n * @param {string} [args.initial] Default string value\n * @param {function} [args.onState] On state change callback\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.password = args => {\n args.style = 'password';\n return $.text(args);\n};\n/**\n * Prompt where input is invisible, like sudo\n * @param {string} args.message Prompt message to display\n * @param {string} [args.initial] Default string value\n * @param {function} [args.onState] On state change callback\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.invisible = args => {\n args.style = 'invisible';\n return $.text(args);\n};\n/**\n * Number prompt\n * @param {string} args.message Prompt message to display\n * @param {number} args.initial Default number value\n * @param {function} [args.onState] On state change callback\n * @param {number} [args.max] Max value\n * @param {number} [args.min] Min value\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {Boolean} [opts.float=false] Parse input as floats\n * @param {Number} [opts.round=2] Round floats to x decimals\n * @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.number = args => toPrompt('NumberPrompt', args);\n/**\n * Date prompt\n * @param {string} args.message Prompt message to display\n * @param {number} args.initial Default number value\n * @param {function} [args.onState] On state change callback\n * @param {number} [args.max] Max value\n * @param {number} [args.min] Min value\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {Boolean} [opts.float=false] Parse input as floats\n * @param {Number} [opts.round=2] Round floats to x decimals\n * @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.date = args => toPrompt('DatePrompt', args);\n/**\n * Classic yes/no prompt\n * @param {string} args.message Prompt message to display\n * @param {boolean} [args.initial=false] Default value\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.confirm = args => toPrompt('ConfirmPrompt', args);\n/**\n * List prompt, split intput string by `seperator`\n * @param {string} args.message Prompt message to display\n * @param {string} [args.initial] Default string value\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {string} [args.separator] String separator\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input, in form of an `Array`\n */\n\n\n$.list = args => {\n const sep = args.separator || ',';\n return toPrompt('TextPrompt', args, {\n onSubmit: str => str.split(sep).map(s => s.trim())\n });\n};\n/**\n * Toggle/switch prompt\n * @param {string} args.message Prompt message to display\n * @param {boolean} [args.initial=false] Default value\n * @param {string} [args.active=\"on\"] Text for `active` state\n * @param {string} [args.inactive=\"off\"] Text for `inactive` state\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.toggle = args => toPrompt('TogglePrompt', args);\n/**\n * Interactive select prompt\n * @param {string} args.message Prompt message to display\n * @param {Array} args.choices Array of choices objects `[{ title, value }, ...]`\n * @param {number} [args.initial] Index of default value\n * @param {String} [args.hint] Hint to display\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.select = args => toPrompt('SelectPrompt', args);\n/**\n * Interactive multi-select / autocompleteMultiselect prompt\n * @param {string} args.message Prompt message to display\n * @param {Array} args.choices Array of choices objects `[{ title, value, [selected] }, ...]`\n * @param {number} [args.max] Max select\n * @param {string} [args.hint] Hint to display user\n * @param {Number} [args.cursor=0] Cursor start position\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.multiselect = args => {\n args.choices = [].concat(args.choices || []);\n\n const toSelected = items => items.filter(item => item.selected).map(item => item.value);\n\n return toPrompt('MultiselectPrompt', args, {\n onAbort: toSelected,\n onSubmit: toSelected\n });\n};\n\n$.autocompleteMultiselect = args => {\n args.choices = [].concat(args.choices || []);\n\n const toSelected = items => items.filter(item => item.selected).map(item => item.value);\n\n return toPrompt('AutocompleteMultiselectPrompt', args, {\n onAbort: toSelected,\n onSubmit: toSelected\n });\n};\n\nconst byTitle = (input, choices) => Promise.resolve(choices.filter(item => item.title.slice(0, input.length).toLowerCase() === input.toLowerCase()));\n/**\n * Interactive auto-complete prompt\n * @param {string} args.message Prompt message to display\n * @param {Array} args.choices Array of auto-complete choices objects `[{ title, value }, ...]`\n * @param {Function} [args.suggest] Function to filter results based on user input. Defaults to sort by `title`\n * @param {number} [args.limit=10] Max number of results to show\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {String} [args.initial] Index of the default value\n * @param {boolean} [opts.clearFirst] The first ESCAPE keypress will clear the input\n * @param {String} [args.fallback] Fallback message - defaults to initial value\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.autocomplete = args => {\n args.suggest = args.suggest || byTitle;\n args.choices = [].concat(args.choices || []);\n return toPrompt('AutocompletePrompt', args);\n};", "'use strict';\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nconst prompts = require('./prompts');\n\nconst passOn = ['suggest', 'format', 'onState', 'validate', 'onRender', 'type'];\n\nconst noop = () => {};\n/**\n * Prompt for a series of questions\n * @param {Array|Object} questions Single question object or Array of question objects\n * @param {Function} [onSubmit] Callback function called on prompt submit\n * @param {Function} [onCancel] Callback function called on cancel/abort\n * @returns {Object} Object with values from user input\n */\n\n\nfunction prompt() {\n return _prompt.apply(this, arguments);\n}\n\nfunction _prompt() {\n _prompt = _asyncToGenerator(function* (questions = [], {\n onSubmit = noop,\n onCancel = noop\n } = {}) {\n const answers = {};\n const override = prompt._override || {};\n questions = [].concat(questions);\n let answer, question, quit, name, type, lastPrompt;\n\n const getFormattedAnswer = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (question, answer, skipValidation = false) {\n if (!skipValidation && question.validate && question.validate(answer) !== true) {\n return;\n }\n\n return question.format ? yield question.format(answer, answers) : answer;\n });\n\n return function getFormattedAnswer(_x, _x2) {\n return _ref.apply(this, arguments);\n };\n }();\n\n var _iterator = _createForOfIteratorHelper(questions),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n question = _step.value;\n var _question = question;\n name = _question.name;\n type = _question.type;\n\n // evaluate type first and skip if type is a falsy value\n if (typeof type === 'function') {\n type = yield type(answer, _objectSpread({}, answers), question);\n question['type'] = type;\n }\n\n if (!type) continue; // if property is a function, invoke it unless it's a special function\n\n for (let key in question) {\n if (passOn.includes(key)) continue;\n let value = question[key];\n question[key] = typeof value === 'function' ? yield value(answer, _objectSpread({}, answers), lastPrompt) : value;\n }\n\n lastPrompt = question;\n\n if (typeof question.message !== 'string') {\n throw new Error('prompt message is required');\n } // update vars in case they changed\n\n\n var _question2 = question;\n name = _question2.name;\n type = _question2.type;\n\n if (prompts[type] === void 0) {\n throw new Error(`prompt type (${type}) is not defined`);\n }\n\n if (override[question.name] !== undefined) {\n answer = yield getFormattedAnswer(question, override[question.name]);\n\n if (answer !== undefined) {\n answers[name] = answer;\n continue;\n }\n }\n\n try {\n // Get the injected answer if there is one or prompt the user\n answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : yield prompts[type](question);\n answers[name] = answer = yield getFormattedAnswer(question, answer, true);\n quit = yield onSubmit(question, answer, answers);\n } catch (err) {\n quit = !(yield onCancel(question, answers));\n }\n\n if (quit) return answers;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return answers;\n });\n return _prompt.apply(this, arguments);\n}\n\nfunction getInjectedAnswer(injected, deafultValue) {\n const answer = injected.shift();\n\n if (answer instanceof Error) {\n throw answer;\n }\n\n return answer === undefined ? deafultValue : answer;\n}\n\nfunction inject(answers) {\n prompt._injected = (prompt._injected || []).concat(answers);\n}\n\nfunction override(answers) {\n prompt._override = Object.assign({}, answers);\n}\n\nmodule.exports = Object.assign(prompt, {\n prompt,\n prompts,\n inject,\n override\n});", "'use strict';\n\nmodule.exports = (key, isSelect) => {\n if (key.meta && key.name !== 'escape') return;\n \n if (key.ctrl) {\n if (key.name === 'a') return 'first';\n if (key.name === 'c') return 'abort';\n if (key.name === 'd') return 'abort';\n if (key.name === 'e') return 'last';\n if (key.name === 'g') return 'reset';\n }\n \n if (isSelect) {\n if (key.name === 'j') return 'down';\n if (key.name === 'k') return 'up';\n }\n\n if (key.name === 'return') return 'submit';\n if (key.name === 'enter') return 'submit'; // ctrl + J\n if (key.name === 'backspace') return 'delete';\n if (key.name === 'delete') return 'deleteForward';\n if (key.name === 'abort') return 'abort';\n if (key.name === 'escape') return 'exit';\n if (key.name === 'tab') return 'next';\n if (key.name === 'pagedown') return 'nextPage';\n if (key.name === 'pageup') return 'prevPage';\n // TODO create home() in prompt types (e.g. TextPrompt)\n if (key.name === 'home') return 'home';\n // TODO create end() in prompt types (e.g. TextPrompt)\n if (key.name === 'end') return 'end';\n\n if (key.name === 'up') return 'up';\n if (key.name === 'down') return 'down';\n if (key.name === 'right') return 'right';\n if (key.name === 'left') return 'left';\n\n return false;\n};\n", "'use strict';\n\nmodule.exports = str => {\n const pattern = [\n '[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)',\n '(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PRZcf-ntqry=><~]))'\n ].join('|');\n\n const RGX = new RegExp(pattern, 'g');\n return typeof str === 'string' ? str.replace(RGX, '') : str;\n};\n", "'use strict';\n\nconst strip = require('./strip');\nconst { erase, cursor } = require('sisteransi');\n\nconst width = str => [...strip(str)].length;\n\n/**\n * @param {string} prompt\n * @param {number} perLine\n */\nmodule.exports = function(prompt, perLine) {\n if (!perLine) return erase.line + cursor.to(0);\n\n let rows = 0;\n const lines = prompt.split(/\\r?\\n/);\n for (let line of lines) {\n rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / perLine);\n }\n\n return erase.lines(rows);\n};\n", "'use strict';\t\n\n const main = {\n arrowUp: '\u2191',\n arrowDown: '\u2193',\n arrowLeft: '\u2190',\n arrowRight: '\u2192',\n radioOn: '\u25C9',\n radioOff: '\u25EF',\n tick: '\u2714',\t\n cross: '\u2716',\t\n ellipsis: '\u2026',\t\n pointerSmall: '\u203A',\t\n line: '\u2500',\t\n pointer: '\u276F'\t\n};\t\nconst win = {\n arrowUp: main.arrowUp,\n arrowDown: main.arrowDown,\n arrowLeft: main.arrowLeft,\n arrowRight: main.arrowRight,\n radioOn: '(*)',\n radioOff: '( )',\t\n tick: '\u221A',\t\n cross: '\u00D7',\t\n ellipsis: '...',\t\n pointerSmall: '\u00BB',\t\n line: '\u2500',\t\n pointer: '>'\t\n};\t\nconst figures = process.platform === 'win32' ? win : main;\t\n\n module.exports = figures;\n", "'use strict';\n\nconst c = require('kleur');\nconst figures = require('./figures');\n\n// rendering user input.\nconst styles = Object.freeze({\n password: { scale: 1, render: input => '*'.repeat(input.length) },\n emoji: { scale: 2, render: input => '\uD83D\uDE03'.repeat(input.length) },\n invisible: { scale: 0, render: input => '' },\n default: { scale: 1, render: input => `${input}` }\n});\nconst render = type => styles[type] || styles.default;\n\n// icon to signalize a prompt.\nconst symbols = Object.freeze({\n aborted: c.red(figures.cross),\n done: c.green(figures.tick),\n exited: c.yellow(figures.cross),\n default: c.cyan('?')\n});\n\nconst symbol = (done, aborted, exited) =>\n aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default;\n\n// between the question and the user's input.\nconst delimiter = completing =>\n c.gray(completing ? figures.ellipsis : figures.pointerSmall);\n\nconst item = (expandable, expanded) =>\n c.gray(expandable ? (expanded ? figures.pointerSmall : '+') : figures.line);\n\nmodule.exports = {\n styles,\n render,\n symbols,\n symbol,\n delimiter,\n item\n};\n", "'use strict';\n\nconst strip = require('./strip');\n\n/**\n * @param {string} msg\n * @param {number} perLine\n */\nmodule.exports = function (msg, perLine) {\n let lines = String(strip(msg) || '').split(/\\r?\\n/);\n\n if (!perLine) return lines.length;\n return lines.map(l => Math.ceil(l.length / perLine))\n .reduce((a, b) => a + b);\n};\n", "'use strict';\n\n/**\n * @param {string} msg The message to wrap\n * @param {object} opts\n * @param {number|string} [opts.margin] Left margin\n * @param {number} opts.width Maximum characters per line including the margin\n */\nmodule.exports = (msg, opts = {}) => {\n const tab = Number.isSafeInteger(parseInt(opts.margin))\n ? new Array(parseInt(opts.margin)).fill(' ').join('')\n : (opts.margin || '');\n\n const width = opts.width;\n\n return (msg || '').split(/\\r?\\n/g)\n .map(line => line\n .split(/\\s+/g)\n .reduce((arr, w) => {\n if (w.length + tab.length >= width || arr[arr.length - 1].length + w.length + 1 < width)\n arr[arr.length - 1] += ` ${w}`;\n else arr.push(`${tab}${w}`);\n return arr;\n }, [ tab ])\n .join('\\n'))\n .join('\\n');\n};\n", "'use strict';\n\n/**\n * Determine what entries should be displayed on the screen, based on the\n * currently selected index and the maximum visible. Used in list-based\n * prompts like `select` and `multiselect`.\n *\n * @param {number} cursor the currently selected entry\n * @param {number} total the total entries available to display\n * @param {number} [maxVisible] the number of entries that can be displayed\n */\nmodule.exports = (cursor, total, maxVisible) => {\n maxVisible = maxVisible || total;\n\n let startIndex = Math.min(total- maxVisible, cursor - Math.floor(maxVisible / 2));\n if (startIndex < 0) startIndex = 0;\n\n let endIndex = Math.min(startIndex + maxVisible, total);\n\n return { startIndex, endIndex };\n};\n", "'use strict';\n\nmodule.exports = {\n action: require('./action'),\n clear: require('./clear'),\n style: require('./style'),\n strip: require('./strip'),\n figures: require('./figures'),\n lines: require('./lines'),\n wrap: require('./wrap'),\n entriesToDisplay: require('./entriesToDisplay')\n};\n", "'use strict';\n\nconst readline = require('readline');\nconst { action } = require('../util');\nconst EventEmitter = require('events');\nconst { beep, cursor } = require('sisteransi');\nconst color = require('kleur');\n\n/**\n * Base prompt skeleton\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\nclass Prompt extends EventEmitter {\n constructor(opts={}) {\n super();\n\n this.firstRender = true;\n this.in = opts.stdin || process.stdin;\n this.out = opts.stdout || process.stdout;\n this.onRender = (opts.onRender || (() => void 0)).bind(this);\n const rl = readline.createInterface({ input:this.in, escapeCodeTimeout:50 });\n readline.emitKeypressEvents(this.in, rl);\n\n if (this.in.isTTY) this.in.setRawMode(true);\n const isSelect = [ 'SelectPrompt', 'MultiselectPrompt' ].indexOf(this.constructor.name) > -1;\n const keypress = (str, key) => {\n let a = action(key, isSelect);\n if (a === false) {\n this._ && this._(str, key);\n } else if (typeof this[a] === 'function') {\n this[a](key);\n } else {\n this.bell();\n }\n };\n\n this.close = () => {\n this.out.write(cursor.show);\n this.in.removeListener('keypress', keypress);\n if (this.in.isTTY) this.in.setRawMode(false);\n rl.close();\n this.emit(this.aborted ? 'abort' : this.exited ? 'exit' : 'submit', this.value);\n this.closed = true;\n };\n\n this.in.on('keypress', keypress);\n }\n\n fire() {\n this.emit('state', {\n value: this.value,\n aborted: !!this.aborted,\n exited: !!this.exited\n });\n }\n\n bell() {\n this.out.write(beep);\n }\n\n render() {\n this.onRender(color);\n if (this.firstRender) this.firstRender = false;\n }\n}\n\nmodule.exports = Prompt;\n", "const color = require('kleur');\nconst Prompt = require('./prompt');\nconst { erase, cursor } = require('sisteransi');\nconst { style, clear, lines, figures } = require('../util');\n\n/**\n * TextPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {String} [opts.style='default'] Render style\n * @param {String} [opts.initial] Default value\n * @param {Function} [opts.validate] Validate function\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {String} [opts.error] The invalid error label\n */\nclass TextPrompt extends Prompt {\n constructor(opts={}) {\n super(opts);\n this.transform = style.render(opts.style);\n this.scale = this.transform.scale;\n this.msg = opts.message;\n this.initial = opts.initial || ``;\n this.validator = opts.validate || (() => true);\n this.value = ``;\n this.errorMsg = opts.error || `Please Enter A Valid Value`;\n this.cursor = Number(!!this.initial);\n this.cursorOffset = 0;\n this.clear = clear(``, this.out.columns);\n this.render();\n }\n\n set value(v) {\n if (!v && this.initial) {\n this.placeholder = true;\n this.rendered = color.gray(this.transform.render(this.initial));\n } else {\n this.placeholder = false;\n this.rendered = this.transform.render(v);\n }\n this._value = v;\n this.fire();\n }\n\n get value() {\n return this._value;\n }\n\n reset() {\n this.value = ``;\n this.cursor = Number(!!this.initial);\n this.cursorOffset = 0;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.value = this.value || this.initial;\n this.done = this.aborted = true;\n this.error = false;\n this.red = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n async validate() {\n let valid = await this.validator(this.value);\n if (typeof valid === `string`) {\n this.errorMsg = valid;\n valid = false;\n }\n this.error = !valid;\n }\n\n async submit() {\n this.value = this.value || this.initial;\n this.cursorOffset = 0;\n this.cursor = this.rendered.length;\n await this.validate();\n if (this.error) {\n this.red = true;\n this.fire();\n this.render();\n return;\n }\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n next() {\n if (!this.placeholder) return this.bell();\n this.value = this.initial;\n this.cursor = this.rendered.length;\n this.fire();\n this.render();\n }\n\n moveCursor(n) {\n if (this.placeholder) return;\n this.cursor = this.cursor+n;\n this.cursorOffset += n;\n }\n\n _(c, key) {\n let s1 = this.value.slice(0, this.cursor);\n let s2 = this.value.slice(this.cursor);\n this.value = `${s1}${c}${s2}`;\n this.red = false;\n this.cursor = this.placeholder ? 0 : s1.length+1;\n this.render();\n }\n\n delete() {\n if (this.isCursorAtStart()) return this.bell();\n let s1 = this.value.slice(0, this.cursor-1);\n let s2 = this.value.slice(this.cursor);\n this.value = `${s1}${s2}`;\n this.red = false;\n if (this.isCursorAtStart()) {\n this.cursorOffset = 0\n } else {\n this.cursorOffset++;\n this.moveCursor(-1);\n }\n this.render();\n }\n\n deleteForward() {\n if(this.cursor*this.scale >= this.rendered.length || this.placeholder) return this.bell();\n let s1 = this.value.slice(0, this.cursor);\n let s2 = this.value.slice(this.cursor+1);\n this.value = `${s1}${s2}`;\n this.red = false;\n if (this.isCursorAtEnd()) {\n this.cursorOffset = 0;\n } else {\n this.cursorOffset++;\n }\n this.render();\n }\n\n first() {\n this.cursor = 0;\n this.render();\n }\n\n last() {\n this.cursor = this.value.length;\n this.render();\n }\n\n left() {\n if (this.cursor <= 0 || this.placeholder) return this.bell();\n this.moveCursor(-1);\n this.render();\n }\n\n right() {\n if (this.cursor*this.scale >= this.rendered.length || this.placeholder) return this.bell();\n this.moveCursor(1);\n this.render();\n }\n\n isCursorAtStart() {\n return this.cursor === 0 || (this.placeholder && this.cursor === 1);\n }\n\n isCursorAtEnd() {\n return this.cursor === this.rendered.length || (this.placeholder && this.cursor === this.rendered.length + 1)\n }\n\n render() {\n if (this.closed) return;\n if (!this.firstRender) {\n if (this.outputError)\n this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));\n this.out.write(clear(this.outputText, this.out.columns));\n }\n super.render();\n this.outputError = '';\n\n this.outputText = [\n style.symbol(this.done, this.aborted),\n color.bold(this.msg),\n style.delimiter(this.done),\n this.red ? color.red(this.rendered) : this.rendered\n ].join(` `);\n\n if (this.error) {\n this.outputError += this.errorMsg.split(`\\n`)\n .reduce((a, l, i) => a + `\\n${i ? ' ' : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n }\n\n this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore + cursor.move(this.cursorOffset, 0));\n }\n}\n\nmodule.exports = TextPrompt;", "'use strict';\n\nconst color = require('kleur');\nconst Prompt = require('./prompt');\nconst { style, clear, figures, wrap, entriesToDisplay } = require('../util');\nconst { cursor } = require('sisteransi');\n\n/**\n * SelectPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Array} opts.choices Array of choice objects\n * @param {String} [opts.hint] Hint to display\n * @param {Number} [opts.initial] Index of default value\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {Number} [opts.optionsPerPage=10] Max options to display at once\n */\nclass SelectPrompt extends Prompt {\n constructor(opts={}) {\n super(opts);\n this.msg = opts.message;\n this.hint = opts.hint || '- Use arrow-keys. Return to submit.';\n this.warn = opts.warn || '- This option is disabled';\n this.cursor = opts.initial || 0;\n this.choices = opts.choices.map((ch, idx) => {\n if (typeof ch === 'string')\n ch = {title: ch, value: idx};\n return {\n title: ch && (ch.title || ch.value || ch),\n value: ch && (ch.value === undefined ? idx : ch.value),\n description: ch && ch.description,\n selected: ch && ch.selected,\n disabled: ch && ch.disabled\n };\n });\n this.optionsPerPage = opts.optionsPerPage || 10;\n this.value = (this.choices[this.cursor] || {}).value;\n this.clear = clear('', this.out.columns);\n this.render();\n }\n\n moveCursor(n) {\n this.cursor = n;\n this.value = this.choices[n].value;\n this.fire();\n }\n\n reset() {\n this.moveCursor(0);\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n if (!this.selection.disabled) {\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n } else\n this.bell();\n }\n\n first() {\n this.moveCursor(0);\n this.render();\n }\n\n last() {\n this.moveCursor(this.choices.length - 1);\n this.render();\n }\n\n up() {\n if (this.cursor === 0) {\n this.moveCursor(this.choices.length - 1);\n } else {\n this.moveCursor(this.cursor - 1);\n }\n this.render();\n }\n\n down() {\n if (this.cursor === this.choices.length - 1) {\n this.moveCursor(0);\n } else {\n this.moveCursor(this.cursor + 1);\n }\n this.render();\n }\n\n next() {\n this.moveCursor((this.cursor + 1) % this.choices.length);\n this.render();\n }\n\n _(c, key) {\n if (c === ' ') return this.submit();\n }\n\n get selection() {\n return this.choices[this.cursor];\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n\n let { startIndex, endIndex } = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage);\n\n // Print prompt\n this.outputText = [\n style.symbol(this.done, this.aborted),\n color.bold(this.msg),\n style.delimiter(false),\n this.done ? this.selection.title : this.selection.disabled\n ? color.yellow(this.warn) : color.gray(this.hint)\n ].join(' ');\n\n // Print choices\n if (!this.done) {\n this.outputText += '\\n';\n for (let i = startIndex; i < endIndex; i++) {\n let title, prefix, desc = '', v = this.choices[i];\n\n // Determine whether to display \"more choices\" indicators\n if (i === startIndex && startIndex > 0) {\n prefix = figures.arrowUp;\n } else if (i === endIndex - 1 && endIndex < this.choices.length) {\n prefix = figures.arrowDown;\n } else {\n prefix = ' ';\n }\n\n if (v.disabled) {\n title = this.cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);\n prefix = (this.cursor === i ? color.bold().gray(figures.pointer) + ' ' : ' ') + prefix;\n } else {\n title = this.cursor === i ? color.cyan().underline(v.title) : v.title;\n prefix = (this.cursor === i ? color.cyan(figures.pointer) + ' ' : ' ') + prefix;\n if (v.description && this.cursor === i) {\n desc = ` - ${v.description}`;\n if (prefix.length + title.length + desc.length >= this.out.columns\n || v.description.split(/\\r?\\n/).length > 1) {\n desc = '\\n' + wrap(v.description, { margin: 3, width: this.out.columns });\n }\n }\n }\n\n this.outputText += `${prefix} ${title}${color.gray(desc)}\\n`;\n }\n }\n\n this.out.write(this.outputText);\n }\n}\n\nmodule.exports = SelectPrompt;\n", "const color = require('kleur');\nconst Prompt = require('./prompt');\nconst { style, clear } = require('../util');\nconst { cursor, erase } = require('sisteransi');\n\n/**\n * TogglePrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Boolean} [opts.initial=false] Default value\n * @param {String} [opts.active='no'] Active label\n * @param {String} [opts.inactive='off'] Inactive label\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\nclass TogglePrompt extends Prompt {\n constructor(opts={}) {\n super(opts);\n this.msg = opts.message;\n this.value = !!opts.initial;\n this.active = opts.active || 'on';\n this.inactive = opts.inactive || 'off';\n this.initialValue = this.value;\n this.render();\n }\n\n reset() {\n this.value = this.initialValue;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n deactivate() {\n if (this.value === false) return this.bell();\n this.value = false;\n this.render();\n }\n\n activate() {\n if (this.value === true) return this.bell();\n this.value = true;\n this.render();\n }\n\n delete() {\n this.deactivate();\n }\n left() {\n this.deactivate();\n }\n right() {\n this.activate();\n }\n down() {\n this.deactivate();\n }\n up() {\n this.activate();\n }\n\n next() {\n this.value = !this.value;\n this.fire();\n this.render();\n }\n\n _(c, key) {\n if (c === ' ') {\n this.value = !this.value;\n } else if (c === '1') {\n this.value = true;\n } else if (c === '0') {\n this.value = false;\n } else return this.bell();\n this.render();\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n\n this.outputText = [\n style.symbol(this.done, this.aborted),\n color.bold(this.msg),\n style.delimiter(this.done),\n this.value ? this.inactive : color.cyan().underline(this.inactive),\n color.gray('/'),\n this.value ? color.cyan().underline(this.active) : this.active\n ].join(' ');\n\n this.out.write(erase.line + cursor.to(0) + this.outputText);\n }\n}\n\nmodule.exports = TogglePrompt;\n", "'use strict';\n\nclass DatePart {\n constructor({token, date, parts, locales}) {\n this.token = token;\n this.date = date || new Date();\n this.parts = parts || [this];\n this.locales = locales || {};\n }\n\n up() {}\n\n down() {}\n\n next() {\n const currentIdx = this.parts.indexOf(this);\n return this.parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);\n }\n\n setTo(val) {}\n\n prev() {\n let parts = [].concat(this.parts).reverse();\n const currentIdx = parts.indexOf(this);\n return parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);\n }\n\n toString() {\n return String(this.date);\n }\n}\n\nmodule.exports = DatePart;\n\n\n", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Meridiem extends DatePart {\n constructor(opts={}) {\n super(opts);\n }\n\n up() {\n this.date.setHours((this.date.getHours() + 12) % 24);\n }\n\n down() {\n this.up();\n }\n\n toString() {\n let meridiem = this.date.getHours() > 12 ? 'pm' : 'am';\n return /\\A/.test(this.token) ? meridiem.toUpperCase() : meridiem;\n }\n}\n\nmodule.exports = Meridiem;\n", "'use strict';\n\nconst DatePart = require('./datepart');\n\nconst pos = n => {\n n = n % 10;\n return n === 1 ? 'st'\n : n === 2 ? 'nd'\n : n === 3 ? 'rd'\n : 'th';\n}\n\nclass Day extends DatePart {\n constructor(opts={}) {\n super(opts);\n }\n\n up() {\n this.date.setDate(this.date.getDate() + 1);\n }\n\n down() {\n this.date.setDate(this.date.getDate() - 1);\n }\n\n setTo(val) {\n this.date.setDate(parseInt(val.substr(-2)));\n }\n\n toString() {\n let date = this.date.getDate();\n let day = this.date.getDay();\n return this.token === 'DD' ? String(date).padStart(2, '0')\n : this.token === 'Do' ? date + pos(date)\n : this.token === 'd' ? day + 1\n : this.token === 'ddd' ? this.locales.weekdaysShort[day]\n : this.token === 'dddd' ? this.locales.weekdays[day]\n : date;\n }\n}\n\nmodule.exports = Day;\n", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Hours extends DatePart {\n constructor(opts={}) {\n super(opts);\n }\n\n up() {\n this.date.setHours(this.date.getHours() + 1);\n }\n\n down() {\n this.date.setHours(this.date.getHours() - 1);\n }\n\n setTo(val) {\n this.date.setHours(parseInt(val.substr(-2)));\n }\n\n toString() {\n let hours = this.date.getHours();\n if (/h/.test(this.token))\n hours = (hours % 12) || 12;\n return this.token.length > 1 ? String(hours).padStart(2, '0') : hours;\n }\n}\n\nmodule.exports = Hours;\n", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Milliseconds extends DatePart {\n constructor(opts={}) {\n super(opts);\n }\n\n up() {\n this.date.setMilliseconds(this.date.getMilliseconds() + 1);\n }\n\n down() {\n this.date.setMilliseconds(this.date.getMilliseconds() - 1);\n }\n\n setTo(val) {\n this.date.setMilliseconds(parseInt(val.substr(-(this.token.length))));\n }\n\n toString() {\n return String(this.date.getMilliseconds()).padStart(4, '0')\n .substr(0, this.token.length);\n }\n}\n\nmodule.exports = Milliseconds;\n", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Minutes extends DatePart {\n constructor(opts={}) {\n super(opts);\n }\n\n up() {\n this.date.setMinutes(this.date.getMinutes() + 1);\n }\n\n down() {\n this.date.setMinutes(this.date.getMinutes() - 1);\n }\n\n setTo(val) {\n this.date.setMinutes(parseInt(val.substr(-2)));\n }\n\n toString() {\n let m = this.date.getMinutes();\n return this.token.length > 1 ? String(m).padStart(2, '0') : m;\n }\n}\n\nmodule.exports = Minutes;\n", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Month extends DatePart {\n constructor(opts={}) {\n super(opts);\n }\n\n up() {\n this.date.setMonth(this.date.getMonth() + 1);\n }\n\n down() {\n this.date.setMonth(this.date.getMonth() - 1);\n }\n\n setTo(val) {\n val = parseInt(val.substr(-2)) - 1;\n this.date.setMonth(val < 0 ? 0 : val);\n }\n\n toString() {\n let month = this.date.getMonth();\n let tl = this.token.length;\n return tl === 2 ? String(month + 1).padStart(2, '0')\n : tl === 3 ? this.locales.monthsShort[month]\n : tl === 4 ? this.locales.months[month]\n : String(month + 1);\n }\n}\n\nmodule.exports = Month;\n", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Seconds extends DatePart {\n constructor(opts={}) {\n super(opts);\n }\n\n up() {\n this.date.setSeconds(this.date.getSeconds() + 1);\n }\n\n down() {\n this.date.setSeconds(this.date.getSeconds() - 1);\n }\n\n setTo(val) {\n this.date.setSeconds(parseInt(val.substr(-2)));\n }\n\n toString() {\n let s = this.date.getSeconds();\n return this.token.length > 1 ? String(s).padStart(2, '0') : s;\n }\n}\n\nmodule.exports = Seconds;\n", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Year extends DatePart {\n constructor(opts={}) {\n super(opts);\n }\n\n up() {\n this.date.setFullYear(this.date.getFullYear() + 1);\n }\n\n down() {\n this.date.setFullYear(this.date.getFullYear() - 1);\n }\n\n setTo(val) {\n this.date.setFullYear(val.substr(-4));\n }\n\n toString() {\n let year = String(this.date.getFullYear()).padStart(4, '0');\n return this.token.length === 2 ? year.substr(-2) : year;\n }\n}\n\nmodule.exports = Year;\n", "'use strict';\n\nmodule.exports = {\n DatePart: require('./datepart'),\n Meridiem: require('./meridiem'),\n Day: require('./day'),\n Hours: require('./hours'),\n Milliseconds: require('./milliseconds'),\n Minutes: require('./minutes'),\n Month: require('./month'),\n Seconds: require('./seconds'),\n Year: require('./year'),\n}\n", "'use strict';\n\nconst color = require('kleur');\nconst Prompt = require('./prompt');\nconst { style, clear, figures } = require('../util');\nconst { erase, cursor } = require('sisteransi');\nconst { DatePart, Meridiem, Day, Hours, Milliseconds, Minutes, Month, Seconds, Year } = require('../dateparts');\n\nconst regex = /\\\\(.)|\"((?:\\\\[\"\\\\]|[^\"])+)\"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;\nconst regexGroups = {\n 1: ({token}) => token.replace(/\\\\(.)/g, '$1'),\n 2: (opts) => new Day(opts), // Day // TODO\n 3: (opts) => new Month(opts), // Month\n 4: (opts) => new Year(opts), // Year\n 5: (opts) => new Meridiem(opts), // AM/PM // TODO (special)\n 6: (opts) => new Hours(opts), // Hours\n 7: (opts) => new Minutes(opts), // Minutes\n 8: (opts) => new Seconds(opts), // Seconds\n 9: (opts) => new Milliseconds(opts), // Fractional seconds\n}\n\nconst dfltLocales = {\n months: 'January,February,March,April,May,June,July,August,September,October,November,December'.split(','),\n monthsShort: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),\n weekdays: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),\n weekdaysShort: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(',')\n}\n\n\n/**\n * DatePrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Number} [opts.initial] Index of default value\n * @param {String} [opts.mask] The format mask\n * @param {object} [opts.locales] The date locales\n * @param {String} [opts.error] The error message shown on invalid value\n * @param {Function} [opts.validate] Function to validate the submitted value\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\nclass DatePrompt extends Prompt {\n constructor(opts={}) {\n super(opts);\n this.msg = opts.message;\n this.cursor = 0;\n this.typed = '';\n this.locales = Object.assign(dfltLocales, opts.locales);\n this._date = opts.initial || new Date();\n this.errorMsg = opts.error || 'Please Enter A Valid Value';\n this.validator = opts.validate || (() => true);\n this.mask = opts.mask || 'YYYY-MM-DD HH:mm:ss';\n this.clear = clear('', this.out.columns);\n this.render();\n }\n\n get value() {\n return this.date\n }\n\n get date() {\n return this._date;\n }\n\n set date(date) {\n if (date) this._date.setTime(date.getTime());\n }\n\n set mask(mask) {\n let result;\n this.parts = [];\n while(result = regex.exec(mask)) {\n let match = result.shift();\n let idx = result.findIndex(gr => gr != null);\n this.parts.push(idx in regexGroups\n ? regexGroups[idx]({ token: result[idx] || match, date: this.date, parts: this.parts, locales: this.locales })\n : result[idx] || match);\n }\n\n let parts = this.parts.reduce((arr, i) => {\n if (typeof i === 'string' && typeof arr[arr.length - 1] === 'string')\n arr[arr.length - 1] += i;\n else arr.push(i);\n return arr;\n }, []);\n\n this.parts.splice(0);\n this.parts.push(...parts);\n this.reset();\n }\n\n moveCursor(n) {\n this.typed = '';\n this.cursor = n;\n this.fire();\n }\n\n reset() {\n this.moveCursor(this.parts.findIndex(p => p instanceof DatePart));\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.error = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n async validate() {\n let valid = await this.validator(this.value);\n if (typeof valid === 'string') {\n this.errorMsg = valid;\n valid = false;\n }\n this.error = !valid;\n }\n\n async submit() {\n await this.validate();\n if (this.error) {\n this.color = 'red';\n this.fire();\n this.render();\n return;\n }\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n up() {\n this.typed = '';\n this.parts[this.cursor].up();\n this.render();\n }\n\n down() {\n this.typed = '';\n this.parts[this.cursor].down();\n this.render();\n }\n\n left() {\n let prev = this.parts[this.cursor].prev();\n if (prev == null) return this.bell();\n this.moveCursor(this.parts.indexOf(prev));\n this.render();\n }\n\n right() {\n let next = this.parts[this.cursor].next();\n if (next == null) return this.bell();\n this.moveCursor(this.parts.indexOf(next));\n this.render();\n }\n\n next() {\n let next = this.parts[this.cursor].next();\n this.moveCursor(next\n ? this.parts.indexOf(next)\n : this.parts.findIndex((part) => part instanceof DatePart));\n this.render();\n }\n\n _(c) {\n if (/\\d/.test(c)) {\n this.typed += c;\n this.parts[this.cursor].setTo(this.typed);\n this.render();\n }\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n\n // Print prompt\n this.outputText = [\n style.symbol(this.done, this.aborted),\n color.bold(this.msg),\n style.delimiter(false),\n this.parts.reduce((arr, p, idx) => arr.concat(idx === this.cursor && !this.done ? color.cyan().underline(p.toString()) : p), [])\n .join('')\n ].join(' ');\n\n // Print error\n if (this.error) {\n this.outputText += this.errorMsg.split('\\n').reduce(\n (a, l, i) => a + `\\n${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n }\n\n this.out.write(erase.line + cursor.to(0) + this.outputText);\n }\n}\n\nmodule.exports = DatePrompt;\n", "const color = require('kleur');\nconst Prompt = require('./prompt');\nconst { cursor, erase } = require('sisteransi');\nconst { style, figures, clear, lines } = require('../util');\n\nconst isNumber = /[0-9]/;\nconst isDef = any => any !== undefined;\nconst round = (number, precision) => {\n let factor = Math.pow(10, precision);\n return Math.round(number * factor) / factor;\n}\n\n/**\n * NumberPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {String} [opts.style='default'] Render style\n * @param {Number} [opts.initial] Default value\n * @param {Number} [opts.max=+Infinity] Max value\n * @param {Number} [opts.min=-Infinity] Min value\n * @param {Boolean} [opts.float=false] Parse input as floats\n * @param {Number} [opts.round=2] Round floats to x decimals\n * @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n * @param {Function} [opts.validate] Validate function\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {String} [opts.error] The invalid error label\n */\nclass NumberPrompt extends Prompt {\n constructor(opts={}) {\n super(opts);\n this.transform = style.render(opts.style);\n this.msg = opts.message;\n this.initial = isDef(opts.initial) ? opts.initial : '';\n this.float = !!opts.float;\n this.round = opts.round || 2;\n this.inc = opts.increment || 1;\n this.min = isDef(opts.min) ? opts.min : -Infinity;\n this.max = isDef(opts.max) ? opts.max : Infinity;\n this.errorMsg = opts.error || `Please Enter A Valid Value`;\n this.validator = opts.validate || (() => true);\n this.color = `cyan`;\n this.value = ``;\n this.typed = ``;\n this.lastHit = 0;\n this.render();\n }\n\n set value(v) {\n if (!v && v !== 0) {\n this.placeholder = true;\n this.rendered = color.gray(this.transform.render(`${this.initial}`));\n this._value = ``;\n } else {\n this.placeholder = false;\n this.rendered = this.transform.render(`${round(v, this.round)}`);\n this._value = round(v, this.round);\n }\n this.fire();\n }\n\n get value() {\n return this._value;\n }\n\n parse(x) {\n return this.float ? parseFloat(x) : parseInt(x);\n }\n\n valid(c) {\n return c === `-` || c === `.` && this.float || isNumber.test(c)\n }\n\n reset() {\n this.typed = ``;\n this.value = ``;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n let x = this.value;\n this.value = x !== `` ? x : this.initial;\n this.done = this.aborted = true;\n this.error = false;\n this.fire();\n this.render();\n this.out.write(`\\n`);\n this.close();\n }\n\n async validate() {\n let valid = await this.validator(this.value);\n if (typeof valid === `string`) {\n this.errorMsg = valid;\n valid = false;\n }\n this.error = !valid;\n }\n\n async submit() {\n await this.validate();\n if (this.error) {\n this.color = `red`;\n this.fire();\n this.render();\n return;\n }\n let x = this.value;\n this.value = x !== `` ? x : this.initial;\n this.done = true;\n this.aborted = false;\n this.error = false;\n this.fire();\n this.render();\n this.out.write(`\\n`);\n this.close();\n }\n\n up() {\n this.typed = ``;\n if(this.value === '') {\n this.value = this.min - this.inc;\n }\n if (this.value >= this.max) return this.bell();\n this.value += this.inc;\n this.color = `cyan`;\n this.fire();\n this.render();\n }\n\n down() {\n this.typed = ``;\n if(this.value === '') {\n this.value = this.min + this.inc;\n }\n if (this.value <= this.min) return this.bell();\n this.value -= this.inc;\n this.color = `cyan`;\n this.fire();\n this.render();\n }\n\n delete() {\n let val = this.value.toString();\n if (val.length === 0) return this.bell();\n this.value = this.parse((val = val.slice(0, -1))) || ``;\n if (this.value !== '' && this.value < this.min) {\n this.value = this.min;\n }\n this.color = `cyan`;\n this.fire();\n this.render();\n }\n\n next() {\n this.value = this.initial;\n this.fire();\n this.render();\n }\n\n _(c, key) {\n if (!this.valid(c)) return this.bell();\n\n const now = Date.now();\n if (now - this.lastHit > 1000) this.typed = ``; // 1s elapsed\n this.typed += c;\n this.lastHit = now;\n this.color = `cyan`;\n\n if (c === `.`) return this.fire();\n\n this.value = Math.min(this.parse(this.typed), this.max);\n if (this.value > this.max) this.value = this.max;\n if (this.value < this.min) this.value = this.min;\n this.fire();\n this.render();\n }\n\n render() {\n if (this.closed) return;\n if (!this.firstRender) {\n if (this.outputError)\n this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));\n this.out.write(clear(this.outputText, this.out.columns));\n }\n super.render();\n this.outputError = '';\n\n // Print prompt\n this.outputText = [\n style.symbol(this.done, this.aborted),\n color.bold(this.msg),\n style.delimiter(this.done),\n !this.done || (!this.done && !this.placeholder)\n ? color[this.color]().underline(this.rendered) : this.rendered\n ].join(` `);\n\n // Print error\n if (this.error) {\n this.outputError += this.errorMsg.split(`\\n`)\n .reduce((a, l, i) => a + `\\n${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n }\n\n this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore);\n }\n}\n\nmodule.exports = NumberPrompt;\n", "'use strict';\n\nconst color = require('kleur');\nconst { cursor } = require('sisteransi');\nconst Prompt = require('./prompt');\nconst { clear, figures, style, wrap, entriesToDisplay } = require('../util');\n\n/**\n * MultiselectPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Array} opts.choices Array of choice objects\n * @param {String} [opts.hint] Hint to display\n * @param {String} [opts.warn] Hint shown for disabled choices\n * @param {Number} [opts.max] Max choices\n * @param {Number} [opts.cursor=0] Cursor start position\n * @param {Number} [opts.optionsPerPage=10] Max options to display at once\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\nclass MultiselectPrompt extends Prompt {\n constructor(opts={}) {\n super(opts);\n this.msg = opts.message;\n this.cursor = opts.cursor || 0;\n this.scrollIndex = opts.cursor || 0;\n this.hint = opts.hint || '';\n this.warn = opts.warn || '- This option is disabled -';\n this.minSelected = opts.min;\n this.showMinError = false;\n this.maxChoices = opts.max;\n this.instructions = opts.instructions;\n this.optionsPerPage = opts.optionsPerPage || 10;\n this.value = opts.choices.map((ch, idx) => {\n if (typeof ch === 'string')\n ch = {title: ch, value: idx};\n return {\n title: ch && (ch.title || ch.value || ch),\n description: ch && ch.description,\n value: ch && (ch.value === undefined ? idx : ch.value),\n selected: ch && ch.selected,\n disabled: ch && ch.disabled\n };\n });\n this.clear = clear('', this.out.columns);\n if (!opts.overrideRender) {\n this.render();\n }\n }\n\n reset() {\n this.value.map(v => !v.selected);\n this.cursor = 0;\n this.fire();\n this.render();\n }\n\n selected() {\n return this.value.filter(v => v.selected);\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n const selected = this.value\n .filter(e => e.selected);\n if (this.minSelected && selected.length < this.minSelected) {\n this.showMinError = true;\n this.render();\n } else {\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n }\n\n first() {\n this.cursor = 0;\n this.render();\n }\n\n last() {\n this.cursor = this.value.length - 1;\n this.render();\n }\n next() {\n this.cursor = (this.cursor + 1) % this.value.length;\n this.render();\n }\n\n up() {\n if (this.cursor === 0) {\n this.cursor = this.value.length - 1;\n } else {\n this.cursor--;\n }\n this.render();\n }\n\n down() {\n if (this.cursor === this.value.length - 1) {\n this.cursor = 0;\n } else {\n this.cursor++;\n }\n this.render();\n }\n\n left() {\n this.value[this.cursor].selected = false;\n this.render();\n }\n\n right() {\n if (this.value.filter(e => e.selected).length >= this.maxChoices) return this.bell();\n this.value[this.cursor].selected = true;\n this.render();\n }\n\n handleSpaceToggle() {\n const v = this.value[this.cursor];\n\n if (v.selected) {\n v.selected = false;\n this.render();\n } else if (v.disabled || this.value.filter(e => e.selected).length >= this.maxChoices) {\n return this.bell();\n } else {\n v.selected = true;\n this.render();\n }\n }\n\n toggleAll() {\n if (this.maxChoices !== undefined || this.value[this.cursor].disabled) {\n return this.bell();\n }\n\n const newSelected = !this.value[this.cursor].selected;\n this.value.filter(v => !v.disabled).forEach(v => v.selected = newSelected);\n this.render();\n }\n\n _(c, key) {\n if (c === ' ') {\n this.handleSpaceToggle();\n } else if (c === 'a') {\n this.toggleAll();\n } else {\n return this.bell();\n }\n }\n\n renderInstructions() {\n if (this.instructions === undefined || this.instructions) {\n if (typeof this.instructions === 'string') {\n return this.instructions;\n }\n return '\\nInstructions:\\n'\n + ` ${figures.arrowUp}/${figures.arrowDown}: Highlight option\\n`\n + ` ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection\\n`\n + (this.maxChoices === undefined ? ` a: Toggle all\\n` : '')\n + ` enter/return: Complete answer`;\n }\n return '';\n }\n\n renderOption(cursor, v, i, arrowIndicator) {\n const prefix = (v.selected ? color.green(figures.radioOn) : figures.radioOff) + ' ' + arrowIndicator + ' ';\n let title, desc;\n\n if (v.disabled) {\n title = cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);\n } else {\n title = cursor === i ? color.cyan().underline(v.title) : v.title;\n if (cursor === i && v.description) {\n desc = ` - ${v.description}`;\n if (prefix.length + title.length + desc.length >= this.out.columns\n || v.description.split(/\\r?\\n/).length > 1) {\n desc = '\\n' + wrap(v.description, { margin: prefix.length, width: this.out.columns });\n }\n }\n }\n\n return prefix + title + color.gray(desc || '');\n }\n\n // shared with autocompleteMultiselect\n paginateOptions(options) {\n if (options.length === 0) {\n return color.red('No matches for this query.');\n }\n\n let { startIndex, endIndex } = entriesToDisplay(this.cursor, options.length, this.optionsPerPage);\n let prefix, styledOptions = [];\n\n for (let i = startIndex; i < endIndex; i++) {\n if (i === startIndex && startIndex > 0) {\n prefix = figures.arrowUp;\n } else if (i === endIndex - 1 && endIndex < options.length) {\n prefix = figures.arrowDown;\n } else {\n prefix = ' ';\n }\n styledOptions.push(this.renderOption(this.cursor, options[i], i, prefix));\n }\n\n return '\\n' + styledOptions.join('\\n');\n }\n\n // shared with autocomleteMultiselect\n renderOptions(options) {\n if (!this.done) {\n return this.paginateOptions(options);\n }\n return '';\n }\n\n renderDoneOrInstructions() {\n if (this.done) {\n return this.value\n .filter(e => e.selected)\n .map(v => v.title)\n .join(', ');\n }\n\n const output = [color.gray(this.hint), this.renderInstructions()];\n\n if (this.value[this.cursor].disabled) {\n output.push(color.yellow(this.warn));\n }\n return output.join(' ');\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n super.render();\n\n // print prompt\n let prompt = [\n style.symbol(this.done, this.aborted),\n color.bold(this.msg),\n style.delimiter(false),\n this.renderDoneOrInstructions()\n ].join(' ');\n if (this.showMinError) {\n prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`);\n this.showMinError = false;\n }\n prompt += this.renderOptions(this.value);\n\n this.out.write(this.clear + prompt);\n this.clear = clear(prompt, this.out.columns);\n }\n}\n\nmodule.exports = MultiselectPrompt;\n", "'use strict';\n\nconst color = require('kleur');\nconst Prompt = require('./prompt');\nconst { erase, cursor } = require('sisteransi');\nconst { style, clear, figures, wrap, entriesToDisplay } = require('../util');\n\nconst getVal = (arr, i) => arr[i] && (arr[i].value || arr[i].title || arr[i]);\nconst getTitle = (arr, i) => arr[i] && (arr[i].title || arr[i].value || arr[i]);\nconst getIndex = (arr, valOrTitle) => {\n const index = arr.findIndex(el => el.value === valOrTitle || el.title === valOrTitle);\n return index > -1 ? index : undefined;\n};\n\n/**\n * TextPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Array} opts.choices Array of auto-complete choices objects\n * @param {Function} [opts.suggest] Filter function. Defaults to sort by title\n * @param {Number} [opts.limit=10] Max number of results to show\n * @param {Number} [opts.cursor=0] Cursor start position\n * @param {String} [opts.style='default'] Render style\n * @param {String} [opts.fallback] Fallback message - initial to default value\n * @param {String} [opts.initial] Index of the default value\n * @param {Boolean} [opts.clearFirst] The first ESCAPE keypress will clear the input\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {String} [opts.noMatches] The no matches found label\n */\nclass AutocompletePrompt extends Prompt {\n constructor(opts={}) {\n super(opts);\n this.msg = opts.message;\n this.suggest = opts.suggest;\n this.choices = opts.choices;\n this.initial = typeof opts.initial === 'number'\n ? opts.initial\n : getIndex(opts.choices, opts.initial);\n this.select = this.initial || opts.cursor || 0;\n this.i18n = { noMatches: opts.noMatches || 'no matches found' };\n this.fallback = opts.fallback || this.initial;\n this.clearFirst = opts.clearFirst || false;\n this.suggestions = [];\n this.input = '';\n this.limit = opts.limit || 10;\n this.cursor = 0;\n this.transform = style.render(opts.style);\n this.scale = this.transform.scale;\n this.render = this.render.bind(this);\n this.complete = this.complete.bind(this);\n this.clear = clear('', this.out.columns);\n this.complete(this.render);\n this.render();\n }\n\n set fallback(fb) {\n this._fb = Number.isSafeInteger(parseInt(fb)) ? parseInt(fb) : fb;\n }\n\n get fallback() {\n let choice;\n if (typeof this._fb === 'number')\n choice = this.choices[this._fb];\n else if (typeof this._fb === 'string')\n choice = { title: this._fb };\n return choice || this._fb || { title: this.i18n.noMatches };\n }\n\n moveSelect(i) {\n this.select = i;\n if (this.suggestions.length > 0)\n this.value = getVal(this.suggestions, i);\n else this.value = this.fallback.value;\n this.fire();\n }\n\n async complete(cb) {\n const p = (this.completing = this.suggest(this.input, this.choices));\n const suggestions = await p;\n\n if (this.completing !== p) return;\n this.suggestions = suggestions\n .map((s, i, arr) => ({ title: getTitle(arr, i), value: getVal(arr, i), description: s.description }));\n this.completing = false;\n const l = Math.max(suggestions.length - 1, 0);\n this.moveSelect(Math.min(l, this.select));\n\n cb && cb();\n }\n\n reset() {\n this.input = '';\n this.complete(() => {\n this.moveSelect(this.initial !== void 0 ? this.initial : 0);\n this.render();\n });\n this.render();\n }\n\n exit() {\n if (this.clearFirst && this.input.length > 0) {\n this.reset();\n } else {\n this.done = this.exited = true; \n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n }\n\n abort() {\n this.done = this.aborted = true;\n this.exited = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n this.done = true;\n this.aborted = this.exited = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n _(c, key) {\n let s1 = this.input.slice(0, this.cursor);\n let s2 = this.input.slice(this.cursor);\n this.input = `${s1}${c}${s2}`;\n this.cursor = s1.length+1;\n this.complete(this.render);\n this.render();\n }\n\n delete() {\n if (this.cursor === 0) return this.bell();\n let s1 = this.input.slice(0, this.cursor-1);\n let s2 = this.input.slice(this.cursor);\n this.input = `${s1}${s2}`;\n this.complete(this.render);\n this.cursor = this.cursor-1;\n this.render();\n }\n\n deleteForward() {\n if(this.cursor*this.scale >= this.rendered.length) return this.bell();\n let s1 = this.input.slice(0, this.cursor);\n let s2 = this.input.slice(this.cursor+1);\n this.input = `${s1}${s2}`;\n this.complete(this.render);\n this.render();\n }\n\n first() {\n this.moveSelect(0);\n this.render();\n }\n\n last() {\n this.moveSelect(this.suggestions.length - 1);\n this.render();\n }\n\n up() {\n if (this.select === 0) {\n this.moveSelect(this.suggestions.length - 1);\n } else {\n this.moveSelect(this.select - 1);\n }\n this.render();\n }\n\n down() {\n if (this.select === this.suggestions.length - 1) {\n this.moveSelect(0);\n } else {\n this.moveSelect(this.select + 1);\n }\n this.render();\n }\n\n next() {\n if (this.select === this.suggestions.length - 1) {\n this.moveSelect(0);\n } else this.moveSelect(this.select + 1);\n this.render();\n }\n\n nextPage() {\n this.moveSelect(Math.min(this.select + this.limit, this.suggestions.length - 1));\n this.render();\n }\n\n prevPage() {\n this.moveSelect(Math.max(this.select - this.limit, 0));\n this.render();\n }\n\n left() {\n if (this.cursor <= 0) return this.bell();\n this.cursor = this.cursor-1;\n this.render();\n }\n\n right() {\n if (this.cursor*this.scale >= this.rendered.length) return this.bell();\n this.cursor = this.cursor+1;\n this.render();\n }\n\n renderOption(v, hovered, isStart, isEnd) {\n let desc;\n let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : ' ';\n let title = hovered ? color.cyan().underline(v.title) : v.title;\n prefix = (hovered ? color.cyan(figures.pointer) + ' ' : ' ') + prefix;\n if (v.description) {\n desc = ` - ${v.description}`;\n if (prefix.length + title.length + desc.length >= this.out.columns\n || v.description.split(/\\r?\\n/).length > 1) {\n desc = '\\n' + wrap(v.description, { margin: 3, width: this.out.columns })\n }\n }\n return prefix + ' ' + title + color.gray(desc || '');\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n\n let { startIndex, endIndex } = entriesToDisplay(this.select, this.choices.length, this.limit);\n\n this.outputText = [\n style.symbol(this.done, this.aborted, this.exited),\n color.bold(this.msg),\n style.delimiter(this.completing),\n this.done && this.suggestions[this.select]\n ? this.suggestions[this.select].title\n : this.rendered = this.transform.render(this.input)\n ].join(' ');\n\n if (!this.done) {\n const suggestions = this.suggestions\n .slice(startIndex, endIndex)\n .map((item, i) => this.renderOption(item,\n this.select === i + startIndex,\n i === 0 && startIndex > 0,\n i + startIndex === endIndex - 1 && endIndex < this.choices.length))\n .join('\\n');\n this.outputText += `\\n` + (suggestions || color.gray(this.fallback.title));\n }\n\n this.out.write(erase.line + cursor.to(0) + this.outputText);\n }\n}\n\nmodule.exports = AutocompletePrompt;\n", "'use strict';\n\nconst color = require('kleur');\nconst { cursor } = require('sisteransi');\nconst MultiselectPrompt = require('./multiselect');\nconst { clear, style, figures } = require('../util');\n/**\n * MultiselectPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Array} opts.choices Array of choice objects\n * @param {String} [opts.hint] Hint to display\n * @param {String} [opts.warn] Hint shown for disabled choices\n * @param {Number} [opts.max] Max choices\n * @param {Number} [opts.cursor=0] Cursor start position\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\nclass AutocompleteMultiselectPrompt extends MultiselectPrompt {\n constructor(opts={}) {\n opts.overrideRender = true;\n super(opts);\n this.inputValue = '';\n this.clear = clear('', this.out.columns);\n this.filteredOptions = this.value;\n this.render();\n }\n\n last() {\n this.cursor = this.filteredOptions.length - 1;\n this.render();\n }\n next() {\n this.cursor = (this.cursor + 1) % this.filteredOptions.length;\n this.render();\n }\n\n up() {\n if (this.cursor === 0) {\n this.cursor = this.filteredOptions.length - 1;\n } else {\n this.cursor--;\n }\n this.render();\n }\n\n down() {\n if (this.cursor === this.filteredOptions.length - 1) {\n this.cursor = 0;\n } else {\n this.cursor++;\n }\n this.render();\n }\n\n left() {\n this.filteredOptions[this.cursor].selected = false;\n this.render();\n }\n\n right() {\n if (this.value.filter(e => e.selected).length >= this.maxChoices) return this.bell();\n this.filteredOptions[this.cursor].selected = true;\n this.render();\n }\n\n delete() {\n if (this.inputValue.length) {\n this.inputValue = this.inputValue.substr(0, this.inputValue.length - 1);\n this.updateFilteredOptions();\n }\n }\n\n updateFilteredOptions() {\n const currentHighlight = this.filteredOptions[this.cursor];\n this.filteredOptions = this.value\n .filter(v => {\n if (this.inputValue) {\n if (typeof v.title === 'string') {\n if (v.title.toLowerCase().includes(this.inputValue.toLowerCase())) {\n return true;\n }\n }\n if (typeof v.value === 'string') {\n if (v.value.toLowerCase().includes(this.inputValue.toLowerCase())) {\n return true;\n }\n }\n return false;\n }\n return true;\n });\n const newHighlightIndex = this.filteredOptions.findIndex(v => v === currentHighlight)\n this.cursor = newHighlightIndex < 0 ? 0 : newHighlightIndex;\n this.render();\n }\n\n handleSpaceToggle() {\n const v = this.filteredOptions[this.cursor];\n\n if (v.selected) {\n v.selected = false;\n this.render();\n } else if (v.disabled || this.value.filter(e => e.selected).length >= this.maxChoices) {\n return this.bell();\n } else {\n v.selected = true;\n this.render();\n }\n }\n\n handleInputChange(c) {\n this.inputValue = this.inputValue + c;\n this.updateFilteredOptions();\n }\n\n _(c, key) {\n if (c === ' ') {\n this.handleSpaceToggle();\n } else {\n this.handleInputChange(c);\n }\n }\n\n renderInstructions() {\n if (this.instructions === undefined || this.instructions) {\n if (typeof this.instructions === 'string') {\n return this.instructions;\n }\n return `\nInstructions:\n ${figures.arrowUp}/${figures.arrowDown}: Highlight option\n ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`;\n }\n return '';\n }\n\n renderCurrentInput() {\n return `\nFiltered results for: ${this.inputValue ? this.inputValue : color.gray('Enter something to filter')}\\n`;\n }\n\n renderOption(cursor, v, i) {\n let title;\n if (v.disabled) title = cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);\n else title = cursor === i ? color.cyan().underline(v.title) : v.title;\n return (v.selected ? color.green(figures.radioOn) : figures.radioOff) + ' ' + title\n }\n\n renderDoneOrInstructions() {\n if (this.done) {\n return this.value\n .filter(e => e.selected)\n .map(v => v.title)\n .join(', ');\n }\n\n const output = [color.gray(this.hint), this.renderInstructions(), this.renderCurrentInput()];\n\n if (this.filteredOptions.length && this.filteredOptions[this.cursor].disabled) {\n output.push(color.yellow(this.warn));\n }\n return output.join(' ');\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n super.render();\n\n // print prompt\n\n let prompt = [\n style.symbol(this.done, this.aborted),\n color.bold(this.msg),\n style.delimiter(false),\n this.renderDoneOrInstructions()\n ].join(' ');\n\n if (this.showMinError) {\n prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`);\n this.showMinError = false;\n }\n prompt += this.renderOptions(this.filteredOptions);\n\n this.out.write(this.clear + prompt);\n this.clear = clear(prompt, this.out.columns);\n }\n}\n\nmodule.exports = AutocompleteMultiselectPrompt;\n", "const color = require('kleur');\nconst Prompt = require('./prompt');\nconst { style, clear } = require('../util');\nconst { erase, cursor } = require('sisteransi');\n\n/**\n * ConfirmPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Boolean} [opts.initial] Default value (true/false)\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {String} [opts.yes] The \"Yes\" label\n * @param {String} [opts.yesOption] The \"Yes\" option when choosing between yes/no\n * @param {String} [opts.no] The \"No\" label\n * @param {String} [opts.noOption] The \"No\" option when choosing between yes/no\n */\nclass ConfirmPrompt extends Prompt {\n constructor(opts={}) {\n super(opts);\n this.msg = opts.message;\n this.value = opts.initial;\n this.initialValue = !!opts.initial;\n this.yesMsg = opts.yes || 'yes';\n this.yesOption = opts.yesOption || '(Y/n)';\n this.noMsg = opts.no || 'no';\n this.noOption = opts.noOption || '(y/N)';\n this.render();\n }\n\n reset() {\n this.value = this.initialValue;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n this.value = this.value || false;\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n _(c, key) {\n if (c.toLowerCase() === 'y') {\n this.value = true;\n return this.submit();\n }\n if (c.toLowerCase() === 'n') {\n this.value = false;\n return this.submit();\n }\n return this.bell();\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n\n this.outputText = [\n style.symbol(this.done, this.aborted),\n color.bold(this.msg),\n style.delimiter(this.done),\n this.done ? (this.value ? this.yesMsg : this.noMsg)\n : color.gray(this.initialValue ? this.yesOption : this.noOption)\n ].join(' ');\n\n this.out.write(erase.line + cursor.to(0) + this.outputText);\n }\n}\n\nmodule.exports = ConfirmPrompt;\n", "'use strict';\n\nmodule.exports = {\n TextPrompt: require('./text'),\n SelectPrompt: require('./select'),\n TogglePrompt: require('./toggle'),\n DatePrompt: require('./date'),\n NumberPrompt: require('./number'),\n MultiselectPrompt: require('./multiselect'),\n AutocompletePrompt: require('./autocomplete'),\n AutocompleteMultiselectPrompt: require('./autocompleteMultiselect'),\n ConfirmPrompt: require('./confirm')\n};\n", "'use strict';\nconst $ = exports;\nconst el = require('./elements');\nconst noop = v => v;\n\nfunction toPrompt(type, args, opts={}) {\n return new Promise((res, rej) => {\n const p = new el[type](args);\n const onAbort = opts.onAbort || noop;\n const onSubmit = opts.onSubmit || noop;\n const onExit = opts.onExit || noop;\n p.on('state', args.onState || noop);\n p.on('submit', x => res(onSubmit(x)));\n p.on('exit', x => res(onExit(x)));\n p.on('abort', x => rej(onAbort(x)));\n });\n}\n\n/**\n * Text prompt\n * @param {string} args.message Prompt message to display\n * @param {string} [args.initial] Default string value\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {function} [args.onState] On state change callback\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.text = args => toPrompt('TextPrompt', args);\n\n/**\n * Password prompt with masked input\n * @param {string} args.message Prompt message to display\n * @param {string} [args.initial] Default string value\n * @param {function} [args.onState] On state change callback\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.password = args => {\n args.style = 'password';\n return $.text(args);\n};\n\n/**\n * Prompt where input is invisible, like sudo\n * @param {string} args.message Prompt message to display\n * @param {string} [args.initial] Default string value\n * @param {function} [args.onState] On state change callback\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.invisible = args => {\n args.style = 'invisible';\n return $.text(args);\n};\n\n/**\n * Number prompt\n * @param {string} args.message Prompt message to display\n * @param {number} args.initial Default number value\n * @param {function} [args.onState] On state change callback\n * @param {number} [args.max] Max value\n * @param {number} [args.min] Min value\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {Boolean} [opts.float=false] Parse input as floats\n * @param {Number} [opts.round=2] Round floats to x decimals\n * @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.number = args => toPrompt('NumberPrompt', args);\n\n/**\n * Date prompt\n * @param {string} args.message Prompt message to display\n * @param {number} args.initial Default number value\n * @param {function} [args.onState] On state change callback\n * @param {number} [args.max] Max value\n * @param {number} [args.min] Min value\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {Boolean} [opts.float=false] Parse input as floats\n * @param {Number} [opts.round=2] Round floats to x decimals\n * @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.date = args => toPrompt('DatePrompt', args);\n\n/**\n * Classic yes/no prompt\n * @param {string} args.message Prompt message to display\n * @param {boolean} [args.initial=false] Default value\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.confirm = args => toPrompt('ConfirmPrompt', args);\n\n/**\n * List prompt, split intput string by `seperator`\n * @param {string} args.message Prompt message to display\n * @param {string} [args.initial] Default string value\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {string} [args.separator] String separator\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input, in form of an `Array`\n */\n$.list = args => {\n const sep = args.separator || ',';\n return toPrompt('TextPrompt', args, {\n onSubmit: str => str.split(sep).map(s => s.trim())\n });\n};\n\n/**\n * Toggle/switch prompt\n * @param {string} args.message Prompt message to display\n * @param {boolean} [args.initial=false] Default value\n * @param {string} [args.active=\"on\"] Text for `active` state\n * @param {string} [args.inactive=\"off\"] Text for `inactive` state\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.toggle = args => toPrompt('TogglePrompt', args);\n\n/**\n * Interactive select prompt\n * @param {string} args.message Prompt message to display\n * @param {Array} args.choices Array of choices objects `[{ title, value }, ...]`\n * @param {number} [args.initial] Index of default value\n * @param {String} [args.hint] Hint to display\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.select = args => toPrompt('SelectPrompt', args);\n\n/**\n * Interactive multi-select / autocompleteMultiselect prompt\n * @param {string} args.message Prompt message to display\n * @param {Array} args.choices Array of choices objects `[{ title, value, [selected] }, ...]`\n * @param {number} [args.max] Max select\n * @param {string} [args.hint] Hint to display user\n * @param {Number} [args.cursor=0] Cursor start position\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.multiselect = args => {\n args.choices = [].concat(args.choices || []);\n const toSelected = items => items.filter(item => item.selected).map(item => item.value);\n return toPrompt('MultiselectPrompt', args, {\n onAbort: toSelected,\n onSubmit: toSelected\n });\n};\n\n$.autocompleteMultiselect = args => {\n args.choices = [].concat(args.choices || []);\n const toSelected = items => items.filter(item => item.selected).map(item => item.value);\n return toPrompt('AutocompleteMultiselectPrompt', args, {\n onAbort: toSelected,\n onSubmit: toSelected\n });\n};\n\nconst byTitle = (input, choices) => Promise.resolve(\n choices.filter(item => item.title.slice(0, input.length).toLowerCase() === input.toLowerCase())\n);\n\n/**\n * Interactive auto-complete prompt\n * @param {string} args.message Prompt message to display\n * @param {Array} args.choices Array of auto-complete choices objects `[{ title, value }, ...]`\n * @param {Function} [args.suggest] Function to filter results based on user input. Defaults to sort by `title`\n * @param {number} [args.limit=10] Max number of results to show\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {String} [args.initial] Index of the default value\n * @param {boolean} [opts.clearFirst] The first ESCAPE keypress will clear the input\n * @param {String} [args.fallback] Fallback message - defaults to initial value\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.autocomplete = args => {\n args.suggest = args.suggest || byTitle;\n args.choices = [].concat(args.choices || []);\n return toPrompt('AutocompletePrompt', args);\n};\n", "'use strict';\n\nconst prompts = require('./prompts');\n\nconst passOn = ['suggest', 'format', 'onState', 'validate', 'onRender', 'type'];\nconst noop = () => {};\n\n/**\n * Prompt for a series of questions\n * @param {Array|Object} questions Single question object or Array of question objects\n * @param {Function} [onSubmit] Callback function called on prompt submit\n * @param {Function} [onCancel] Callback function called on cancel/abort\n * @returns {Object} Object with values from user input\n */\nasync function prompt(questions=[], { onSubmit=noop, onCancel=noop }={}) {\n const answers = {};\n const override = prompt._override || {};\n questions = [].concat(questions);\n let answer, question, quit, name, type, lastPrompt;\n\n const getFormattedAnswer = async (question, answer, skipValidation = false) => {\n if (!skipValidation && question.validate && question.validate(answer) !== true) {\n return;\n }\n return question.format ? await question.format(answer, answers) : answer\n };\n\n for (question of questions) {\n ({ name, type } = question);\n\n // evaluate type first and skip if type is a falsy value\n if (typeof type === 'function') {\n type = await type(answer, { ...answers }, question)\n question['type'] = type\n }\n if (!type) continue;\n\n // if property is a function, invoke it unless it's a special function\n for (let key in question) {\n if (passOn.includes(key)) continue;\n let value = question[key];\n question[key] = typeof value === 'function' ? await value(answer, { ...answers }, lastPrompt) : value;\n }\n\n lastPrompt = question;\n\n if (typeof question.message !== 'string') {\n throw new Error('prompt message is required');\n }\n\n // update vars in case they changed\n ({ name, type } = question);\n\n if (prompts[type] === void 0) {\n throw new Error(`prompt type (${type}) is not defined`);\n }\n\n if (override[question.name] !== undefined) {\n answer = await getFormattedAnswer(question, override[question.name]);\n if (answer !== undefined) {\n answers[name] = answer;\n continue;\n }\n }\n\n try {\n // Get the injected answer if there is one or prompt the user\n answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : await prompts[type](question);\n answers[name] = answer = await getFormattedAnswer(question, answer, true);\n quit = await onSubmit(question, answer, answers);\n } catch (err) {\n quit = !(await onCancel(question, answers));\n }\n\n if (quit) return answers;\n }\n\n return answers;\n}\n\nfunction getInjectedAnswer(injected, deafultValue) {\n const answer = injected.shift();\n if (answer instanceof Error) {\n throw answer;\n }\n\n return (answer === undefined) ? deafultValue : answer;\n}\n\nfunction inject(answers) {\n prompt._injected = (prompt._injected || []).concat(answers);\n}\n\nfunction override(answers) {\n prompt._override = Object.assign({}, answers);\n}\n\nmodule.exports = Object.assign(prompt, { prompt, prompts, inject, override });\n", "function isNodeLT(tar) {\n tar = (Array.isArray(tar) ? tar : tar.split('.')).map(Number);\n let i=0, src=process.versions.node.split('.').map(Number);\n for (; i < tar.length; i++) {\n if (src[i] > tar[i]) return false;\n if (tar[i] > src[i]) return true;\n }\n return false;\n}\n\nmodule.exports =\n isNodeLT('8.6.0')\n ? require('./dist/index.js')\n : require('./lib/index.js');\n", "/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "'use strict';\n\nmodule.exports = (flag, argv = process.argv) => {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n};\n", "'use strict';\nconst os = require('os');\nconst tty = require('tty');\nconst hasFlag = require('has-flag');\n\nconst {env} = process;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false') ||\n\thasFlag('color=never')) {\n\tforceColor = 0;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = 1;\n}\n\nif ('FORCE_COLOR' in env) {\n\tif (env.FORCE_COLOR === 'true') {\n\t\tforceColor = 1;\n\t} else if (env.FORCE_COLOR === 'false') {\n\t\tforceColor = 0;\n\t} else {\n\t\tforceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(haveStream, streamIsTTY) {\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream, stream && stream.isTTY);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: translateLevel(supportsColor(true, tty.isatty(1))),\n\tstderr: translateLevel(supportsColor(true, tty.isatty(2)))\n};\n", "/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.format(...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n", "/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n", "/**\n * Compare a list of case insensitive aliases for a given environment value\n *\n * @param {string} env value to be test\n * @param {string[]} aliases aliases to be compared to\n * @return {boolean}\n */\nmodule.exports = function compareAliases(env, ...aliases) {\n return aliases.some((alias) => alias.toLowerCase() === env.toLowerCase())\n}\n", "const Development = {\n dev: 'dev',\n development: 'development',\n}\n\nconst Production = {\n prod: 'prod',\n production: 'production',\n}\n\nmodule.exports = {\n Production,\n Development,\n}\n", "const compare = require('./compare-aliases')\nconst modes = require('./modes.enum')\n\n/**\n * Given an env value, checks whether NODE_ENV correspond to that value\n *\n * Inspector has two modes of operation, with a given argument or not. Given a\n * argument, the value is compared to a known environment values (dev, prod,...)\n * then a exact insensitive case match is made with the value. If there's no\n * given value, then compare the raw value of NODE_ENV is returned\n *\n * @example <caption>with NODE_ENV=\"dev\"</caption>\n * \t inspector() // \"dev\"\n * \t inspector(\"test\") // false\n * \t inspector(\"development\") // true\n * \t inspector(\"staging\", \"production\") // false\n * \t inspector(\"dev\") // true\n *\n * @param {string[] | undefined} [envs] environment to be tested\n * @return {boolean | string}\n */\nfunction inspector(...envs) {\n const nodeEnv = process.env.NODE_ENV ?? 'development'\n\n if (envs.length === 0) {\n return nodeEnv\n }\n\n return envs.reduce((prev, env) => {\n if (isKnownMode(env, nodeEnv)) {\n return true\n }\n\n return prev || compare(env, nodeEnv)\n }, false)\n}\n\n/**\n * Compare for a known env mode\n * @param {string} env\n * @param {string} nodeEnv\n * @return {boolean}\n */\nfunction isKnownMode(env, nodeEnv) {\n for (const mode of Object.values(modes)) {\n if (compareKnownMode(env, nodeEnv, Object.values(mode))) {\n return true\n }\n }\n\n return false\n}\n\n/**\n *\n * @param {string} env\n * @param {string} nodeEnv\n * @param {string[]} possibleValues\n * @return {boolean}\n */\nfunction compareKnownMode(env, nodeEnv, possibleValues) {\n return compare(env, ...possibleValues) && compare(nodeEnv, ...possibleValues)\n}\n\nmodule.exports = inspector\n", "module.exports = {\n env: require('./inspector'),\n}\n", "'use strict'\n\nexports.fromCallback = function (fn) {\n return Object.defineProperty(function (...args) {\n if (typeof args[args.length - 1] === 'function') fn.apply(this, args)\n else {\n return new Promise((resolve, reject) => {\n fn.call(\n this,\n ...args,\n (err, res) => (err != null) ? reject(err) : resolve(res)\n )\n })\n }\n }, 'name', { value: fn.name })\n}\n\nexports.fromPromise = function (fn) {\n return Object.defineProperty(function (...args) {\n const cb = args[args.length - 1]\n if (typeof cb !== 'function') return fn.apply(this, args)\n else fn.apply(this, args.slice(0, -1)).then(r => cb(null, r), cb)\n }, 'name', { value: fn.name })\n}\n", "var constants = require('constants')\n\nvar origCwd = process.cwd\nvar cwd = null\n\nvar platform = process.env.GRACEFUL_FS_PLATFORM || process.platform\n\nprocess.cwd = function() {\n if (!cwd)\n cwd = origCwd.call(process)\n return cwd\n}\ntry {\n process.cwd()\n} catch (er) {}\n\n// This check is needed until node.js 12 is required\nif (typeof process.chdir === 'function') {\n var chdir = process.chdir\n process.chdir = function (d) {\n cwd = null\n chdir.call(process, d)\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)\n}\n\nmodule.exports = patch\n\nfunction patch (fs) {\n // (re-)implement some things that are known busted or missing.\n\n // lchmod, broken prior to 0.6.2\n // back-port the fix here.\n if (constants.hasOwnProperty('O_SYMLINK') &&\n process.version.match(/^v0\\.6\\.[0-2]|^v0\\.5\\./)) {\n patchLchmod(fs)\n }\n\n // lutimes implementation, or no-op\n if (!fs.lutimes) {\n patchLutimes(fs)\n }\n\n // https://github.com/isaacs/node-graceful-fs/issues/4\n // Chown should not fail on einval or eperm if non-root.\n // It should not fail on enosys ever, as this just indicates\n // that a fs doesn't support the intended operation.\n\n fs.chown = chownFix(fs.chown)\n fs.fchown = chownFix(fs.fchown)\n fs.lchown = chownFix(fs.lchown)\n\n fs.chmod = chmodFix(fs.chmod)\n fs.fchmod = chmodFix(fs.fchmod)\n fs.lchmod = chmodFix(fs.lchmod)\n\n fs.chownSync = chownFixSync(fs.chownSync)\n fs.fchownSync = chownFixSync(fs.fchownSync)\n fs.lchownSync = chownFixSync(fs.lchownSync)\n\n fs.chmodSync = chmodFixSync(fs.chmodSync)\n fs.fchmodSync = chmodFixSync(fs.fchmodSync)\n fs.lchmodSync = chmodFixSync(fs.lchmodSync)\n\n fs.stat = statFix(fs.stat)\n fs.fstat = statFix(fs.fstat)\n fs.lstat = statFix(fs.lstat)\n\n fs.statSync = statFixSync(fs.statSync)\n fs.fstatSync = statFixSync(fs.fstatSync)\n fs.lstatSync = statFixSync(fs.lstatSync)\n\n // if lchmod/lchown do not exist, then make them no-ops\n if (fs.chmod && !fs.lchmod) {\n fs.lchmod = function (path, mode, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchmodSync = function () {}\n }\n if (fs.chown && !fs.lchown) {\n fs.lchown = function (path, uid, gid, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchownSync = function () {}\n }\n\n // on Windows, A/V software can lock the directory, causing this\n // to fail with an EACCES or EPERM if the directory contains newly\n // created files. Try again on failure, for up to 60 seconds.\n\n // Set the timeout this long because some Windows Anti-Virus, such as Parity\n // bit9, may lock files for up to a minute, causing npm package install\n // failures. Also, take care to yield the scheduler. Windows scheduling gives\n // CPU to a busy looping process, which can cause the program causing the lock\n // contention to be starved of CPU by node, so the contention doesn't resolve.\n if (platform === \"win32\") {\n fs.rename = typeof fs.rename !== 'function' ? fs.rename\n : (function (fs$rename) {\n function rename (from, to, cb) {\n var start = Date.now()\n var backoff = 0;\n fs$rename(from, to, function CB (er) {\n if (er\n && (er.code === \"EACCES\" || er.code === \"EPERM\")\n && Date.now() - start < 60000) {\n setTimeout(function() {\n fs.stat(to, function (stater, st) {\n if (stater && stater.code === \"ENOENT\")\n fs$rename(from, to, CB);\n else\n cb(er)\n })\n }, backoff)\n if (backoff < 100)\n backoff += 10;\n return;\n }\n if (cb) cb(er)\n })\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)\n return rename\n })(fs.rename)\n }\n\n // if read() returns EAGAIN, then just try it again.\n fs.read = typeof fs.read !== 'function' ? fs.read\n : (function (fs$read) {\n function read (fd, buffer, offset, length, position, callback_) {\n var callback\n if (callback_ && typeof callback_ === 'function') {\n var eagCounter = 0\n callback = function (er, _, __) {\n if (er && er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n callback_.apply(this, arguments)\n }\n }\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n\n // This ensures `util.promisify` works as it does for native `fs.read`.\n if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)\n return read\n })(fs.read)\n\n fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync\n : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {\n var eagCounter = 0\n while (true) {\n try {\n return fs$readSync.call(fs, fd, buffer, offset, length, position)\n } catch (er) {\n if (er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n continue\n }\n throw er\n }\n }\n }})(fs.readSync)\n\n function patchLchmod (fs) {\n fs.lchmod = function (path, mode, callback) {\n fs.open( path\n , constants.O_WRONLY | constants.O_SYMLINK\n , mode\n , function (err, fd) {\n if (err) {\n if (callback) callback(err)\n return\n }\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n fs.fchmod(fd, mode, function (err) {\n fs.close(fd, function(err2) {\n if (callback) callback(err || err2)\n })\n })\n })\n }\n\n fs.lchmodSync = function (path, mode) {\n var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)\n\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n var threw = true\n var ret\n try {\n ret = fs.fchmodSync(fd, mode)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n }\n\n function patchLutimes (fs) {\n if (constants.hasOwnProperty(\"O_SYMLINK\") && fs.futimes) {\n fs.lutimes = function (path, at, mt, cb) {\n fs.open(path, constants.O_SYMLINK, function (er, fd) {\n if (er) {\n if (cb) cb(er)\n return\n }\n fs.futimes(fd, at, mt, function (er) {\n fs.close(fd, function (er2) {\n if (cb) cb(er || er2)\n })\n })\n })\n }\n\n fs.lutimesSync = function (path, at, mt) {\n var fd = fs.openSync(path, constants.O_SYMLINK)\n var ret\n var threw = true\n try {\n ret = fs.futimesSync(fd, at, mt)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n\n } else if (fs.futimes) {\n fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }\n fs.lutimesSync = function () {}\n }\n }\n\n function chmodFix (orig) {\n if (!orig) return orig\n return function (target, mode, cb) {\n return orig.call(fs, target, mode, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chmodFixSync (orig) {\n if (!orig) return orig\n return function (target, mode) {\n try {\n return orig.call(fs, target, mode)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n\n function chownFix (orig) {\n if (!orig) return orig\n return function (target, uid, gid, cb) {\n return orig.call(fs, target, uid, gid, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chownFixSync (orig) {\n if (!orig) return orig\n return function (target, uid, gid) {\n try {\n return orig.call(fs, target, uid, gid)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n function statFix (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n function callback (er, stats) {\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n if (cb) cb.apply(this, arguments)\n }\n return options ? orig.call(fs, target, options, callback)\n : orig.call(fs, target, callback)\n }\n }\n\n function statFixSync (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options) {\n var stats = options ? orig.call(fs, target, options)\n : orig.call(fs, target)\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n return stats;\n }\n }\n\n // ENOSYS means that the fs doesn't support the op. Just ignore\n // that, because it doesn't matter.\n //\n // if there's no getuid, or if getuid() is something other\n // than 0, and the error is EINVAL or EPERM, then just ignore\n // it.\n //\n // This specific case is a silent failure in cp, install, tar,\n // and most other unix tools that manage permissions.\n //\n // When running as root, or if other types of errors are\n // encountered, then it's strict.\n function chownErOk (er) {\n if (!er)\n return true\n\n if (er.code === \"ENOSYS\")\n return true\n\n var nonroot = !process.getuid || process.getuid() !== 0\n if (nonroot) {\n if (er.code === \"EINVAL\" || er.code === \"EPERM\")\n return true\n }\n\n return false\n }\n}\n", "var Stream = require('stream').Stream\n\nmodule.exports = legacy\n\nfunction legacy (fs) {\n return {\n ReadStream: ReadStream,\n WriteStream: WriteStream\n }\n\n function ReadStream (path, options) {\n if (!(this instanceof ReadStream)) return new ReadStream(path, options);\n\n Stream.call(this);\n\n var self = this;\n\n this.path = path;\n this.fd = null;\n this.readable = true;\n this.paused = false;\n\n this.flags = 'r';\n this.mode = 438; /*=0666*/\n this.bufferSize = 64 * 1024;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.encoding) this.setEncoding(this.encoding);\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.end === undefined) {\n this.end = Infinity;\n } else if ('number' !== typeof this.end) {\n throw TypeError('end must be a Number');\n }\n\n if (this.start > this.end) {\n throw new Error('start must be <= end');\n }\n\n this.pos = this.start;\n }\n\n if (this.fd !== null) {\n process.nextTick(function() {\n self._read();\n });\n return;\n }\n\n fs.open(this.path, this.flags, this.mode, function (err, fd) {\n if (err) {\n self.emit('error', err);\n self.readable = false;\n return;\n }\n\n self.fd = fd;\n self.emit('open', fd);\n self._read();\n })\n }\n\n function WriteStream (path, options) {\n if (!(this instanceof WriteStream)) return new WriteStream(path, options);\n\n Stream.call(this);\n\n this.path = path;\n this.fd = null;\n this.writable = true;\n\n this.flags = 'w';\n this.encoding = 'binary';\n this.mode = 438; /*=0666*/\n this.bytesWritten = 0;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.start < 0) {\n throw new Error('start must be >= zero');\n }\n\n this.pos = this.start;\n }\n\n this.busy = false;\n this._queue = [];\n\n if (this.fd === null) {\n this._open = fs.open;\n this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);\n this.flush();\n }\n }\n}\n", "'use strict'\n\nmodule.exports = clone\n\nvar getPrototypeOf = Object.getPrototypeOf || function (obj) {\n return obj.__proto__\n}\n\nfunction clone (obj) {\n if (obj === null || typeof obj !== 'object')\n return obj\n\n if (obj instanceof Object)\n var copy = { __proto__: getPrototypeOf(obj) }\n else\n var copy = Object.create(null)\n\n Object.getOwnPropertyNames(obj).forEach(function (key) {\n Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))\n })\n\n return copy\n}\n", "var fs = require('fs')\nvar polyfills = require('./polyfills.js')\nvar legacy = require('./legacy-streams.js')\nvar clone = require('./clone.js')\n\nvar util = require('util')\n\n/* istanbul ignore next - node 0.x polyfill */\nvar gracefulQueue\nvar previousSymbol\n\n/* istanbul ignore else - node 0.x polyfill */\nif (typeof Symbol === 'function' && typeof Symbol.for === 'function') {\n gracefulQueue = Symbol.for('graceful-fs.queue')\n // This is used in testing by future versions\n previousSymbol = Symbol.for('graceful-fs.previous')\n} else {\n gracefulQueue = '___graceful-fs.queue'\n previousSymbol = '___graceful-fs.previous'\n}\n\nfunction noop () {}\n\nfunction publishQueue(context, queue) {\n Object.defineProperty(context, gracefulQueue, {\n get: function() {\n return queue\n }\n })\n}\n\nvar debug = noop\nif (util.debuglog)\n debug = util.debuglog('gfs4')\nelse if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || ''))\n debug = function() {\n var m = util.format.apply(util, arguments)\n m = 'GFS4: ' + m.split(/\\n/).join('\\nGFS4: ')\n console.error(m)\n }\n\n// Once time initialization\nif (!fs[gracefulQueue]) {\n // This queue can be shared by multiple loaded instances\n var queue = global[gracefulQueue] || []\n publishQueue(fs, queue)\n\n // Patch fs.close/closeSync to shared queue version, because we need\n // to retry() whenever a close happens *anywhere* in the program.\n // This is essential when multiple graceful-fs instances are\n // in play at the same time.\n fs.close = (function (fs$close) {\n function close (fd, cb) {\n return fs$close.call(fs, fd, function (err) {\n // This function uses the graceful-fs shared queue\n if (!err) {\n resetQueue()\n }\n\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n })\n }\n\n Object.defineProperty(close, previousSymbol, {\n value: fs$close\n })\n return close\n })(fs.close)\n\n fs.closeSync = (function (fs$closeSync) {\n function closeSync (fd) {\n // This function uses the graceful-fs shared queue\n fs$closeSync.apply(fs, arguments)\n resetQueue()\n }\n\n Object.defineProperty(closeSync, previousSymbol, {\n value: fs$closeSync\n })\n return closeSync\n })(fs.closeSync)\n\n if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || '')) {\n process.on('exit', function() {\n debug(fs[gracefulQueue])\n require('assert').equal(fs[gracefulQueue].length, 0)\n })\n }\n}\n\nif (!global[gracefulQueue]) {\n publishQueue(global, fs[gracefulQueue]);\n}\n\nmodule.exports = patch(clone(fs))\nif (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {\n module.exports = patch(fs)\n fs.__patched = true;\n}\n\nfunction patch (fs) {\n // Everything that references the open() function needs to be in here\n polyfills(fs)\n fs.gracefulify = patch\n\n fs.createReadStream = createReadStream\n fs.createWriteStream = createWriteStream\n var fs$readFile = fs.readFile\n fs.readFile = readFile\n function readFile (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$readFile(path, options, cb)\n\n function go$readFile (path, options, cb, startTime) {\n return fs$readFile(path, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$writeFile = fs.writeFile\n fs.writeFile = writeFile\n function writeFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$writeFile(path, data, options, cb)\n\n function go$writeFile (path, data, options, cb, startTime) {\n return fs$writeFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$appendFile = fs.appendFile\n if (fs$appendFile)\n fs.appendFile = appendFile\n function appendFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$appendFile(path, data, options, cb)\n\n function go$appendFile (path, data, options, cb, startTime) {\n return fs$appendFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$copyFile = fs.copyFile\n if (fs$copyFile)\n fs.copyFile = copyFile\n function copyFile (src, dest, flags, cb) {\n if (typeof flags === 'function') {\n cb = flags\n flags = 0\n }\n return go$copyFile(src, dest, flags, cb)\n\n function go$copyFile (src, dest, flags, cb, startTime) {\n return fs$copyFile(src, dest, flags, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$readdir = fs.readdir\n fs.readdir = readdir\n var noReaddirOptionVersions = /^v[0-5]\\./\n function readdir (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n var go$readdir = noReaddirOptionVersions.test(process.version)\n ? function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n : function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, options, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n\n return go$readdir(path, options, cb)\n\n function fs$readdirCallback (path, options, cb, startTime) {\n return function (err, files) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([\n go$readdir,\n [path, options, cb],\n err,\n startTime || Date.now(),\n Date.now()\n ])\n else {\n if (files && files.sort)\n files.sort()\n\n if (typeof cb === 'function')\n cb.call(this, err, files)\n }\n }\n }\n }\n\n if (process.version.substr(0, 4) === 'v0.8') {\n var legStreams = legacy(fs)\n ReadStream = legStreams.ReadStream\n WriteStream = legStreams.WriteStream\n }\n\n var fs$ReadStream = fs.ReadStream\n if (fs$ReadStream) {\n ReadStream.prototype = Object.create(fs$ReadStream.prototype)\n ReadStream.prototype.open = ReadStream$open\n }\n\n var fs$WriteStream = fs.WriteStream\n if (fs$WriteStream) {\n WriteStream.prototype = Object.create(fs$WriteStream.prototype)\n WriteStream.prototype.open = WriteStream$open\n }\n\n Object.defineProperty(fs, 'ReadStream', {\n get: function () {\n return ReadStream\n },\n set: function (val) {\n ReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n Object.defineProperty(fs, 'WriteStream', {\n get: function () {\n return WriteStream\n },\n set: function (val) {\n WriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n // legacy names\n var FileReadStream = ReadStream\n Object.defineProperty(fs, 'FileReadStream', {\n get: function () {\n return FileReadStream\n },\n set: function (val) {\n FileReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n var FileWriteStream = WriteStream\n Object.defineProperty(fs, 'FileWriteStream', {\n get: function () {\n return FileWriteStream\n },\n set: function (val) {\n FileWriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n function ReadStream (path, options) {\n if (this instanceof ReadStream)\n return fs$ReadStream.apply(this, arguments), this\n else\n return ReadStream.apply(Object.create(ReadStream.prototype), arguments)\n }\n\n function ReadStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n if (that.autoClose)\n that.destroy()\n\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n that.read()\n }\n })\n }\n\n function WriteStream (path, options) {\n if (this instanceof WriteStream)\n return fs$WriteStream.apply(this, arguments), this\n else\n return WriteStream.apply(Object.create(WriteStream.prototype), arguments)\n }\n\n function WriteStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n that.destroy()\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n }\n })\n }\n\n function createReadStream (path, options) {\n return new fs.ReadStream(path, options)\n }\n\n function createWriteStream (path, options) {\n return new fs.WriteStream(path, options)\n }\n\n var fs$open = fs.open\n fs.open = open\n function open (path, flags, mode, cb) {\n if (typeof mode === 'function')\n cb = mode, mode = null\n\n return go$open(path, flags, mode, cb)\n\n function go$open (path, flags, mode, cb, startTime) {\n return fs$open(path, flags, mode, function (err, fd) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n return fs\n}\n\nfunction enqueue (elem) {\n debug('ENQUEUE', elem[0].name, elem[1])\n fs[gracefulQueue].push(elem)\n retry()\n}\n\n// keep track of the timeout between retry() calls\nvar retryTimer\n\n// reset the startTime and lastTime to now\n// this resets the start of the 60 second overall timeout as well as the\n// delay between attempts so that we'll retry these jobs sooner\nfunction resetQueue () {\n var now = Date.now()\n for (var i = 0; i < fs[gracefulQueue].length; ++i) {\n // entries that are only a length of 2 are from an older version, don't\n // bother modifying those since they'll be retried anyway.\n if (fs[gracefulQueue][i].length > 2) {\n fs[gracefulQueue][i][3] = now // startTime\n fs[gracefulQueue][i][4] = now // lastTime\n }\n }\n // call retry to make sure we're actively processing the queue\n retry()\n}\n\nfunction retry () {\n // clear the timer and remove it to help prevent unintended concurrency\n clearTimeout(retryTimer)\n retryTimer = undefined\n\n if (fs[gracefulQueue].length === 0)\n return\n\n var elem = fs[gracefulQueue].shift()\n var fn = elem[0]\n var args = elem[1]\n // these items may be unset if they were added by an older graceful-fs\n var err = elem[2]\n var startTime = elem[3]\n var lastTime = elem[4]\n\n // if we don't have a startTime we have no way of knowing if we've waited\n // long enough, so go ahead and retry this item now\n if (startTime === undefined) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args)\n } else if (Date.now() - startTime >= 60000) {\n // it's been more than 60 seconds total, bail now\n debug('TIMEOUT', fn.name, args)\n var cb = args.pop()\n if (typeof cb === 'function')\n cb.call(null, err)\n } else {\n // the amount of time between the last attempt and right now\n var sinceAttempt = Date.now() - lastTime\n // the amount of time between when we first tried, and when we last tried\n // rounded up to at least 1\n var sinceStart = Math.max(lastTime - startTime, 1)\n // backoff. wait longer than the total time we've been retrying, but only\n // up to a maximum of 100ms\n var desiredDelay = Math.min(sinceStart * 1.2, 100)\n // it's been long enough since the last retry, do it again\n if (sinceAttempt >= desiredDelay) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args.concat([startTime]))\n } else {\n // if we can't do this job yet, push it to the end of the queue\n // and let the next iteration check again\n fs[gracefulQueue].push(elem)\n }\n }\n\n // schedule our next run if one isn't already scheduled\n if (retryTimer === undefined) {\n retryTimer = setTimeout(retry, 0)\n }\n}\n", "'use strict'\n// This is adapted from https://github.com/normalize/mz\n// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\n\nconst api = [\n 'access',\n 'appendFile',\n 'chmod',\n 'chown',\n 'close',\n 'copyFile',\n 'fchmod',\n 'fchown',\n 'fdatasync',\n 'fstat',\n 'fsync',\n 'ftruncate',\n 'futimes',\n 'lchmod',\n 'lchown',\n 'link',\n 'lstat',\n 'mkdir',\n 'mkdtemp',\n 'open',\n 'opendir',\n 'readdir',\n 'readFile',\n 'readlink',\n 'realpath',\n 'rename',\n 'rm',\n 'rmdir',\n 'stat',\n 'symlink',\n 'truncate',\n 'unlink',\n 'utimes',\n 'writeFile'\n].filter(key => {\n // Some commands are not available on some systems. Ex:\n // fs.opendir was added in Node.js v12.12.0\n // fs.rm was added in Node.js v14.14.0\n // fs.lchown is not available on at least some Linux\n return typeof fs[key] === 'function'\n})\n\n// Export cloned fs:\nObject.assign(exports, fs)\n\n// Universalify async methods:\napi.forEach(method => {\n exports[method] = u(fs[method])\n})\nexports.realpath.native = u(fs.realpath.native)\n\n// We differ from mz/fs in that we still ship the old, broken, fs.exists()\n// since we are a drop-in replacement for the native module\nexports.exists = function (filename, callback) {\n if (typeof callback === 'function') {\n return fs.exists(filename, callback)\n }\n return new Promise(resolve => {\n return fs.exists(filename, resolve)\n })\n}\n\n// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args\n\nexports.read = function (fd, buffer, offset, length, position, callback) {\n if (typeof callback === 'function') {\n return fs.read(fd, buffer, offset, length, position, callback)\n }\n return new Promise((resolve, reject) => {\n fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {\n if (err) return reject(err)\n resolve({ bytesRead, buffer })\n })\n })\n}\n\n// Function signature can be\n// fs.write(fd, buffer[, offset[, length[, position]]], callback)\n// OR\n// fs.write(fd, string[, position[, encoding]], callback)\n// We need to handle both cases, so we use ...args\nexports.write = function (fd, buffer, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.write(fd, buffer, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => {\n if (err) return reject(err)\n resolve({ bytesWritten, buffer })\n })\n })\n}\n\n// fs.writev only available in Node v12.9.0+\nif (typeof fs.writev === 'function') {\n // Function signature is\n // s.writev(fd, buffers[, position], callback)\n // We need to handle the optional arg, so we use ...args\n exports.writev = function (fd, buffers, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.writev(fd, buffers, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {\n if (err) return reject(err)\n resolve({ bytesWritten, buffers })\n })\n })\n }\n}\n", "// Adapted from https://github.com/sindresorhus/make-dir\n// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)\n// 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:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// 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.\n'use strict'\nconst path = require('path')\n\n// https://github.com/nodejs/node/issues/8987\n// https://github.com/libuv/libuv/pull/1088\nmodule.exports.checkPath = function checkPath (pth) {\n if (process.platform === 'win32') {\n const pathHasInvalidWinCharacters = /[<>:\"|?*]/.test(pth.replace(path.parse(pth).root, ''))\n\n if (pathHasInvalidWinCharacters) {\n const error = new Error(`Path contains invalid characters: ${pth}`)\n error.code = 'EINVAL'\n throw error\n }\n }\n}\n", "'use strict'\nconst fs = require('../fs')\nconst { checkPath } = require('./utils')\n\nconst getMode = options => {\n const defaults = { mode: 0o777 }\n if (typeof options === 'number') return options\n return ({ ...defaults, ...options }).mode\n}\n\nmodule.exports.makeDir = async (dir, options) => {\n checkPath(dir)\n\n return fs.mkdir(dir, {\n mode: getMode(options),\n recursive: true\n })\n}\n\nmodule.exports.makeDirSync = (dir, options) => {\n checkPath(dir)\n\n return fs.mkdirSync(dir, {\n mode: getMode(options),\n recursive: true\n })\n}\n", "'use strict'\nconst u = require('universalify').fromPromise\nconst { makeDir: _makeDir, makeDirSync } = require('./make-dir')\nconst makeDir = u(_makeDir)\n\nmodule.exports = {\n mkdirs: makeDir,\n mkdirsSync: makeDirSync,\n // alias\n mkdirp: makeDir,\n mkdirpSync: makeDirSync,\n ensureDir: makeDir,\n ensureDirSync: makeDirSync\n}\n", "'use strict'\nconst u = require('universalify').fromPromise\nconst fs = require('../fs')\n\nfunction pathExists (path) {\n return fs.access(path).then(() => true).catch(() => false)\n}\n\nmodule.exports = {\n pathExists: u(pathExists),\n pathExistsSync: fs.existsSync\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\n\nfunction utimesMillis (path, atime, mtime, callback) {\n // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)\n fs.open(path, 'r+', (err, fd) => {\n if (err) return callback(err)\n fs.futimes(fd, atime, mtime, futimesErr => {\n fs.close(fd, closeErr => {\n if (callback) callback(futimesErr || closeErr)\n })\n })\n })\n}\n\nfunction utimesMillisSync (path, atime, mtime) {\n const fd = fs.openSync(path, 'r+')\n fs.futimesSync(fd, atime, mtime)\n return fs.closeSync(fd)\n}\n\nmodule.exports = {\n utimesMillis,\n utimesMillisSync\n}\n", "'use strict'\n\nconst fs = require('../fs')\nconst path = require('path')\nconst util = require('util')\n\nfunction getStats (src, dest, opts) {\n const statFunc = opts.dereference\n ? (file) => fs.stat(file, { bigint: true })\n : (file) => fs.lstat(file, { bigint: true })\n return Promise.all([\n statFunc(src),\n statFunc(dest).catch(err => {\n if (err.code === 'ENOENT') return null\n throw err\n })\n ]).then(([srcStat, destStat]) => ({ srcStat, destStat }))\n}\n\nfunction getStatsSync (src, dest, opts) {\n let destStat\n const statFunc = opts.dereference\n ? (file) => fs.statSync(file, { bigint: true })\n : (file) => fs.lstatSync(file, { bigint: true })\n const srcStat = statFunc(src)\n try {\n destStat = statFunc(dest)\n } catch (err) {\n if (err.code === 'ENOENT') return { srcStat, destStat: null }\n throw err\n }\n return { srcStat, destStat }\n}\n\nfunction checkPaths (src, dest, funcName, opts, cb) {\n util.callbackify(getStats)(src, dest, opts, (err, stats) => {\n if (err) return cb(err)\n const { srcStat, destStat } = stats\n\n if (destStat) {\n if (areIdentical(srcStat, destStat)) {\n const srcBaseName = path.basename(src)\n const destBaseName = path.basename(dest)\n if (funcName === 'move' &&\n srcBaseName !== destBaseName &&\n srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {\n return cb(null, { srcStat, destStat, isChangingCase: true })\n }\n return cb(new Error('Source and destination must not be the same.'))\n }\n if (srcStat.isDirectory() && !destStat.isDirectory()) {\n return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`))\n }\n if (!srcStat.isDirectory() && destStat.isDirectory()) {\n return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`))\n }\n }\n\n if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return cb(null, { srcStat, destStat })\n })\n}\n\nfunction checkPathsSync (src, dest, funcName, opts) {\n const { srcStat, destStat } = getStatsSync(src, dest, opts)\n\n if (destStat) {\n if (areIdentical(srcStat, destStat)) {\n const srcBaseName = path.basename(src)\n const destBaseName = path.basename(dest)\n if (funcName === 'move' &&\n srcBaseName !== destBaseName &&\n srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {\n return { srcStat, destStat, isChangingCase: true }\n }\n throw new Error('Source and destination must not be the same.')\n }\n if (srcStat.isDirectory() && !destStat.isDirectory()) {\n throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)\n }\n if (!srcStat.isDirectory() && destStat.isDirectory()) {\n throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)\n }\n }\n\n if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n return { srcStat, destStat }\n}\n\n// recursively check if dest parent is a subdirectory of src.\n// It works for all file types including symlinks since it\n// checks the src and dest inodes. It starts from the deepest\n// parent and stops once it reaches the src parent or the root path.\nfunction checkParentPaths (src, srcStat, dest, funcName, cb) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return cb()\n fs.stat(destParent, { bigint: true }, (err, destStat) => {\n if (err) {\n if (err.code === 'ENOENT') return cb()\n return cb(err)\n }\n if (areIdentical(srcStat, destStat)) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return checkParentPaths(src, srcStat, destParent, funcName, cb)\n })\n}\n\nfunction checkParentPathsSync (src, srcStat, dest, funcName) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return\n let destStat\n try {\n destStat = fs.statSync(destParent, { bigint: true })\n } catch (err) {\n if (err.code === 'ENOENT') return\n throw err\n }\n if (areIdentical(srcStat, destStat)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n return checkParentPathsSync(src, srcStat, destParent, funcName)\n}\n\nfunction areIdentical (srcStat, destStat) {\n return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev\n}\n\n// return true if dest is a subdir of src, otherwise false.\n// It only checks the path strings.\nfunction isSrcSubdir (src, dest) {\n const srcArr = path.resolve(src).split(path.sep).filter(i => i)\n const destArr = path.resolve(dest).split(path.sep).filter(i => i)\n return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true)\n}\n\nfunction errMsg (src, dest, funcName) {\n return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`\n}\n\nmodule.exports = {\n checkPaths,\n checkPathsSync,\n checkParentPaths,\n checkParentPathsSync,\n isSrcSubdir,\n areIdentical\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdirs = require('../mkdirs').mkdirs\nconst pathExists = require('../path-exists').pathExists\nconst utimesMillis = require('../util/utimes').utimesMillis\nconst stat = require('../util/stat')\n\nfunction copy (src, dest, opts, cb) {\n if (typeof opts === 'function' && !cb) {\n cb = opts\n opts = {}\n } else if (typeof opts === 'function') {\n opts = { filter: opts }\n }\n\n cb = cb || function () {}\n opts = opts || {}\n\n opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n // Warn about using preserveTimestamps on 32-bit node\n if (opts.preserveTimestamps && process.arch === 'ia32') {\n console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)\n }\n\n stat.checkPaths(src, dest, 'copy', opts, (err, stats) => {\n if (err) return cb(err)\n const { srcStat, destStat } = stats\n stat.checkParentPaths(src, srcStat, dest, 'copy', err => {\n if (err) return cb(err)\n if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb)\n return checkParentDir(destStat, src, dest, opts, cb)\n })\n })\n}\n\nfunction checkParentDir (destStat, src, dest, opts, cb) {\n const destParent = path.dirname(dest)\n pathExists(destParent, (err, dirExists) => {\n if (err) return cb(err)\n if (dirExists) return getStats(destStat, src, dest, opts, cb)\n mkdirs(destParent, err => {\n if (err) return cb(err)\n return getStats(destStat, src, dest, opts, cb)\n })\n })\n}\n\nfunction handleFilter (onInclude, destStat, src, dest, opts, cb) {\n Promise.resolve(opts.filter(src, dest)).then(include => {\n if (include) return onInclude(destStat, src, dest, opts, cb)\n return cb()\n }, error => cb(error))\n}\n\nfunction startCopy (destStat, src, dest, opts, cb) {\n if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb)\n return getStats(destStat, src, dest, opts, cb)\n}\n\nfunction getStats (destStat, src, dest, opts, cb) {\n const stat = opts.dereference ? fs.stat : fs.lstat\n stat(src, (err, srcStat) => {\n if (err) return cb(err)\n\n if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb)\n else if (srcStat.isFile() ||\n srcStat.isCharacterDevice() ||\n srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb)\n else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb)\n else if (srcStat.isSocket()) return cb(new Error(`Cannot copy a socket file: ${src}`))\n else if (srcStat.isFIFO()) return cb(new Error(`Cannot copy a FIFO pipe: ${src}`))\n return cb(new Error(`Unknown file: ${src}`))\n })\n}\n\nfunction onFile (srcStat, destStat, src, dest, opts, cb) {\n if (!destStat) return copyFile(srcStat, src, dest, opts, cb)\n return mayCopyFile(srcStat, src, dest, opts, cb)\n}\n\nfunction mayCopyFile (srcStat, src, dest, opts, cb) {\n if (opts.overwrite) {\n fs.unlink(dest, err => {\n if (err) return cb(err)\n return copyFile(srcStat, src, dest, opts, cb)\n })\n } else if (opts.errorOnExist) {\n return cb(new Error(`'${dest}' already exists`))\n } else return cb()\n}\n\nfunction copyFile (srcStat, src, dest, opts, cb) {\n fs.copyFile(src, dest, err => {\n if (err) return cb(err)\n if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb)\n return setDestMode(dest, srcStat.mode, cb)\n })\n}\n\nfunction handleTimestampsAndMode (srcMode, src, dest, cb) {\n // Make sure the file is writable before setting the timestamp\n // otherwise open fails with EPERM when invoked with 'r+'\n // (through utimes call)\n if (fileIsNotWritable(srcMode)) {\n return makeFileWritable(dest, srcMode, err => {\n if (err) return cb(err)\n return setDestTimestampsAndMode(srcMode, src, dest, cb)\n })\n }\n return setDestTimestampsAndMode(srcMode, src, dest, cb)\n}\n\nfunction fileIsNotWritable (srcMode) {\n return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode, cb) {\n return setDestMode(dest, srcMode | 0o200, cb)\n}\n\nfunction setDestTimestampsAndMode (srcMode, src, dest, cb) {\n setDestTimestamps(src, dest, err => {\n if (err) return cb(err)\n return setDestMode(dest, srcMode, cb)\n })\n}\n\nfunction setDestMode (dest, srcMode, cb) {\n return fs.chmod(dest, srcMode, cb)\n}\n\nfunction setDestTimestamps (src, dest, cb) {\n // The initial srcStat.atime cannot be trusted\n // because it is modified by the read(2) system call\n // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n fs.stat(src, (err, updatedSrcStat) => {\n if (err) return cb(err)\n return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb)\n })\n}\n\nfunction onDir (srcStat, destStat, src, dest, opts, cb) {\n if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb)\n return copyDir(src, dest, opts, cb)\n}\n\nfunction mkDirAndCopy (srcMode, src, dest, opts, cb) {\n fs.mkdir(dest, err => {\n if (err) return cb(err)\n copyDir(src, dest, opts, err => {\n if (err) return cb(err)\n return setDestMode(dest, srcMode, cb)\n })\n })\n}\n\nfunction copyDir (src, dest, opts, cb) {\n fs.readdir(src, (err, items) => {\n if (err) return cb(err)\n return copyDirItems(items, src, dest, opts, cb)\n })\n}\n\nfunction copyDirItems (items, src, dest, opts, cb) {\n const item = items.pop()\n if (!item) return cb()\n return copyDirItem(items, item, src, dest, opts, cb)\n}\n\nfunction copyDirItem (items, item, src, dest, opts, cb) {\n const srcItem = path.join(src, item)\n const destItem = path.join(dest, item)\n stat.checkPaths(srcItem, destItem, 'copy', opts, (err, stats) => {\n if (err) return cb(err)\n const { destStat } = stats\n startCopy(destStat, srcItem, destItem, opts, err => {\n if (err) return cb(err)\n return copyDirItems(items, src, dest, opts, cb)\n })\n })\n}\n\nfunction onLink (destStat, src, dest, opts, cb) {\n fs.readlink(src, (err, resolvedSrc) => {\n if (err) return cb(err)\n if (opts.dereference) {\n resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n }\n\n if (!destStat) {\n return fs.symlink(resolvedSrc, dest, cb)\n } else {\n fs.readlink(dest, (err, resolvedDest) => {\n if (err) {\n // dest exists and is a regular file or directory,\n // Windows may throw UNKNOWN error. If dest already exists,\n // fs throws error anyway, so no need to guard against it here.\n if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb)\n return cb(err)\n }\n if (opts.dereference) {\n resolvedDest = path.resolve(process.cwd(), resolvedDest)\n }\n if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`))\n }\n\n // do not copy if src is a subdir of dest since unlinking\n // dest in this case would result in removing src contents\n // and therefore a broken symlink would be created.\n if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`))\n }\n return copyLink(resolvedSrc, dest, cb)\n })\n }\n })\n}\n\nfunction copyLink (resolvedSrc, dest, cb) {\n fs.unlink(dest, err => {\n if (err) return cb(err)\n return fs.symlink(resolvedSrc, dest, cb)\n })\n}\n\nmodule.exports = copy\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdirsSync = require('../mkdirs').mkdirsSync\nconst utimesMillisSync = require('../util/utimes').utimesMillisSync\nconst stat = require('../util/stat')\n\nfunction copySync (src, dest, opts) {\n if (typeof opts === 'function') {\n opts = { filter: opts }\n }\n\n opts = opts || {}\n opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n // Warn about using preserveTimestamps on 32-bit node\n if (opts.preserveTimestamps && process.arch === 'ia32') {\n console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)\n }\n\n const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)\n stat.checkParentPathsSync(src, srcStat, dest, 'copy')\n return handleFilterAndCopy(destStat, src, dest, opts)\n}\n\nfunction handleFilterAndCopy (destStat, src, dest, opts) {\n if (opts.filter && !opts.filter(src, dest)) return\n const destParent = path.dirname(dest)\n if (!fs.existsSync(destParent)) mkdirsSync(destParent)\n return getStats(destStat, src, dest, opts)\n}\n\nfunction startCopy (destStat, src, dest, opts) {\n if (opts.filter && !opts.filter(src, dest)) return\n return getStats(destStat, src, dest, opts)\n}\n\nfunction getStats (destStat, src, dest, opts) {\n const statSync = opts.dereference ? fs.statSync : fs.lstatSync\n const srcStat = statSync(src)\n\n if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)\n else if (srcStat.isFile() ||\n srcStat.isCharacterDevice() ||\n srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)\n else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)\n else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)\n else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)\n throw new Error(`Unknown file: ${src}`)\n}\n\nfunction onFile (srcStat, destStat, src, dest, opts) {\n if (!destStat) return copyFile(srcStat, src, dest, opts)\n return mayCopyFile(srcStat, src, dest, opts)\n}\n\nfunction mayCopyFile (srcStat, src, dest, opts) {\n if (opts.overwrite) {\n fs.unlinkSync(dest)\n return copyFile(srcStat, src, dest, opts)\n } else if (opts.errorOnExist) {\n throw new Error(`'${dest}' already exists`)\n }\n}\n\nfunction copyFile (srcStat, src, dest, opts) {\n fs.copyFileSync(src, dest)\n if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)\n return setDestMode(dest, srcStat.mode)\n}\n\nfunction handleTimestamps (srcMode, src, dest) {\n // Make sure the file is writable before setting the timestamp\n // otherwise open fails with EPERM when invoked with 'r+'\n // (through utimes call)\n if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)\n return setDestTimestamps(src, dest)\n}\n\nfunction fileIsNotWritable (srcMode) {\n return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode) {\n return setDestMode(dest, srcMode | 0o200)\n}\n\nfunction setDestMode (dest, srcMode) {\n return fs.chmodSync(dest, srcMode)\n}\n\nfunction setDestTimestamps (src, dest) {\n // The initial srcStat.atime cannot be trusted\n // because it is modified by the read(2) system call\n // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n const updatedSrcStat = fs.statSync(src)\n return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)\n}\n\nfunction onDir (srcStat, destStat, src, dest, opts) {\n if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)\n return copyDir(src, dest, opts)\n}\n\nfunction mkDirAndCopy (srcMode, src, dest, opts) {\n fs.mkdirSync(dest)\n copyDir(src, dest, opts)\n return setDestMode(dest, srcMode)\n}\n\nfunction copyDir (src, dest, opts) {\n fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts))\n}\n\nfunction copyDirItem (item, src, dest, opts) {\n const srcItem = path.join(src, item)\n const destItem = path.join(dest, item)\n const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts)\n return startCopy(destStat, srcItem, destItem, opts)\n}\n\nfunction onLink (destStat, src, dest, opts) {\n let resolvedSrc = fs.readlinkSync(src)\n if (opts.dereference) {\n resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n }\n\n if (!destStat) {\n return fs.symlinkSync(resolvedSrc, dest)\n } else {\n let resolvedDest\n try {\n resolvedDest = fs.readlinkSync(dest)\n } catch (err) {\n // dest exists and is a regular file or directory,\n // Windows may throw UNKNOWN error. If dest already exists,\n // fs throws error anyway, so no need to guard against it here.\n if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)\n throw err\n }\n if (opts.dereference) {\n resolvedDest = path.resolve(process.cwd(), resolvedDest)\n }\n if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)\n }\n\n // prevent copy if src is a subdir of dest since unlinking\n // dest in this case would result in removing src contents\n // and therefore a broken symlink would be created.\n if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)\n }\n return copyLink(resolvedSrc, dest)\n }\n}\n\nfunction copyLink (resolvedSrc, dest) {\n fs.unlinkSync(dest)\n return fs.symlinkSync(resolvedSrc, dest)\n}\n\nmodule.exports = copySync\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nmodule.exports = {\n copy: u(require('./copy')),\n copySync: require('./copy-sync')\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst assert = require('assert')\n\nconst isWindows = (process.platform === 'win32')\n\nfunction defaults (options) {\n const methods = [\n 'unlink',\n 'chmod',\n 'stat',\n 'lstat',\n 'rmdir',\n 'readdir'\n ]\n methods.forEach(m => {\n options[m] = options[m] || fs[m]\n m = m + 'Sync'\n options[m] = options[m] || fs[m]\n })\n\n options.maxBusyTries = options.maxBusyTries || 3\n}\n\nfunction rimraf (p, options, cb) {\n let busyTries = 0\n\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n assert(p, 'rimraf: missing path')\n assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')\n assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required')\n assert(options, 'rimraf: invalid options argument provided')\n assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')\n\n defaults(options)\n\n rimraf_(p, options, function CB (er) {\n if (er) {\n if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') &&\n busyTries < options.maxBusyTries) {\n busyTries++\n const time = busyTries * 100\n // try again, with the same exact callback as this one.\n return setTimeout(() => rimraf_(p, options, CB), time)\n }\n\n // already gone\n if (er.code === 'ENOENT') er = null\n }\n\n cb(er)\n })\n}\n\n// Two possible strategies.\n// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR\n// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR\n//\n// Both result in an extra syscall when you guess wrong. However, there\n// are likely far more normal files in the world than directories. This\n// is based on the assumption that a the average number of files per\n// directory is >= 1.\n//\n// If anyone ever complains about this, then I guess the strategy could\n// be made configurable somehow. But until then, YAGNI.\nfunction rimraf_ (p, options, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n // sunos lets the root user unlink directories, which is... weird.\n // so we have to lstat here and make sure it's not a dir.\n options.lstat(p, (er, st) => {\n if (er && er.code === 'ENOENT') {\n return cb(null)\n }\n\n // Windows can EPERM on stat. Life is suffering.\n if (er && er.code === 'EPERM' && isWindows) {\n return fixWinEPERM(p, options, er, cb)\n }\n\n if (st && st.isDirectory()) {\n return rmdir(p, options, er, cb)\n }\n\n options.unlink(p, er => {\n if (er) {\n if (er.code === 'ENOENT') {\n return cb(null)\n }\n if (er.code === 'EPERM') {\n return (isWindows)\n ? fixWinEPERM(p, options, er, cb)\n : rmdir(p, options, er, cb)\n }\n if (er.code === 'EISDIR') {\n return rmdir(p, options, er, cb)\n }\n }\n return cb(er)\n })\n })\n}\n\nfunction fixWinEPERM (p, options, er, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n options.chmod(p, 0o666, er2 => {\n if (er2) {\n cb(er2.code === 'ENOENT' ? null : er)\n } else {\n options.stat(p, (er3, stats) => {\n if (er3) {\n cb(er3.code === 'ENOENT' ? null : er)\n } else if (stats.isDirectory()) {\n rmdir(p, options, er, cb)\n } else {\n options.unlink(p, cb)\n }\n })\n }\n })\n}\n\nfunction fixWinEPERMSync (p, options, er) {\n let stats\n\n assert(p)\n assert(options)\n\n try {\n options.chmodSync(p, 0o666)\n } catch (er2) {\n if (er2.code === 'ENOENT') {\n return\n } else {\n throw er\n }\n }\n\n try {\n stats = options.statSync(p)\n } catch (er3) {\n if (er3.code === 'ENOENT') {\n return\n } else {\n throw er\n }\n }\n\n if (stats.isDirectory()) {\n rmdirSync(p, options, er)\n } else {\n options.unlinkSync(p)\n }\n}\n\nfunction rmdir (p, options, originalEr, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)\n // if we guessed wrong, and it's not a directory, then\n // raise the original error.\n options.rmdir(p, er => {\n if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) {\n rmkids(p, options, cb)\n } else if (er && er.code === 'ENOTDIR') {\n cb(originalEr)\n } else {\n cb(er)\n }\n })\n}\n\nfunction rmkids (p, options, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n options.readdir(p, (er, files) => {\n if (er) return cb(er)\n\n let n = files.length\n let errState\n\n if (n === 0) return options.rmdir(p, cb)\n\n files.forEach(f => {\n rimraf(path.join(p, f), options, er => {\n if (errState) {\n return\n }\n if (er) return cb(errState = er)\n if (--n === 0) {\n options.rmdir(p, cb)\n }\n })\n })\n })\n}\n\n// this looks simpler, and is strictly *faster*, but will\n// tie up the JavaScript thread and fail on excessively\n// deep directory trees.\nfunction rimrafSync (p, options) {\n let st\n\n options = options || {}\n defaults(options)\n\n assert(p, 'rimraf: missing path')\n assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')\n assert(options, 'rimraf: missing options')\n assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')\n\n try {\n st = options.lstatSync(p)\n } catch (er) {\n if (er.code === 'ENOENT') {\n return\n }\n\n // Windows can EPERM on stat. Life is suffering.\n if (er.code === 'EPERM' && isWindows) {\n fixWinEPERMSync(p, options, er)\n }\n }\n\n try {\n // sunos lets the root user unlink directories, which is... weird.\n if (st && st.isDirectory()) {\n rmdirSync(p, options, null)\n } else {\n options.unlinkSync(p)\n }\n } catch (er) {\n if (er.code === 'ENOENT') {\n return\n } else if (er.code === 'EPERM') {\n return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)\n } else if (er.code !== 'EISDIR') {\n throw er\n }\n rmdirSync(p, options, er)\n }\n}\n\nfunction rmdirSync (p, options, originalEr) {\n assert(p)\n assert(options)\n\n try {\n options.rmdirSync(p)\n } catch (er) {\n if (er.code === 'ENOTDIR') {\n throw originalEr\n } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') {\n rmkidsSync(p, options)\n } else if (er.code !== 'ENOENT') {\n throw er\n }\n }\n}\n\nfunction rmkidsSync (p, options) {\n assert(p)\n assert(options)\n options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options))\n\n if (isWindows) {\n // We only end up here once we got ENOTEMPTY at least once, and\n // at this point, we are guaranteed to have removed all the kids.\n // So, we know that it won't be ENOENT or ENOTDIR or anything else.\n // try really hard to delete stuff on windows, because it has a\n // PROFOUNDLY annoying habit of not closing handles promptly when\n // files are deleted, resulting in spurious ENOTEMPTY errors.\n const startTime = Date.now()\n do {\n try {\n const ret = options.rmdirSync(p, options)\n return ret\n } catch {}\n } while (Date.now() - startTime < 500) // give up after 500ms\n } else {\n const ret = options.rmdirSync(p, options)\n return ret\n }\n}\n\nmodule.exports = rimraf\nrimraf.sync = rimrafSync\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst u = require('universalify').fromCallback\nconst rimraf = require('./rimraf')\n\nfunction remove (path, callback) {\n // Node 14.14.0+\n if (fs.rm) return fs.rm(path, { recursive: true, force: true }, callback)\n rimraf(path, callback)\n}\n\nfunction removeSync (path) {\n // Node 14.14.0+\n if (fs.rmSync) return fs.rmSync(path, { recursive: true, force: true })\n rimraf.sync(path)\n}\n\nmodule.exports = {\n remove: u(remove),\n removeSync\n}\n", "'use strict'\n\nconst u = require('universalify').fromPromise\nconst fs = require('../fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst remove = require('../remove')\n\nconst emptyDir = u(async function emptyDir (dir) {\n let items\n try {\n items = await fs.readdir(dir)\n } catch {\n return mkdir.mkdirs(dir)\n }\n\n return Promise.all(items.map(item => remove.remove(path.join(dir, item))))\n})\n\nfunction emptyDirSync (dir) {\n let items\n try {\n items = fs.readdirSync(dir)\n } catch {\n return mkdir.mkdirsSync(dir)\n }\n\n items.forEach(item => {\n item = path.join(dir, item)\n remove.removeSync(item)\n })\n}\n\nmodule.exports = {\n emptyDirSync,\n emptydirSync: emptyDirSync,\n emptyDir,\n emptydir: emptyDir\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst mkdir = require('../mkdirs')\n\nfunction createFile (file, callback) {\n function makeFile () {\n fs.writeFile(file, '', err => {\n if (err) return callback(err)\n callback()\n })\n }\n\n fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err\n if (!err && stats.isFile()) return callback()\n const dir = path.dirname(file)\n fs.stat(dir, (err, stats) => {\n if (err) {\n // if the directory doesn't exist, make it\n if (err.code === 'ENOENT') {\n return mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n makeFile()\n })\n }\n return callback(err)\n }\n\n if (stats.isDirectory()) makeFile()\n else {\n // parent is not a directory\n // This is just to cause an internal ENOTDIR error to be thrown\n fs.readdir(dir, err => {\n if (err) return callback(err)\n })\n }\n })\n })\n}\n\nfunction createFileSync (file) {\n let stats\n try {\n stats = fs.statSync(file)\n } catch {}\n if (stats && stats.isFile()) return\n\n const dir = path.dirname(file)\n try {\n if (!fs.statSync(dir).isDirectory()) {\n // parent is not a directory\n // This is just to cause an internal ENOTDIR error to be thrown\n fs.readdirSync(dir)\n }\n } catch (err) {\n // If the stat call above failed because the directory doesn't exist, create it\n if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir)\n else throw err\n }\n\n fs.writeFileSync(file, '')\n}\n\nmodule.exports = {\n createFile: u(createFile),\n createFileSync\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst mkdir = require('../mkdirs')\nconst pathExists = require('../path-exists').pathExists\nconst { areIdentical } = require('../util/stat')\n\nfunction createLink (srcpath, dstpath, callback) {\n function makeLink (srcpath, dstpath) {\n fs.link(srcpath, dstpath, err => {\n if (err) return callback(err)\n callback(null)\n })\n }\n\n fs.lstat(dstpath, (_, dstStat) => {\n fs.lstat(srcpath, (err, srcStat) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureLink')\n return callback(err)\n }\n if (dstStat && areIdentical(srcStat, dstStat)) return callback(null)\n\n const dir = path.dirname(dstpath)\n pathExists(dir, (err, dirExists) => {\n if (err) return callback(err)\n if (dirExists) return makeLink(srcpath, dstpath)\n mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n makeLink(srcpath, dstpath)\n })\n })\n })\n })\n}\n\nfunction createLinkSync (srcpath, dstpath) {\n let dstStat\n try {\n dstStat = fs.lstatSync(dstpath)\n } catch {}\n\n try {\n const srcStat = fs.lstatSync(srcpath)\n if (dstStat && areIdentical(srcStat, dstStat)) return\n } catch (err) {\n err.message = err.message.replace('lstat', 'ensureLink')\n throw err\n }\n\n const dir = path.dirname(dstpath)\n const dirExists = fs.existsSync(dir)\n if (dirExists) return fs.linkSync(srcpath, dstpath)\n mkdir.mkdirsSync(dir)\n\n return fs.linkSync(srcpath, dstpath)\n}\n\nmodule.exports = {\n createLink: u(createLink),\n createLinkSync\n}\n", "'use strict'\n\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst pathExists = require('../path-exists').pathExists\n\n/**\n * Function that returns two types of paths, one relative to symlink, and one\n * relative to the current working directory. Checks if path is absolute or\n * relative. If the path is relative, this function checks if the path is\n * relative to symlink or relative to current working directory. This is an\n * initiative to find a smarter `srcpath` to supply when building symlinks.\n * This allows you to determine which path to use out of one of three possible\n * types of source paths. The first is an absolute path. This is detected by\n * `path.isAbsolute()`. When an absolute path is provided, it is checked to\n * see if it exists. If it does it's used, if not an error is returned\n * (callback)/ thrown (sync). The other two options for `srcpath` are a\n * relative url. By default Node's `fs.symlink` works by creating a symlink\n * using `dstpath` and expects the `srcpath` to be relative to the newly\n * created symlink. If you provide a `srcpath` that does not exist on the file\n * system it results in a broken symlink. To minimize this, the function\n * checks to see if the 'relative to symlink' source file exists, and if it\n * does it will use it. If it does not, it checks if there's a file that\n * exists that is relative to the current working directory, if does its used.\n * This preserves the expectations of the original fs.symlink spec and adds\n * the ability to pass in `relative to current working direcotry` paths.\n */\n\nfunction symlinkPaths (srcpath, dstpath, callback) {\n if (path.isAbsolute(srcpath)) {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: srcpath\n })\n })\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n return pathExists(relativeToDst, (err, exists) => {\n if (err) return callback(err)\n if (exists) {\n return callback(null, {\n toCwd: relativeToDst,\n toDst: srcpath\n })\n } else {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n })\n })\n }\n })\n }\n}\n\nfunction symlinkPathsSync (srcpath, dstpath) {\n let exists\n if (path.isAbsolute(srcpath)) {\n exists = fs.existsSync(srcpath)\n if (!exists) throw new Error('absolute srcpath does not exist')\n return {\n toCwd: srcpath,\n toDst: srcpath\n }\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n exists = fs.existsSync(relativeToDst)\n if (exists) {\n return {\n toCwd: relativeToDst,\n toDst: srcpath\n }\n } else {\n exists = fs.existsSync(srcpath)\n if (!exists) throw new Error('relative srcpath does not exist')\n return {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n }\n }\n }\n}\n\nmodule.exports = {\n symlinkPaths,\n symlinkPathsSync\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\n\nfunction symlinkType (srcpath, type, callback) {\n callback = (typeof type === 'function') ? type : callback\n type = (typeof type === 'function') ? false : type\n if (type) return callback(null, type)\n fs.lstat(srcpath, (err, stats) => {\n if (err) return callback(null, 'file')\n type = (stats && stats.isDirectory()) ? 'dir' : 'file'\n callback(null, type)\n })\n}\n\nfunction symlinkTypeSync (srcpath, type) {\n let stats\n\n if (type) return type\n try {\n stats = fs.lstatSync(srcpath)\n } catch {\n return 'file'\n }\n return (stats && stats.isDirectory()) ? 'dir' : 'file'\n}\n\nmodule.exports = {\n symlinkType,\n symlinkTypeSync\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('../fs')\nconst _mkdirs = require('../mkdirs')\nconst mkdirs = _mkdirs.mkdirs\nconst mkdirsSync = _mkdirs.mkdirsSync\n\nconst _symlinkPaths = require('./symlink-paths')\nconst symlinkPaths = _symlinkPaths.symlinkPaths\nconst symlinkPathsSync = _symlinkPaths.symlinkPathsSync\n\nconst _symlinkType = require('./symlink-type')\nconst symlinkType = _symlinkType.symlinkType\nconst symlinkTypeSync = _symlinkType.symlinkTypeSync\n\nconst pathExists = require('../path-exists').pathExists\n\nconst { areIdentical } = require('../util/stat')\n\nfunction createSymlink (srcpath, dstpath, type, callback) {\n callback = (typeof type === 'function') ? type : callback\n type = (typeof type === 'function') ? false : type\n\n fs.lstat(dstpath, (err, stats) => {\n if (!err && stats.isSymbolicLink()) {\n Promise.all([\n fs.stat(srcpath),\n fs.stat(dstpath)\n ]).then(([srcStat, dstStat]) => {\n if (areIdentical(srcStat, dstStat)) return callback(null)\n _createSymlink(srcpath, dstpath, type, callback)\n })\n } else _createSymlink(srcpath, dstpath, type, callback)\n })\n}\n\nfunction _createSymlink (srcpath, dstpath, type, callback) {\n symlinkPaths(srcpath, dstpath, (err, relative) => {\n if (err) return callback(err)\n srcpath = relative.toDst\n symlinkType(relative.toCwd, type, (err, type) => {\n if (err) return callback(err)\n const dir = path.dirname(dstpath)\n pathExists(dir, (err, dirExists) => {\n if (err) return callback(err)\n if (dirExists) return fs.symlink(srcpath, dstpath, type, callback)\n mkdirs(dir, err => {\n if (err) return callback(err)\n fs.symlink(srcpath, dstpath, type, callback)\n })\n })\n })\n })\n}\n\nfunction createSymlinkSync (srcpath, dstpath, type) {\n let stats\n try {\n stats = fs.lstatSync(dstpath)\n } catch {}\n if (stats && stats.isSymbolicLink()) {\n const srcStat = fs.statSync(srcpath)\n const dstStat = fs.statSync(dstpath)\n if (areIdentical(srcStat, dstStat)) return\n }\n\n const relative = symlinkPathsSync(srcpath, dstpath)\n srcpath = relative.toDst\n type = symlinkTypeSync(relative.toCwd, type)\n const dir = path.dirname(dstpath)\n const exists = fs.existsSync(dir)\n if (exists) return fs.symlinkSync(srcpath, dstpath, type)\n mkdirsSync(dir)\n return fs.symlinkSync(srcpath, dstpath, type)\n}\n\nmodule.exports = {\n createSymlink: u(createSymlink),\n createSymlinkSync\n}\n", "'use strict'\n\nconst { createFile, createFileSync } = require('./file')\nconst { createLink, createLinkSync } = require('./link')\nconst { createSymlink, createSymlinkSync } = require('./symlink')\n\nmodule.exports = {\n // file\n createFile,\n createFileSync,\n ensureFile: createFile,\n ensureFileSync: createFileSync,\n // link\n createLink,\n createLinkSync,\n ensureLink: createLink,\n ensureLinkSync: createLinkSync,\n // symlink\n createSymlink,\n createSymlinkSync,\n ensureSymlink: createSymlink,\n ensureSymlinkSync: createSymlinkSync\n}\n", "function stringify (obj, { EOL = '\\n', finalEOL = true, replacer = null, spaces } = {}) {\n const EOF = finalEOL ? EOL : ''\n const str = JSON.stringify(obj, replacer, spaces)\n\n return str.replace(/\\n/g, EOL) + EOF\n}\n\nfunction stripBom (content) {\n // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified\n if (Buffer.isBuffer(content)) content = content.toString('utf8')\n return content.replace(/^\\uFEFF/, '')\n}\n\nmodule.exports = { stringify, stripBom }\n", "let _fs\ntry {\n _fs = require('graceful-fs')\n} catch (_) {\n _fs = require('fs')\n}\nconst universalify = require('universalify')\nconst { stringify, stripBom } = require('./utils')\n\nasync function _readFile (file, options = {}) {\n if (typeof options === 'string') {\n options = { encoding: options }\n }\n\n const fs = options.fs || _fs\n\n const shouldThrow = 'throws' in options ? options.throws : true\n\n let data = await universalify.fromCallback(fs.readFile)(file, options)\n\n data = stripBom(data)\n\n let obj\n try {\n obj = JSON.parse(data, options ? options.reviver : null)\n } catch (err) {\n if (shouldThrow) {\n err.message = `${file}: ${err.message}`\n throw err\n } else {\n return null\n }\n }\n\n return obj\n}\n\nconst readFile = universalify.fromPromise(_readFile)\n\nfunction readFileSync (file, options = {}) {\n if (typeof options === 'string') {\n options = { encoding: options }\n }\n\n const fs = options.fs || _fs\n\n const shouldThrow = 'throws' in options ? options.throws : true\n\n try {\n let content = fs.readFileSync(file, options)\n content = stripBom(content)\n return JSON.parse(content, options.reviver)\n } catch (err) {\n if (shouldThrow) {\n err.message = `${file}: ${err.message}`\n throw err\n } else {\n return null\n }\n }\n}\n\nasync function _writeFile (file, obj, options = {}) {\n const fs = options.fs || _fs\n\n const str = stringify(obj, options)\n\n await universalify.fromCallback(fs.writeFile)(file, str, options)\n}\n\nconst writeFile = universalify.fromPromise(_writeFile)\n\nfunction writeFileSync (file, obj, options = {}) {\n const fs = options.fs || _fs\n\n const str = stringify(obj, options)\n // not sure if fs.writeFileSync returns anything, but just in case\n return fs.writeFileSync(file, str, options)\n}\n\nconst jsonfile = {\n readFile,\n readFileSync,\n writeFile,\n writeFileSync\n}\n\nmodule.exports = jsonfile\n", "'use strict'\n\nconst jsonFile = require('jsonfile')\n\nmodule.exports = {\n // jsonfile exports\n readJson: jsonFile.readFile,\n readJsonSync: jsonFile.readFileSync,\n writeJson: jsonFile.writeFile,\n writeJsonSync: jsonFile.writeFileSync\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst pathExists = require('../path-exists').pathExists\n\nfunction outputFile (file, data, encoding, callback) {\n if (typeof encoding === 'function') {\n callback = encoding\n encoding = 'utf8'\n }\n\n const dir = path.dirname(file)\n pathExists(dir, (err, itDoes) => {\n if (err) return callback(err)\n if (itDoes) return fs.writeFile(file, data, encoding, callback)\n\n mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n\n fs.writeFile(file, data, encoding, callback)\n })\n })\n}\n\nfunction outputFileSync (file, ...args) {\n const dir = path.dirname(file)\n if (fs.existsSync(dir)) {\n return fs.writeFileSync(file, ...args)\n }\n mkdir.mkdirsSync(dir)\n fs.writeFileSync(file, ...args)\n}\n\nmodule.exports = {\n outputFile: u(outputFile),\n outputFileSync\n}\n", "'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFile } = require('../output-file')\n\nasync function outputJson (file, data, options = {}) {\n const str = stringify(data, options)\n\n await outputFile(file, str, options)\n}\n\nmodule.exports = outputJson\n", "'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFileSync } = require('../output-file')\n\nfunction outputJsonSync (file, data, options) {\n const str = stringify(data, options)\n\n outputFileSync(file, str, options)\n}\n\nmodule.exports = outputJsonSync\n", "'use strict'\n\nconst u = require('universalify').fromPromise\nconst jsonFile = require('./jsonfile')\n\njsonFile.outputJson = u(require('./output-json'))\njsonFile.outputJsonSync = require('./output-json-sync')\n// aliases\njsonFile.outputJSON = jsonFile.outputJson\njsonFile.outputJSONSync = jsonFile.outputJsonSync\njsonFile.writeJSON = jsonFile.writeJson\njsonFile.writeJSONSync = jsonFile.writeJsonSync\njsonFile.readJSON = jsonFile.readJson\njsonFile.readJSONSync = jsonFile.readJsonSync\n\nmodule.exports = jsonFile\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst copy = require('../copy').copy\nconst remove = require('../remove').remove\nconst mkdirp = require('../mkdirs').mkdirp\nconst pathExists = require('../path-exists').pathExists\nconst stat = require('../util/stat')\n\nfunction move (src, dest, opts, cb) {\n if (typeof opts === 'function') {\n cb = opts\n opts = {}\n }\n\n const overwrite = opts.overwrite || opts.clobber || false\n\n stat.checkPaths(src, dest, 'move', opts, (err, stats) => {\n if (err) return cb(err)\n const { srcStat, isChangingCase = false } = stats\n stat.checkParentPaths(src, srcStat, dest, 'move', err => {\n if (err) return cb(err)\n if (isParentRoot(dest)) return doRename(src, dest, overwrite, isChangingCase, cb)\n mkdirp(path.dirname(dest), err => {\n if (err) return cb(err)\n return doRename(src, dest, overwrite, isChangingCase, cb)\n })\n })\n })\n}\n\nfunction isParentRoot (dest) {\n const parent = path.dirname(dest)\n const parsedPath = path.parse(parent)\n return parsedPath.root === parent\n}\n\nfunction doRename (src, dest, overwrite, isChangingCase, cb) {\n if (isChangingCase) return rename(src, dest, overwrite, cb)\n if (overwrite) {\n return remove(dest, err => {\n if (err) return cb(err)\n return rename(src, dest, overwrite, cb)\n })\n }\n pathExists(dest, (err, destExists) => {\n if (err) return cb(err)\n if (destExists) return cb(new Error('dest already exists.'))\n return rename(src, dest, overwrite, cb)\n })\n}\n\nfunction rename (src, dest, overwrite, cb) {\n fs.rename(src, dest, err => {\n if (!err) return cb()\n if (err.code !== 'EXDEV') return cb(err)\n return moveAcrossDevice(src, dest, overwrite, cb)\n })\n}\n\nfunction moveAcrossDevice (src, dest, overwrite, cb) {\n const opts = {\n overwrite,\n errorOnExist: true\n }\n copy(src, dest, opts, err => {\n if (err) return cb(err)\n return remove(src, cb)\n })\n}\n\nmodule.exports = move\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst copySync = require('../copy').copySync\nconst removeSync = require('../remove').removeSync\nconst mkdirpSync = require('../mkdirs').mkdirpSync\nconst stat = require('../util/stat')\n\nfunction moveSync (src, dest, opts) {\n opts = opts || {}\n const overwrite = opts.overwrite || opts.clobber || false\n\n const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, 'move', opts)\n stat.checkParentPathsSync(src, srcStat, dest, 'move')\n if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest))\n return doRename(src, dest, overwrite, isChangingCase)\n}\n\nfunction isParentRoot (dest) {\n const parent = path.dirname(dest)\n const parsedPath = path.parse(parent)\n return parsedPath.root === parent\n}\n\nfunction doRename (src, dest, overwrite, isChangingCase) {\n if (isChangingCase) return rename(src, dest, overwrite)\n if (overwrite) {\n removeSync(dest)\n return rename(src, dest, overwrite)\n }\n if (fs.existsSync(dest)) throw new Error('dest already exists.')\n return rename(src, dest, overwrite)\n}\n\nfunction rename (src, dest, overwrite) {\n try {\n fs.renameSync(src, dest)\n } catch (err) {\n if (err.code !== 'EXDEV') throw err\n return moveAcrossDevice(src, dest, overwrite)\n }\n}\n\nfunction moveAcrossDevice (src, dest, overwrite) {\n const opts = {\n overwrite,\n errorOnExist: true\n }\n copySync(src, dest, opts)\n return removeSync(src)\n}\n\nmodule.exports = moveSync\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nmodule.exports = {\n move: u(require('./move')),\n moveSync: require('./move-sync')\n}\n", "'use strict'\n\nmodule.exports = {\n // Export promiseified graceful-fs:\n ...require('./fs'),\n // Export extra methods:\n ...require('./copy'),\n ...require('./empty'),\n ...require('./ensure'),\n ...require('./json'),\n ...require('./mkdirs'),\n ...require('./move'),\n ...require('./output-file'),\n ...require('./path-exists'),\n ...require('./remove')\n}\n", "const flagSymbol = Symbol('arg flag');\n\nclass ArgError extends Error {\n\tconstructor(msg, code) {\n\t\tsuper(msg);\n\t\tthis.name = 'ArgError';\n\t\tthis.code = code;\n\n\t\tObject.setPrototypeOf(this, ArgError.prototype);\n\t}\n}\n\nfunction arg(\n\topts,\n\t{\n\t\targv = process.argv.slice(2),\n\t\tpermissive = false,\n\t\tstopAtPositional = false\n\t} = {}\n) {\n\tif (!opts) {\n\t\tthrow new ArgError(\n\t\t\t'argument specification object is required',\n\t\t\t'ARG_CONFIG_NO_SPEC'\n\t\t);\n\t}\n\n\tconst result = { _: [] };\n\n\tconst aliases = {};\n\tconst handlers = {};\n\n\tfor (const key of Object.keys(opts)) {\n\t\tif (!key) {\n\t\t\tthrow new ArgError(\n\t\t\t\t'argument key cannot be an empty string',\n\t\t\t\t'ARG_CONFIG_EMPTY_KEY'\n\t\t\t);\n\t\t}\n\n\t\tif (key[0] !== '-') {\n\t\t\tthrow new ArgError(\n\t\t\t\t`argument key must start with '-' but found: '${key}'`,\n\t\t\t\t'ARG_CONFIG_NONOPT_KEY'\n\t\t\t);\n\t\t}\n\n\t\tif (key.length === 1) {\n\t\t\tthrow new ArgError(\n\t\t\t\t`argument key must have a name; singular '-' keys are not allowed: ${key}`,\n\t\t\t\t'ARG_CONFIG_NONAME_KEY'\n\t\t\t);\n\t\t}\n\n\t\tif (typeof opts[key] === 'string') {\n\t\t\taliases[key] = opts[key];\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet type = opts[key];\n\t\tlet isFlag = false;\n\n\t\tif (\n\t\t\tArray.isArray(type) &&\n\t\t\ttype.length === 1 &&\n\t\t\ttypeof type[0] === 'function'\n\t\t) {\n\t\t\tconst [fn] = type;\n\t\t\ttype = (value, name, prev = []) => {\n\t\t\t\tprev.push(fn(value, name, prev[prev.length - 1]));\n\t\t\t\treturn prev;\n\t\t\t};\n\t\t\tisFlag = fn === Boolean || fn[flagSymbol] === true;\n\t\t} else if (typeof type === 'function') {\n\t\t\tisFlag = type === Boolean || type[flagSymbol] === true;\n\t\t} else {\n\t\t\tthrow new ArgError(\n\t\t\t\t`type missing or not a function or valid array type: ${key}`,\n\t\t\t\t'ARG_CONFIG_VAD_TYPE'\n\t\t\t);\n\t\t}\n\n\t\tif (key[1] !== '-' && key.length > 2) {\n\t\t\tthrow new ArgError(\n\t\t\t\t`short argument keys (with a single hyphen) must have only one character: ${key}`,\n\t\t\t\t'ARG_CONFIG_SHORTOPT_TOOLONG'\n\t\t\t);\n\t\t}\n\n\t\thandlers[key] = [type, isFlag];\n\t}\n\n\tfor (let i = 0, len = argv.length; i < len; i++) {\n\t\tconst wholeArg = argv[i];\n\n\t\tif (stopAtPositional && result._.length > 0) {\n\t\t\tresult._ = result._.concat(argv.slice(i));\n\t\t\tbreak;\n\t\t}\n\n\t\tif (wholeArg === '--') {\n\t\t\tresult._ = result._.concat(argv.slice(i + 1));\n\t\t\tbreak;\n\t\t}\n\n\t\tif (wholeArg.length > 1 && wholeArg[0] === '-') {\n\t\t\t/* eslint-disable operator-linebreak */\n\t\t\tconst separatedArguments =\n\t\t\t\twholeArg[1] === '-' || wholeArg.length === 2\n\t\t\t\t\t? [wholeArg]\n\t\t\t\t\t: wholeArg\n\t\t\t\t\t\t\t.slice(1)\n\t\t\t\t\t\t\t.split('')\n\t\t\t\t\t\t\t.map((a) => `-${a}`);\n\t\t\t/* eslint-enable operator-linebreak */\n\n\t\t\tfor (let j = 0; j < separatedArguments.length; j++) {\n\t\t\t\tconst arg = separatedArguments[j];\n\t\t\t\tconst [originalArgName, argStr] =\n\t\t\t\t\targ[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined];\n\n\t\t\t\tlet argName = originalArgName;\n\t\t\t\twhile (argName in aliases) {\n\t\t\t\t\targName = aliases[argName];\n\t\t\t\t}\n\n\t\t\t\tif (!(argName in handlers)) {\n\t\t\t\t\tif (permissive) {\n\t\t\t\t\t\tresult._.push(arg);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new ArgError(\n\t\t\t\t\t\t\t`unknown or unexpected option: ${originalArgName}`,\n\t\t\t\t\t\t\t'ARG_UNKNOWN_OPTION'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst [type, isFlag] = handlers[argName];\n\n\t\t\t\tif (!isFlag && j + 1 < separatedArguments.length) {\n\t\t\t\t\tthrow new ArgError(\n\t\t\t\t\t\t`option requires argument (but was followed by another short argument): ${originalArgName}`,\n\t\t\t\t\t\t'ARG_MISSING_REQUIRED_SHORTARG'\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (isFlag) {\n\t\t\t\t\tresult[argName] = type(true, argName, result[argName]);\n\t\t\t\t} else if (argStr === undefined) {\n\t\t\t\t\tif (\n\t\t\t\t\t\targv.length < i + 2 ||\n\t\t\t\t\t\t(argv[i + 1].length > 1 &&\n\t\t\t\t\t\t\targv[i + 1][0] === '-' &&\n\t\t\t\t\t\t\t!(\n\t\t\t\t\t\t\t\targv[i + 1].match(/^-?\\d*(\\.(?=\\d))?\\d*$/) &&\n\t\t\t\t\t\t\t\t(type === Number ||\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line no-undef\n\t\t\t\t\t\t\t\t\t(typeof BigInt !== 'undefined' && type === BigInt))\n\t\t\t\t\t\t\t))\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst extended =\n\t\t\t\t\t\t\toriginalArgName === argName ? '' : ` (alias for ${argName})`;\n\t\t\t\t\t\tthrow new ArgError(\n\t\t\t\t\t\t\t`option requires argument: ${originalArgName}${extended}`,\n\t\t\t\t\t\t\t'ARG_MISSING_REQUIRED_LONGARG'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tresult[argName] = type(argv[i + 1], argName, result[argName]);\n\t\t\t\t\t++i;\n\t\t\t\t} else {\n\t\t\t\t\tresult[argName] = type(argStr, argName, result[argName]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tresult._.push(wholeArg);\n\t\t}\n\t}\n\n\treturn result;\n}\n\narg.flag = (fn) => {\n\tfn[flagSymbol] = true;\n\treturn fn;\n};\n\n// Utility types\narg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1);\n\n// Expose error class\narg.ArgError = ArgError;\n\nmodule.exports = arg;\n", "#!/usr/bin/env node\r\nimport { Command } from 'commander';\r\nimport baseAction from './commands/base';\r\nconst program = new Command();\r\nprogram.action(baseAction);\r\nprogram.parse(process.argv);\r\n", "/* \u754C\u9762\u547D\u4EE4\u6CE8\u518C\u5728\u8FD9\u91CC */\r\nimport { ItemType } from './get-file'\r\nimport prompts from 'prompts'\r\nimport { wirteMd, getMd } from './wirte-md'\r\nimport { renameFoldPath, renameFilePath } from './rename-path'\r\nimport stringToArgs from '../../script/cli'\r\nimport handle from '../../script/cli/handle'\r\nimport logger from '../shared/logger'\r\nimport { changePath, wirteJsNodes } from './change-path'\r\nimport { markFile, deletMarkAll, witeFile } from './mark-file'\r\nimport { getRouterArrs } from './get-router'\r\n// \u4E3A\u4EC0\u4E48\u8981\u52A0process.cwd()\u7684replace \u662F\u4E3A\u4E86\u62B9\u5E73window\u548Clinux\u751F\u6210\u7684\u8DEF\u5F84\u4E0D\u4E00\u6837\u7684\u95EE\u9898\r\nconst rootPath = process.cwd().replace(/\\\\/g, '/')\r\nconst options = stringToArgs(process.argv)\r\nconst { ignores: ignore, includes: include } = handle(options)\r\n/**\r\n * @desc: //2. \u5F97\u5230md\u6587\u6863,------------>\u4F1A\u5199(\u53EA\u751F\u6210\u4E00\u4E2Amd)\r\n * @author: majun\r\n * @param {string} md\r\n */\r\nfunction getMdAction(md: string) {\r\n console.log('\\x1B[36m%s\\x1B[0m', '*** location: ', `${rootPath}/readme-md.md`)\r\n wirteMd(md, `${rootPath}/readme-md.md`)\r\n}\r\n\r\n/**\r\n * @desc: //3. \u66F4\u6539\u6240\u6709\u4E3A\u7EDD\u5BF9\u8DEF\u5F84+ \u540E\u7F00\u8865\u5168------------>\u4F1A\u5199(\u4F1A\u64CD\u4F5C\u4EE3\u7801)\r\n * @author: majun\r\n * @param {Array} nodes\r\n */\r\nasync function changePathAction(nodes: ItemType[]) {\r\n await changePath(nodes)\r\n}\r\n\r\n/**\r\n * @desc: //4. \u6253\u6807\u8BB0 ------------> \u4F1A\u5199(\u4F1A\u64CD\u4F5C\u4EE3\u7801) //5. \u5206\u6587\u4EF6 ------------> \u4F1A\u5199(\u4F1A\u53E6\u5916\u751F\u6210\u5305\u6587\u4EF6)\r\n * @author: majun\r\n * @param {Array} nodes\r\n */\r\nasync function markFileAction(nodes: ItemType[]) {\r\n const routers = getRouterArrs()\r\n if (routers) {\r\n await markFile(nodes, routers)\r\n wirteJsNodes(JSON.stringify(nodes), rootPath + '/readme-file.js')\r\n }\r\n}\r\n\r\n/**\r\n * @desc: 5,\u5C06\u6253\u6807\u8BB0\u7684\u8FDB\u884Ccopy\r\n * @author: majun\r\n * @param {Array} nodes\r\n */\r\nasync function witeFileAction(nodes: ItemType[]) {\r\n const routers = getRouterArrs()\r\n if (routers) {\r\n await markFile(nodes, routers)\r\n // copy\u6587\u4EF6\u4E00\u5B9A\u662F\u5EFA\u7ACB\u5728\u6253\u6807\u8BB0\u7684\u57FA\u7840\u4E0A\r\n witeFile(nodes, routers)\r\n }\r\n}\r\n/**\r\n * @desc://6. \u5F97\u5230md\u5BF9\u8C61(\u53EA\u751F\u6210\u4E00\u4E2Amd)\r\n * @author: majun\r\n * @param {Array} nodes\r\n */\r\nasync function wirteJsNodesAction(nodes: ItemType[]) {\r\n // \u8981\u5148\u6539\u8DEF\u5F84\u540E\u7F00,\u5426\u5219\u4F9D\u8D56\u6536\u96C6\u4E0D\u5230\r\n await changePathAction(nodes)\r\n wirteJsNodes(JSON.stringify(nodes), rootPath + '/readme-file.js')\r\n}\r\n\r\n/**\r\n * @desc://7. \u5220\u9664\u6807\u8BB0\r\n * @author: majun\r\n * @param {Array} nodes\r\n */\r\nasync function deletMarkAction(nodes: ItemType[]) {\r\n deletMarkAll(nodes, 'base')\r\n}\r\n\r\n/**\r\n * @desc://8. \u89C4\u8303\u547D\u540D\u6587\u4EF6\u5939kabel-case\r\n * @author: majun\r\n * @param {Array} nodes\r\n */\r\nasync function renameFoldAction(nodes: ItemType[]) {\r\n renameFoldPath(nodes)\r\n}\r\n\r\n/**\r\n * @desc://9. \u89C4\u8303\u547D\u540D\u6587\u4EF6kabel-case\r\n * @author: majun\r\n * @param {Array} nodes\r\n */\r\nasync function renameFileAction(nodes: ItemType[]) {\r\n renameFilePath(nodes)\r\n}\r\n\r\n/**\r\n * @desc: \u6267\u884C\u6240\u6709\u64CD\u4F5C\r\n * @author: majun\r\n * @param {Array} nodes\r\n * @param {string} md\r\n */\r\nexport async function generateAllAction(nodes: ItemType[], md: string) {\r\n const routers = getRouterArrs()\r\n if (routers) {\r\n getMdAction(md);\r\n await changePathAction(nodes);\r\n await markFileAction(nodes);\r\n // copy\u6587\u4EF6\u4E00\u5B9A\u662F\u5EFA\u7ACB\u5728\u6253\u6807\u8BB0\u7684\u57FA\u7840\u4E0A\r\n witeFile(nodes, routers);\r\n wirteJsNodes(JSON.stringify(nodes), rootPath + '/readme-file.js');\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u6240\u6709\u547D\u540D\u90FD\u5728\u8FD9\u91CC\u6CE8\u518C,\u5E76\u8C03\u7528\u6267\u884C\r\n * @author: majun\r\n */\r\nfunction getActions() {\r\n const actionMap = new Map<string, prompts.Choice & { action: Function }>()\r\n //1. \u8FD9\u91CC\u53EA\u8BFB\u6587\u4EF6, ------------>\u4E0D\u5199\r\n const { md, nodes } = getMd({ ignore, include })\r\n\r\n actionMap.set('Generate All', {\r\n title: 'Generate All',\r\n value: 'Generate All',\r\n selected: true,\r\n action: () => generateAllAction(nodes, md)\r\n })\r\n actionMap.set('Generate MD', {\r\n title: 'Generate MD',\r\n value: 'Generate MD',\r\n selected: true,\r\n action: () => getMdAction(md)\r\n })\r\n actionMap.set('Change Path', {\r\n title: 'Change Path',\r\n value: 'Change Path',\r\n action: () => changePathAction(nodes)\r\n })\r\n actionMap.set('Mark File', {\r\n title: 'Mark File',\r\n value: 'Mark File',\r\n action: () => markFileAction(nodes)\r\n })\r\n actionMap.set('Delete Mark', {\r\n title: 'Delete Mark',\r\n value: 'Delete Mark',\r\n action: () => deletMarkAction(nodes)\r\n })\r\n actionMap.set('Classification', {\r\n title: 'Classification',\r\n value: 'Classification',\r\n action: () => witeFileAction(nodes)\r\n })\r\n actionMap.set('RenameFoldKebabCase', {\r\n title: 'RenameFoldKebabCase',\r\n value: 'RenameFoldKebabCase',\r\n action: () => renameFoldAction(nodes)\r\n })\r\n actionMap.set('RenameFielKebabCase', {\r\n title: 'RenameFielKebabCase',\r\n value: 'RenameFielKebabCase',\r\n action: () => renameFileAction(nodes)\r\n })\r\n\r\n\r\n actionMap.set('Wirte Json Nodes', {\r\n title: 'Wirte Json Nodes',\r\n value: 'Wirte Json Nodes',\r\n action: () => wirteJsNodes(JSON.stringify(nodes), rootPath + '/readme-file.js')\r\n })\r\n actionMap.set('Wirte Nodes With Import(may change path)', {\r\n title: 'Wirte Nodes With Import(may change path)',\r\n value: 'Wirte Nodes With Import(may change path)',\r\n action: () => wirteJsNodesAction(nodes)\r\n })\r\n return actionMap\r\n}\r\n\r\nexport type BaseCmd = {\r\n init?: boolean\r\n config?: string\r\n}\r\n\r\nexport default async function baseAction(cmd: BaseCmd) {\r\n if (cmd.init) {\r\n // return generateConfig();\r\n }\r\n selectCommand()\r\n}\r\n\r\n/**\r\n * @desc: \u9009\u62E9\u547D\u4EE4\r\n * @author: majun\r\n */\r\nasync function selectCommand() {\r\n const actions = getActions()\r\n let result: any = {}\r\n try {\r\n result = await prompts(\r\n [\r\n {\r\n name: 'command',\r\n type: 'select',\r\n message: 'Please select a command.',\r\n choices: Array.from(actions.values())\r\n }\r\n ],\r\n {\r\n onCancel: () => {\r\n throw new Error('Operation cancelled.')\r\n }\r\n }\r\n )\r\n } catch (e: any) {\r\n logger.error(e.message)\r\n process.exit(1)\r\n }\r\n actions.get(result.command)!.action()\r\n}\r\n", "/* \u751F\u6210md\u8BF4\u660E\u6587\u6863 */\r\nimport fs from 'fs'\r\nimport path from 'path'\r\nimport { getFileNodes, getNote } from './get-file'\r\nimport { ItemType } from './get-file'\r\nimport logger from '../shared/logger'\r\nimport createDebugger from 'debug'\r\nconst rootPath = process.cwd().replace(/\\\\/g, '/')\r\nconst debug = createDebugger('wirte-md')\r\ndebug.enabled = false\r\ntype secoutType = { rowTotleNumber: number; sizeTotleNumber: number; coutObj: { [key: string]: number } }\r\n/**\r\n * @description:Write the result to JS file \u628A\u7ED3\u679C\u5199\u5165\u5230js\u6587\u4EF6\r\n * @param {data} \u8981\u5199\u7684\u6570\u636E\r\n * @return {fileName} \u8981\u5199\u5165\u6587\u4EF6\u5730\u5740\r\n */\r\nexport function wirteMd(data: string, filePath: string) {\r\n const file = path.resolve(rootPath, filePath)\r\n // \u5F02\u6B65\u5199\u5165\u6570\u636E\u5230\u6587\u4EF6\r\n fs.writeFile(file, data, { encoding: 'utf8' }, () => {\r\n logger.success('Write successful')\r\n })\r\n}\r\n\r\n/**\r\n * @description: Get statistics \u5F97\u5230\u7EDF\u8BA1\r\n * @param {Array} nodes\r\n * @return {*}\r\n */\r\nfunction getCountMd(datas: ItemType[]) {\r\n let rowTotleNumber = 0\r\n let sizeTotleNumber = 0\r\n const coutObj: { [key: string]: number } = {}\r\n function getDeatle(nodes: ItemType[]) {\r\n nodes.forEach((obj: ItemType) => {\r\n if (obj.children) getDeatle(obj.children)\r\n else if (obj.suffix && obj.rowSize && obj.size) {\r\n if (!coutObj.hasOwnProperty(obj.suffix)) coutObj[obj.suffix] = 0\r\n coutObj[obj.suffix]++\r\n rowTotleNumber += obj.rowSize\r\n sizeTotleNumber += obj.size\r\n }\r\n })\r\n }\r\n getDeatle(datas)\r\n return {\r\n rowTotleNumber,\r\n sizeTotleNumber,\r\n coutObj\r\n }\r\n}\r\n\r\n/**\r\n * @description:Thousands format \u5343\u5206\u4F4D\u683C\u5F0F\u5316\r\n * @param {num} To format a number \u8981\u683C\u5F0F\u5316\u6570\u5B57\r\n * @return {string}\r\n */\r\nfunction format(num: number) {\r\n var reg = /\\d{1,3}(?=(\\d{3})+$)/g\r\n return (num + '').replace(reg, '$&,')\r\n}\r\n\r\n/**\r\n * @description: Generate statistics MD \u751F\u6210\u7EDF\u8BA1md\r\n * @param {object} option\r\n * @return {*}\r\n */\r\nfunction setCountMd(obj: secoutType) {\r\n const { rowTotleNumber, sizeTotleNumber, coutObj } = obj\r\n let countMd = ''\r\n let totle = 0\r\n for (const key in coutObj) {\r\n const ele = coutObj[key]\r\n totle += ele\r\n countMd += `The suffix is ${key} has ${ele} files\\n`\r\n }\r\n countMd += `The totle has ${totle} files\\n`\r\n let md = `Total number of file lines: ${format(rowTotleNumber)},\r\nTotal number of codes: ${format(sizeTotleNumber)} \\n`\r\n md = countMd + md\r\n return md\r\n}\r\n/**\r\n * @description: Generate MD \u751F\u6210md\r\n * @param {object} option\r\n * @return {*}\r\n */\r\nexport function getMd(\r\n option?: { ignore: string[] | undefined; include: string[] | undefined } | undefined\r\n) {\r\n logger.success('*** run location: '+process.cwd() + '\\n')\r\n const nodes = getFileNodes(rootPath,option)\r\n const countMdObj = getCountMd(nodes)\r\n const coutMd = setCountMd(countMdObj)\r\n logger.success(coutMd)\r\n const note = getNote(nodes) // \u5F97\u5230\u6240\u6709note\u7684\u6570\u7EC4\r\n const md = note.join('') + '\\n' // \u6570\u7EC4\u8F6C\u5B57\u7B26\u4E32\r\n if (md.length > 0) {\r\n logger.success('*** Automatic generation completed !')\r\n }\r\n return { md: md + coutMd, nodes }\r\n}\r\n", "/* \u83B7\u53D6\u6587\u4EF6\u76F8\u5173\u65B9\u6CD5 */\r\nimport fs from 'fs'\r\nimport path from 'path'\r\nimport createDebugger from 'debug'\r\nimport { changeImport } from './change-path';\r\nconst debug = createDebugger('get-file')\r\ndebug.enabled = false\r\nimport { env } from 'node-environment'\r\nconst isDev = env() === 'development'\r\n/**\r\n * @description:Gets the header comment of the file \u83B7\u53D6\u6587\u4EF6\u7684\u5934\u90E8\u6CE8\u91CA\r\n * @param {*} fullPath\r\n * @return {*}\r\n */\r\nexport function getFile(fullPath: string) {\r\n const str = fs.readFileSync(fullPath, 'utf-8')\r\n const size = str.length\r\n const sarr = str.split(/[\\n]/g)\r\n const rowSize = sarr.length\r\n const imports = getImport(sarr, fullPath)\r\n const f =\r\n sarr[0].indexOf('eslint') === -1 &&\r\n (sarr[0].indexOf('-->') > -1 || sarr[0].indexOf('*/') > -1 || sarr[0].indexOf('//') > -1)\r\n ? sarr[0]\r\n : ''\r\n return {\r\n note: f,\r\n size,\r\n rowSize,\r\n imports\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u8FD9\u662F\u521D\u59CB\u5316\u65F6\u5C31\u83B7\u53D6\u6BCF\u4E2A\u6587\u4EF6\u4F9D\u8D56\u7684\u65B9\u6CD5, \u4F46\u8981\u6C42\u5148\u8865\u5168\u540E\u7F00,\u5426\u5219\u4E0D\u7075\r\n * @author: majun\r\n * @param {any} sarr\r\n * @param {string} fullPath\r\n */\r\nexport function getImport(sarr: any[], fullPath: string) {\r\n // \u8FD9\u91CC\u83B7\u53D6\u6BCF\u4E2A\u6587\u4EF6\u7684import\u8DEF\u5F84\r\n const imports: string[] = []\r\n sarr.forEach((ele: string) => {\r\n if (ele.indexOf('from') > -1) {\r\n const { absoluteImport } = changeImport(ele, fullPath)\r\n if (absoluteImport) {\r\n imports.push(absoluteImport)\r\n }\r\n\r\n }\r\n })\r\n return imports\r\n}\r\n\r\nexport type ItemType = {\r\n name: string\r\n copyed?: boolean\r\n isDir: boolean\r\n level: number\r\n note: string\r\n size?: number\r\n suffix?: string\r\n rowSize?: number\r\n fullPath: string\r\n belongTo: string[] // \u6807\u8BB0\u5F52\u5C5E\u8BBE\u7F6E \u5206\u7C7B\u7528\r\n imports: string[] // \u4F9D\u8D56\u6536\u96C6\r\n children?: ItemType[]\r\n}\r\n\r\n/**\r\n * @description:Generate node information for all files \u751F\u6210\u6240\u6709\u6587\u4EF6\u7684node\u4FE1\u606F\r\n * @param {*} dir \u8981\u89E3\u6790\u7684\u8DEF\u5F84\r\n * @param {Array} nodes\r\n * @param {Number} level\r\n * @return {*}\r\n */\r\nexport function getFileNodes(\r\n dir = process.cwd(),\r\n option?: { ignore: string[] | undefined; include: string[] | undefined } | undefined,\r\n nodes: ItemType[] = [],\r\n level = 0\r\n): ItemType[] {\r\n //File filtering -- full name with suffix required \u6587\u4EF6\u8FC7\u6EE4--\u9700\u8981\u5168\u79F0\u5E26\u540E\u7F00\r\n let ignore = [\r\n // 'api',\r\n // 'src',\r\n 'bin',\r\n 'lib',\r\n 'jest.config.js',\r\n 'router',\r\n 'img',\r\n 'styles',\r\n 'node_modules',\r\n 'LICENSE',\r\n '.git',\r\n '.github',\r\n 'dist',\r\n '.husky',\r\n '.vscode',\r\n '.eslintrc.js',\r\n 'readme-file.js',\r\n 'readme-md.js'\r\n ]\r\n //File suffix contains only \u6587\u4EF6\u540E\u7F00\u53EA\u5305\u542B\r\n let include = isDev?['.js', '.vue']:['.js', '.vue', '.ts']\r\n if (option) {\r\n ignore = option.ignore || ignore\r\n include = option.include || include\r\n }\r\n\r\n const files = fs\r\n .readdirSync(dir)\r\n .map((item) => {\r\n let fullPath = path.join(dir, item)\r\n const isDir = fs.lstatSync(fullPath).isDirectory()\r\n return {\r\n name: item,\r\n isDir,\r\n level,\r\n note: '',\r\n imports: new Array(),\r\n belongTo: new Array()\r\n } as ItemType\r\n })\r\n //Sort folders and files, otherwise the generated will not correspond to the opening order of the editor \u5BF9\u6587\u4EF6\u5939\u548C\u6587\u4EF6\u8FDB\u884C\u6392\u5E8F,\u8981\u4E0D\u7136\u751F\u6210\u7684\u548C\u7F16\u8F91\u5668\u6253\u5F00\u7684\u987A\u5E8F\u4E0D\u5BF9\u5E94\r\n .sort((a, b) => {\r\n if (!a.isDir && b.isDir) return 1\r\n if (a.isDir && !b.isDir) return -1\r\n if ((a.isDir && b.isDir) || (!a.isDir && !b.isDir)) return 0\r\n return 0\r\n })\r\n for (let index = 0; index < files.length; index += 1) {\r\n const item = files[index]\r\n //Folder filtering is handled here \u8FD9\u91CC\u5904\u7406\u6587\u4EF6\u5939\u8FC7\u6EE4\r\n const foldFlag = ignore.findIndex((obj: string) => obj === item.name)\r\n if (foldFlag === -1) {\r\n const fullPath = path.join(dir, item.name)\r\n const isDir = fs.lstatSync(fullPath).isDirectory()\r\n if (isDir) {\r\n //recursion \u9012\u5F52\r\n getFileNodes(fullPath, option, (item.children = []), level + 1)\r\n item.fullPath = fullPath.replace(/\\\\/g, '/')\r\n nodes.push(item)\r\n } else {\r\n const i = fullPath.lastIndexOf('.')\r\n const lastName = fullPath.substring(i)\r\n //File filtering is handled here \u8FD9\u91CC\u5904\u7406\u6587\u4EF6\u8FC7\u6EE4\r\n if (include.includes(lastName)) {\r\n const obj = getFile(fullPath)\r\n Object.assign(item, obj)\r\n item.suffix = lastName\r\n item.fullPath = fullPath.replace(/\\\\/g, '/')\r\n nodes.push(item)\r\n }\r\n }\r\n }\r\n }\r\n return nodes\r\n}\r\n\r\n/**\r\n * @description:Recursive file name + note \u9012\u5F52\u5F97\u5230\u6587\u4EF6\u540D+note\r\n * @param {Array} datas\r\n * @param {string} keys\r\n * @return {*}\r\n */\r\nexport function getNote(datas: ItemType[], keys?: string[]) {\r\n const nodes = keys || []\r\n datas.forEach((obj: ItemType, index: Number) => {\r\n const last = index === datas.length - 1\r\n if (obj.children) {\r\n //fold\r\n getNote(obj.children, nodes)\r\n }\r\n const md = setMd(obj, last)\r\n nodes.push(md)\r\n })\r\n return nodes\r\n}\r\n\r\n/**\r\n * @description:One obj generates one line of text \u4E00\u4E2Aobj\u751F\u6210\u4E00\u4E2A\u4E00\u884C\u6587\u5B57\r\n * @param {ItemType} obj\r\n * @param {Boolean} last Is it the last one \u662F\u4E0D\u662F\u6700\u540E\u4E00\u4E2A\r\n * @return {*}\r\n */\r\n function setMd(obj: ItemType, last: Boolean): string {\r\n let filesString = ''\r\n const blank = '\u2502 '.repeat(obj.level) // \u91CD\u590D\u7A7A\u767D\r\n const pre = `${blank}${last ? '\u2514\u2500\u2500' : '\u251C\u2500\u2500'} ${obj.name}`\r\n if (obj.isDir) {\r\n filesString += `${pre}\\n`\r\n } else {\r\n filesString += `${pre} ${obj.note}\\n`\r\n }\r\n return filesString\r\n}\r\n", "/* \u6574\u4E2A\u6587\u4EF6\u4E3B\u8981\u628A\u7EDD\u5BF9\u8DEF\u5F84\u4FEE\u6539\u4E3A\u76F8\u5BF9\u8DEF\u5F84 */\r\nimport { ItemType } from './get-file'\r\nimport fs from 'fs'\r\nimport path from 'path'\r\nimport logger from '../shared/logger'\r\nimport createDebugger from 'debug'\r\nconst debug = createDebugger('change-path')\r\ndebug.enabled = false\r\n/**\r\n * @desc: \u9012\u5F52\u5FAA\u73AF\u6240\u6709\u6587\u4EF6\r\n * @author: majun\r\n * @param {Array} nodes \u6574\u4E2A\u6587\u4EF6\u7684nodes\r\n */\r\nexport async function changePath(nodes: ItemType[]) {\r\n async function getNode(nodes: ItemType[]) {\r\n for (let index = 0; index < nodes.length; index++) {\r\n const ele = nodes[index]\r\n if (ele.children) {\r\n await getNode(ele.children)\r\n } else {\r\n // TODO \u8FD9\u91CC\u5148\u5199\u6B7B\u7EDD\u5BF9\u8F6C\u76F8\u5BF9, \u540E\u9762\u5982\u679C\u60F3\u76F8\u5BF9\u90FD\u8F6C\u7EDD\u5BF9, \u53EF\u4EE5\u6539\u8FD9\u91CC\r\n witeFile(ele, true)\r\n }\r\n }\r\n }\r\n await getNode(nodes)\r\n}\r\n/**\r\n * @desc: \u8FD9\u91CC\u8FD4\u56DE\u6CA1\u6709@ \u7B26\u53F7\u7684\u8DEF\u5F84\r\n * @author: majun\r\n * @param {string} absoluteImport \u4F9D\u8D56\u672C\u8EAB\u540D\u5B57\r\n * @param {string} fullPath \u6587\u4EF6\u672C\u8EAB\u7EDD\u5BF9\u5730\u5740\r\n */\r\nexport function getRelatPath(absoluteImport: string, fullPath: string) {\r\n let relatPath = path.relative(path.dirname(fullPath), absoluteImport) // \u8F6C\u56DE\u76F8\u5BF9\u8DEF\u5F84\r\n relatPath = relatPath.replace(/\\\\/g, '/')\r\n if (relatPath.indexOf('.') !== 0) {\r\n relatPath = './' + relatPath\r\n }\r\n return relatPath\r\n}\r\n\r\n/**\r\n * @desc: \u8865\u540E\u7F00\u7684\u65B9\u6CD5+\u66FF\u6362\u524D\u7F00\r\n * @author: majun\r\n * @param {string} filePath \u6B63\u5219\u5339\u914D\u5230\u7684\u4F9D\u8D56\u8DEF\u5F84\r\n * @param {string} fullPath \u672C\u8EAB\u6587\u4EF6\u540D\u8DEF\u5F84\r\n * @param {string} impName \u6B63\u786E\u7684\u540D\u5B57\r\n */\r\nexport function makeSuffix(filePath: string, fullPath: string) {\r\n let absoluteImport = ''\r\n // \u5982\u679C\u6709@\u7B26\u53F7\u7684\r\n if (filePath.indexOf('@') > -1) {\r\n debug('!!!!!!!!!filePath: ', filePath)\r\n absoluteImport = filePath.replace('@', process.cwd())\r\n } else {\r\n absoluteImport = path.resolve(path.dirname(fullPath), filePath)\r\n }\r\n debug('makeSuffix \u5165\u53C2: absoluteImport', absoluteImport)\r\n const lastName = path.extname(absoluteImport)\r\n debug('lastName', lastName)\r\n // \u5047\u5982\u6CA1\u6709\u540E\u7F00,\u8865\u4E0A\r\n if (!lastName) {\r\n debug('!!!!!!!!!!!\u7F3A\u540E\u7F00\u6587\u4EF6: ', absoluteImport)\r\n // \u83B7\u53D6\u7EDD\u5BF9\u8DEF\u5F84\r\n const suffix = ['.js', '.ts', '.vue', '/index.js', '/index.vue']\r\n for (let j = 0; j < suffix.length; j++) {\r\n const fixStr = suffix[j]\r\n if (fs.existsSync(absoluteImport + fixStr)) {\r\n // \u628A\u6539\u597D\u7684\u66FF\u6362\u56DE\u53BB\r\n debug('\u8865\u5168\u7684\u6587\u4EF6: ', absoluteImport + fixStr)\r\n absoluteImport = absoluteImport + fixStr\r\n break\r\n }\r\n }\r\n }\r\n return absoluteImport.replace(/\\\\/g, '/')\r\n}\r\n\r\n/**\r\n * @desc: \u6839\u636E\u4E00\u884C\u4EE3\u7801\u5339\u914Dimport\u7684\u8BE6\u7EC6\u5185\u5BB9 TODO \u8FD9\u91CC\u8FD8\u5F97\u4F18\u5316\r\n * @author: majun\r\n */\r\nexport function getImportName(ele: string) {\r\n let str=''\r\n // \u6CE8\u91CA\u7684\u4E0D\u8F6C,\u5176\u4ED6\u516C\u5171\u4E5F\u4E0D\u8F6C\r\n const ignore = [\r\n 'xiwicloud',\r\n 'bpmn-js',\r\n 'element-ui',\r\n 'lodash',\r\n 'handsontable',\r\n 'nprogress',\r\n 'quill',\r\n 'qrcodejs2',\r\n 'echarts'\r\n ]\r\n const flag = ignore.some((item) => ele.indexOf(item) > -1)\r\n // const reg = /import.*[\\\"|\\'](.*)[\\'|\\\"]/\r\n const reg = / from [\\\"|\\'](.*)[\\'|\\\"]/\r\n // if (fullPath == 'D:/gitwork/auto-generate-md/unuse/App.vue') {\r\n // debug(!flag, ele.indexOf('/') > -1, \"000000000000000000000000\")\r\n // debug(ele.match(reg), '11111111111111')\r\n // }\r\n // \u8FD9\u91CC\u53EA\u6536\u96C6\u7EC4\u4EF6\u4F9D\u8D56, \u63D2\u4EF6\u4F9D\u8D56\u6392\u9664\u6389\r\n if (!flag && ele.indexOf('/') > -1 && ele.indexOf('//') !== 0) {\r\n const impStr = ele.match(reg);\r\n // \u6CA1\u6709import\u7684\u4E0D\u8F6C\r\n if (impStr && impStr[1]) str = impStr[1];\r\n }\r\n return str\r\n}\r\n\r\n/**\r\n * @desc: \u627E\u5230import\u5E76\u8FD4\u56DE\u5168\u8DEF\u5F84\u548C\u539F\u59CB\u8DEF\u5F84\r\n * @author: majun\r\n * @param {string} ele \u627E\u5230\u7684\u884C\u5F15\u5165\r\n * @param {string} fullPath \u6587\u4EF6\u7684\u5168\u8DEF\u5F84\r\n */\r\nexport function changeImport(ele: string, fullPath: string) {\r\n let obj = {\r\n impName: '',\r\n filePath: '',\r\n absoluteImport:''\r\n }\r\n const impName = getImportName(ele)\r\n if (impName) {\r\n // \u4F9D\u8D56\u7684\u5177\u4F53\u540D\u5B57\r\n obj.filePath = impName\r\n debug('!!!!!!!!!\u5339\u914Dimp: ', impName)\r\n // \u5148\u8865\u540E\u7F00\r\n obj.absoluteImport = makeSuffix(obj.filePath, fullPath)\r\n debug('\u8865\u8FC7\u540E', obj.absoluteImport)\r\n // \u540E\u6539\u76F8\u5BF9\u8DEF\u5F84\r\n obj.impName = getRelatPath(obj.absoluteImport, fullPath)\r\n debug('\u76F8\u5BF9\u8DEF\u5F84: ', obj.impName)\r\n }\r\n return obj\r\n}\r\n/**\r\n * @desc: \u5199\u6587\u4EF6\r\n * @author: majun\r\n\r\n * @param {string} file \u76EE\u6807\u5730\u5740\r\n */\r\nexport function witeFile(node: ItemType, isRelative?: Boolean) {\r\n const { fullPath} = node\r\n try {\r\n let writeFlag = false // \u5982\u679C\u5565\u90FD\u6CA1\u6539, \u4E0D\u66F4\u65B0\u6587\u4EF6\r\n let fileStr = fs.readFileSync(fullPath, 'utf-8')\r\n const sarr = fileStr.split(/[\\n]/g)\r\n for (let index = 0; index < sarr.length; index++) {\r\n const ele = sarr[index]\r\n if (ele.indexOf('from') > -1 && isRelative) {\r\n const obj = changeImport(ele, fullPath)\r\n // if (node.name === '***') {\r\n // debug(obj,\"bbbnnn\")\r\n // }\r\n if (obj.impName) {\r\n sarr[index] = ele.replace(obj.filePath, obj.impName)\r\n debug('node: ', node)\r\n writeFlag = true\r\n }\r\n }\r\n }\r\n if (writeFlag) {\r\n fileStr = sarr.join('\\n')\r\n // \u5F02\u6B65\u5199\u5165\u6570\u636E\u5230\u6587\u4EF6\r\n fs.writeFileSync(fullPath, fileStr, { encoding: 'utf8' })\r\n logger.success(`Write file successful: ${fullPath}`)\r\n }\r\n } catch (error) {\r\n logger.error(`\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25,\u6587\u4EF6\u540D: ${fullPath} `)\r\n }\r\n}\r\n\r\n/**\r\n * @description: Write the result to JS file \u628A\u7ED3\u679C\u5199\u5165\u5230js\u6587\u4EF6\r\n * @param {data} \u8981\u5199\u7684\u6570\u636E\r\n * @return {fileName} \u8981\u5199\u5165\u6587\u4EF6\u5730\u5740\r\n */\r\nexport function wirteJsNodes(data: string, filePath: string) {\r\n const file = path.resolve(process.cwd(), filePath)\r\n const pre = 'export default'\r\n // \u5F02\u6B65\u5199\u5165\u6570\u636E\u5230\u6587\u4EF6\r\n fs.writeFileSync(file, pre + data, { encoding: 'utf8' })\r\n logger.success(`Write file successful: ${filePath}`)\r\n}\r\n", null, "/* \u6253\u4E2A\u6F02\u4EAE\u65E5\u5FD7 */\r\nimport { lightBlue, lightGreen, lightRed, lightYellow } from 'kolorist';\r\n\r\nconst logger = {\r\n info(text: string) {\r\n console.log(lightBlue(`\u2708 - ${text}`));\r\n },\r\n success(text: string) {\r\n console.log(lightGreen(`\u2714 - ${text}`));\r\n },\r\n warn(text: string) {\r\n console.log(lightYellow(`\u25B6 - ${text}`));\r\n },\r\n error(text: string) {\r\n console.log(lightRed(`\u2716 - ${text}`));\r\n }\r\n};\r\n\r\nexport default logger;\r\n", "/* \u7ED9\u8DEF\u7531\u6587\u4EF6\u6253\u6807\u8BB0, \u628A\u6807\u8BB0\u6253\u5230\u6700\u540E,\u56E0\u4E3A\u5934\u90E8\u5DF2\u7ECF\u7ED9\u4E86\u6CE8\u91CA */\r\nimport fs from 'fs-extra'\r\nimport { ItemType } from './get-file'\r\nimport createDebugger from 'debug'\r\nimport path from 'path'\r\nimport logger from '../shared/logger'\r\nimport { getImportName } from './change-path'\r\nconst debug = createDebugger('rename-path')\r\ndebug.enabled = false\r\n\r\n/**\r\n * \u5C06\u5355\u4E2A\u5B57\u7B26\u4E32\u7684\u9996\u5B57\u6BCD\u5C0F\u5199\r\n * @param str \u5B57\u7B26\u4E32\r\n */\r\nfunction fistLetterLower(str: string | String) {\r\n return str.charAt(0).toLowerCase() + str.slice(1)\r\n}\r\n\r\nexport function toKebabCase(str: string) {\r\n const regex = /[A-Z]/g\r\n return fistLetterLower(str).replace(regex, (word: string) => {\r\n return '-' + word.toLowerCase()\r\n })\r\n}\r\n/**\r\n * \u68C0\u6D4B\u9A7C\u5CF0\u6587\u4EF6\u540D\r\n * @param fileName \u6587\u4EF6\u540D\r\n */\r\nexport function checkCamelFile(fileName: string) {\r\n return /([a-z])([A-Z])/.test(fileName) || /([A-Z])/.test(fileName)\r\n}\r\n\r\n/**\r\n * @desc: \u5FAA\u73AFnode, \u6539\u6587\u4EF6\u5939, \u5E76\u628Aimport \u91CC\u9762\u4E0D\u5408\u683C\u7684\u547D\u540D\u6539\u5408\u683C\r\n * @author: majun\r\n */\r\nexport async function renameFoldPath(nodes: ItemType[]) {\r\n async function getNode(cpNodes: ItemType[]) {\r\n for (let index = 0; index < cpNodes.length; index++) {\r\n const ele = cpNodes[index]\r\n await renameFold(ele) // \u4E0B\u9762\u5DF2\u9012\u5F52\r\n if (ele.children) {\r\n // \u9012\u5F52\r\n await getNode(ele.children)\r\n }\r\n }\r\n }\r\n await getNode(nodes)\r\n}\r\n\r\n/**\r\n * @desc: \u5FAA\u73AFnode, \u6539\u6587\u4EF6, \u6539\u4F9D\u8D56, \u601D\u8DEF:\u5FAA\u73AF\u6BCF\u4E2A\u6587\u4EF6, \u5E76\u628Aimport \u91CC\u9762\u4E0D\u5408\u683C\u7684\u547D\u540D\u6539\u5408\u683C\r\n * @author: majun\r\n */\r\nexport async function renameFilePath(nodes: ItemType[]) {\r\n async function getNode(cpNodes: ItemType[]) {\r\n for (let index = 0; index < cpNodes.length; index++) {\r\n const ele = cpNodes[index]\r\n if (ele.children) {\r\n // \u9012\u5F52\r\n await getNode(ele.children)\r\n } else {\r\n // \u91CD\u547D\u540D\u6587\u4EF6\r\n await renameFile(ele)\r\n // \u91CD\u5199\u6587\u4EF6\u7684import\r\n await rewriteFile(ele)\r\n }\r\n }\r\n }\r\n await getNode(nodes)\r\n}\r\n\r\n async function rewriteFile(node: ItemType) {\r\n let writeFlag = false\r\n const str = fs.readFileSync(node.fullPath, 'utf-8')\r\n const sarr = str.split(/[\\n]/g)\r\n for (let index = 0; index < sarr.length; index++) {\r\n const ele = sarr[index]\r\n if (ele.indexOf('from') > -1) {\r\n let impOldName = getImportName(ele)\r\n if (checkCamelFile(impOldName)) {\r\n // \u53D6\u6587\u4EF6\u540D,\u5426\u5219\u8F6Ccase\u4F1A\u51FA\u9519\r\n let name = path.parse(impOldName).name\r\n const newName = toKebabCase(name)\r\n // \u8FD9\u91CC\u66FF\u6362\u6709\u53EF\u80FD\u628A\u5934\u4E5F\u66FF\u6362\u4E86, \u6240\u4EE5\u5207\u4E00\u4E0B\r\n //\u6BD4\u5982 import moduleName from 'moduleName' \u4F1A\u53EA\u66FF\u6362\u524D\u4E00\u4E2A \"import moduleName from 'moduleName'\".split('from')\r\n const str = ele.split('from')\r\n sarr[index] = `${str[0]}from${str[1].replace(name, newName)}`\r\n writeFlag = true\r\n }\r\n }\r\n }\r\n if (writeFlag) {\r\n let fileStr = sarr.join('\\n')\r\n try {\r\n // \u5F02\u6B65\u5199\u5165\u6570\u636E\u5230\u6587\u4EF6\r\n await fs.writeFile(node.fullPath, fileStr, { encoding: 'utf8' })\r\n logger.success(`rewriteFile successful-------: ${node.fullPath}` )\r\n } catch (error) {\r\n logger.error(`\u5199\u5165\u6587\u4EF6\u5931\u8D25,\u5730\u5740\u4E0D\u5B58\u5728: ${node.fullPath}`)\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u91CD\u547D\u540D\u6587\u4EF6\u5939\r\n * @author: majun\r\n * @param {ItemType} node\r\n */\r\nexport async function renameFold(node: ItemType) {\r\n let filename = path.parse(node.fullPath).base\r\n debug('filename111: ', filename)\r\n const filter = ['FMEA', 'DVP'] // \u628A\u8FD9\u6837\u5B50\u7684\u6587\u4EF6\u5939\u8FC7\u6EE4\r\n const falg = filter.some((item) => filename.indexOf(item) > -1)\r\n if (!falg && checkCamelFile(filename)) {\r\n // \u8FD9\u91CC\u53EA\u5904\u7406\u6587\u4EF6\u5939\r\n if (node.isDir) {\r\n const obj = await replaceName(node.fullPath)\r\n // \u8FD9\u91CC\u4E00\u5B9A\u8981\u66F4\u65B0node,\u5426\u5219\u540E\u9762\u627E\u4E0D\u5230\u8DEF\u5F84\r\n changePathFold(node, obj)\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u91CD\u547D\u540D\u540E, \u5B50\u6587\u4EF6\u90FD\u4F1A\u5B58\u5728\u8DEF\u5F84\u7684\u66F4\u6539,\u4E5F\u5C31\u8981\u9012\u5F52\u5904\u7406(\u65E2\u53EF\u4EE5\u5904\u7406\u6587\u4EF6\u5939, \u4E5F\u53EF\u4EE5\u5904\u7406\u6587\u4EF6)\r\n * @author: majun\r\n */\r\nexport function changePathFold(node: ItemType, obj: { newName: string; filename: string }) {\r\n const { newName, filename } = obj\r\n if (node.children) {\r\n for (let index = 0; index < node.children.length; index++) {\r\n const ele = node.children[index]\r\n // \u9012\u5F52\u5904\u7406\r\n changePathFold(ele, obj)\r\n }\r\n }\r\n node.fullPath = node.fullPath.replace(filename, newName)\r\n debug(node.fullPath, newName)\r\n node.name = node.name.replace(filename, newName)\r\n}\r\n/**\r\n * @desc: \u9012\u5F52\u6539\u6240\u6709\u8DEF\u5F84\u540D\u5B57\r\n * @author: majun\r\n * @param {ItemType} node\r\n * @param {object} obj\r\n */\r\nexport function changePathName(node: ItemType, obj: { newName: string; filename: string }) {\r\n const { newName, filename } = obj\r\n if (node.fullPath.indexOf(filename) > -1) {\r\n if (node.imports.length > 0) {\r\n // import\u4E5F\u8981\u53D8\u5316, \u5426\u5219\u4E5F\u4F1A\u627E\u4E0D\u5230\u8DEF\u5F84\r\n const array = node.imports\r\n for (let j = 0; j < array.length; j++) {\r\n const ele = array[j]\r\n debug('import-ele: ', ele)\r\n array[j] = toKebabCase(ele)\r\n debug('\u66F4\u6362import: ', array[j])\r\n }\r\n }\r\n node.fullPath = node.fullPath.replace(filename, newName)\r\n node.name = node.name.replace(filename, newName)\r\n debug('\u66FF\u6362\u540E\u7684 node.fullPath:', node.fullPath)\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u91CD\u547D\u540D\u6587\u4EF6\r\n * @author: majun\r\n * @param {ItemType} node\r\n */\r\nexport async function renameFile(node: ItemType) {\r\n let filename = path.parse(node.fullPath).base\r\n if (checkCamelFile(filename)) {\r\n const suffix = ['.js', '.vue'] // \u8FD9\u91CC\u53EA\u91CD\u547D\u540Djs\u548Cvue\u6587\u4EF6\r\n const lastName = path.extname(node.fullPath)\r\n let flag = suffix.some((item) => lastName === item)\r\n if (flag) {\r\n const obj = await replaceName(node.fullPath)\r\n // \u8FD9\u91CC\u4E00\u5B9A\u8981\u66F4\u65B0node,\u5426\u5219\u540E\u9762\u627E\u4E0D\u5230\u8DEF\u5F84\r\n changePathName(node, obj)\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * \u91CD\u547D\u540D\u6587\u4EF6\u5939 CamelCase || PascalCase => kebab-case\r\n * @param node \u8282\u70B9\r\n */\r\nexport async function replaceName(fullPath: string) {\r\n let filename = path.parse(fullPath).base\r\n const newName = toKebabCase(filename)\r\n debug('newName: ', newName)\r\n debug('filename: ', filename)\r\n const oldPath = fullPath\r\n const newPath = oldPath.replace(filename, newName)\r\n // rename\u4E4B\u524D\u8981\u5224\u65AD\u4E00\u4E0B,\u5047\u5982\u5DF2\u7ECF\u6709\u4E86,\u90A3\u4E48\u76F4\u63A5\u62F7\u8D1D\u8FC7\u53BB,\u5E76\u4E14\u5220\u9664\u539F\u6765\u7684\r\n const lastName = path.extname(newPath)\r\n if (!lastName) {\r\n // \u6587\u4EF6\u5939, \u7279\u6B8A\u5904\u7406,\u8981copy\u6587\u4EF6\r\n if (fs.existsSync(newPath)) {\r\n // debug('newPath: ', newPath)\r\n await fs.copy(fullPath, newPath)\r\n fs.removeSync(fullPath) // \u5220\u9664\u76EE\u5F55\r\n return { newName, filename }\r\n }\r\n }\r\n debug(oldPath, newPath, 'oldPath, newPath')\r\n try {\r\n const flag = fs.existsSync(oldPath)\r\n if (flag) {\r\n console.log(oldPath, '\u6539\u540D\u4E3A: ', newPath ,\"\u6210\u529F\")\r\n await fs.rename(oldPath, newPath)\r\n } else {\r\n logger.error(`\u6587\u4EF6${oldPath}\u4E0D\u5B58\u5728\u91CD\u547D\u540D\u5E72\u561B?`)\r\n }\r\n logger.info(filename + ' is reneme done')\r\n return { newName, filename }\r\n } catch (error) {\r\n throw error\r\n }\r\n}\r\n", "import arg from 'arg'\r\nconst stringToArgs = (rawArgs: string[]) => {\r\n const args = arg(\r\n {\r\n '--ignore': String,\r\n '--include': String,\r\n '--version': Boolean,\r\n '--help': Boolean,\r\n '-h': '--help',\r\n '-i': '--ignore',\r\n '-in': '--include',\r\n '-v': '--version'\r\n },\r\n {\r\n argv: rawArgs.slice(2)\r\n }\r\n )\r\n return {\r\n help: args['--help'],\r\n ignore: args['--ignore'],\r\n include: args['--include'],\r\n version: args['--version']\r\n }\r\n}\r\n\r\nexport default stringToArgs\r\n", "const st = `Usage: agmd--include str--ignore str\r\n\r\n Options:\r\n --include string / -i string.......... include file extension\r\n --ignore string / -in string........... ignore file or fold\r\n --version / -v ........... seach vesion\r\n Str deafult:\r\n --ignore img,styles,node_modules,LICENSE,.git,.github,dist,.husky,.vscode,readme-file.js,readme-md.js\r\n --include .js,.vue,.ts\r\n\r\n Note:\r\n There should be no space between strings in a configuration\r\n\r\n Examples:\r\n $ agmd --ignore lib,node_modules,dist --include .js,.ts,.vue`\r\n\r\nfunction help() {\r\n console.log(st)\r\n process.exit(0)\r\n}\r\nexport default help\r\n", "import help from '../help'\r\nimport pkg from '../../package.json'\r\ninterface parseType {\r\n version?: Boolean | undefined\r\n includes?: string[]\r\n ignores?: string[]\r\n help: Boolean | undefined\r\n ignore: string | undefined\r\n include: string | undefined\r\n}\r\nfunction handle(settings: parseType) {\r\n if (settings.help) {\r\n help()\r\n }\r\n if (settings.version) {\r\n console.log(`agmd version is: ` + '\\x1B[36m%s\\x1B[0m', pkg.version)\r\n process.exit(0)\r\n }\r\n if (settings.ignore) {\r\n settings.ignores = settings.ignore.split(' ')\r\n }\r\n if (settings.include) {\r\n settings.includes = settings.include.split(' ')\r\n }\r\n return settings\r\n}\r\n\r\nexport default handle\r\n", "/* \u7ED9\u8DEF\u7531\u6587\u4EF6\u6253\u6807\u8BB0, \u628A\u6807\u8BB0\u6253\u5230\u6700\u540E,\u56E0\u4E3A\u5934\u90E8\u5DF2\u7ECF\u7ED9\u4E86\u6CE8\u91CA */\r\nimport fs from 'fs'\r\nimport { ItemType } from './get-file'\r\nimport { markWriteFile } from './mark-write-file'\r\nimport createDebugger from 'debug'\r\nimport logger from '../shared/logger'\r\nconst debug = createDebugger('mark-file')\r\nconst rootPath = process.cwd().replace(/\\\\/g, '/')\r\ndebug.enabled = false\r\ntype classifyType = [\r\n {\r\n name: string\r\n router: [\r\n {\r\n path: string\r\n name: string\r\n // \u8DEF\u7531\u5FC5\u987B\u90FD\u662F\u7EDD\u5BF9\u8DEF\u5F84\r\n component: string\r\n }\r\n ]\r\n }\r\n]\r\n/**\r\n * @desc: \u6807\u8BB0\u6587\u4EF6\u4E3B\u7A0B\u5E8F\r\n * @author: majun\r\n * @param {ItemType} nodes\r\n * @param {string} rootPath\r\n */\r\nexport async function markFile(nodes: ItemType[], routers: classifyType) {\r\n for (let i = 0; i < routers.length; i++) {\r\n const ele = routers[i]\r\n for (let j = 0; j < ele.router.length; j++) {\r\n const obj = ele.router[j]\r\n const pathN = obj.component\r\n // \u8DEF\u5F84\u8F6C\u7EDD\u5BF9\u8DEF\u5F84\r\n let absolutePath = pathN.replace('@', rootPath)\r\n // \u9012\u5F52\u6253\u4E0A\u5B50\u96C6\u6240\u6709\r\n await setNodeMark(nodes, ele.name, absolutePath)\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u6807\u8BB0\u6587\u4EF6\u4E3B\u7A0B\u5E8F\r\n * @author: majun\r\n * @param {ItemType} nodes\r\n * @param {string} rootPath\r\n */\r\nexport function witeFile(nodes: ItemType[], routers: classifyType) {\r\n routers.forEach( (ele) => {\r\n // \u8FD9\u91CC\u5FAA\u73AF\u6253\u6807\u8BB0\u7684\u8DEF\u7531\r\n ele.router.forEach(async (obj: { component: any }) => {\r\n const pathN = obj.component\r\n // \u8DEF\u5F84\u8F6C\u7EDD\u5BF9\u8DEF\u5F84\r\n let absolutePath = pathN.replace('@', rootPath)\r\n // \u5BF9\u6253\u4E0A\u6807\u8BB0\u7684\u6587\u4EF6\u8FDB\u884C\u5206\u7C7B\u5199\u5165\r\n await markWriteFile(nodes, ele.name, absolutePath)\r\n })\r\n })\r\n}\r\n\r\n/**\r\n * @desc: \u5206\u79BB\u4E00\u4E2A\u9012\u5F52\u8C03\u7528\u7684mark\u51FD\u6570\r\n * @author: majun\r\n */\r\nexport async function setNodeMark(nodes: ItemType[], name: string, path: string) {\r\n debug('setNodeMark\u5165\u53C2: ', name, path)\r\n // \u901A\u8FC7\u6587\u4EF6\u5730\u5740, \u627E\u5230nodes\u7684\u4F9D\u8D56\u5730\u5740, \u628A\u4F9D\u8D56\u6587\u4EF6\u4E5F\u6253\u6807\u8BB0\r\n const node = findNodes(nodes, path)\r\n if (node) {\r\n // \u6253\u6807\u8BB0\r\n setmark(path, name)\r\n }\r\n // debug('\u67E5\u627E\u7684node: ', node)\r\n if (node && node.imports) {\r\n // \u6807\u8BB0\u5F52\u5C5E\u8BBE\u7F6E\r\n if (node.belongTo.indexOf(name)>-1) return // \u5DF2\u7ECF\u5206\u6790\u8FC7\u8BE5\u6587\u4EF6\u4E86, \u5C31\u4E0D\u518D\u5206\u6790,\u5426\u5219\u4F1A\u6B7B\u5FAA\u73AF\r\n node.belongTo.push(name)\r\n // \u627E\u5230\u6709\u5B50\u6587\u4EF6\u4E86,\u5FAA\u73AF\u5B83\r\n for (let index = 0; index < node.imports.length; index++) {\r\n const element = node.imports[index]\r\n debug('\u4F9D\u8D56\u6587\u4EF6: ', element)\r\n // \u5982\u679C\u6587\u4EF6\u5B58\u5728\r\n if (fs.existsSync(path)) {\r\n // \u7EE7\u7EED\u9012\u5F52,\u76F4\u5230\u5B50\u6587\u4EF6\u6CA1\u6709\u5B50\u6587\u4EF6\r\n await setNodeMark(nodes, name, element)\r\n } else {\r\n logger.error(`\u6587\u4EF6\u4E0D\u5B58\u5728: ${path}`)\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u9012\u5F52\u901A\u8FC7\u6587\u4EF6\u5168\u540D\u627E\u8282\u70B9\r\n * @author: majun\r\n * @param {*} nodes\r\n * @param {*} path\r\n */\r\nexport function findNodes(nodes: ItemType[], path: string): ItemType | null {\r\n let node = null\r\n function find(nodes: ItemType[]) {\r\n for (let index = 0; index < nodes.length; index++) {\r\n const element = nodes[index]\r\n if (element.children) find(element.children)\r\n if (element.fullPath === path) node = element\r\n }\r\n }\r\n find(nodes)\r\n return node\r\n}\r\n\r\n/**\r\n * @desc: \u7ED9\u6587\u4EF6\u6807\u8BB0\r\n * @author: majun\r\n * @param {string} file\r\n * @param {string} name\r\n */\r\n function setmark(file: string, name: string) {\r\n try {\r\n let fileStr = fs.readFileSync(file, 'utf-8')\r\n if (fileStr.indexOf('//' + name + '\\n') === 0) {\r\n // \u6253\u8FC7\u6807\u8BB0\u4E86,\u5C31\u4E0D\u6253\u4E86\r\n return\r\n }\r\n // \u76F4\u63A5\u6253\u4E0A\u6807\u8BB0\r\n fileStr = '//' + name + '\\n' + fileStr\r\n fs.writeFileSync(file, fileStr)\r\n logger.info(`mark successful-------: ${file}`)\r\n } catch (error) {\r\n logger.error(`\u7ED9\u6587\u4EF6\u6253\u6807\u8BB0\u7684\u6587\u4EF6\u4E0D\u5B58\u5728: ${file}`)\r\n return\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u9012\u5F52\u6240\u6709\u6587\u4EF6\r\n * @author: majun\r\n * @param {Array} nodes\r\n */\r\nexport function deletMarkAll(nodes: ItemType[], name: string) {\r\n function find(nodes: ItemType[]) {\r\n for (let index = 0; index < nodes.length; index++) {\r\n const element = nodes[index]\r\n if (element.children) find(element.children)\r\n else deletMark(element.fullPath, name)\r\n }\r\n }\r\n find(nodes)\r\n}\r\n\r\n/**\r\n * @desc: \u7ED9\u6587\u4EF6\u6807\u8BB0\r\n * @author: majun\r\n * @param {string} file\r\n * @param {string} name\r\n */\r\nexport function deletMark(file: string, name: string) {\r\n let fileStr=''\r\n try {\r\n fileStr = fs.readFileSync(file, 'utf-8')\r\n let sarr = fileStr.split(/[\\n]/g)\r\n for (let index = 0; index < sarr.length; index++) {\r\n const ele = sarr[index]\r\n if (ele.indexOf('//' + name) > -1) {\r\n sarr.splice(index, 1)\r\n index-- //i\u9700\u8981\u81EA\u51CF\uFF0C\u5426\u5219\u6BCF\u6B21\u5220\u9664\u90FD\u4F1A\u8BB2\u539F\u6570\u7EC4\u7D22\u5F15\u53D1\u751F\u53D8\u5316\r\n }\r\n }\r\n fileStr = sarr.join('\\n')\r\n fs.writeFileSync(file, fileStr, { encoding: 'utf8' })\r\n debug('delete mark successful-------' + file)\r\n return fileStr\r\n } catch (error) {\r\n console.error('\u5220\u9664\u6807\u8BB0\u7684\u6587\u4EF6\u4E0D\u5B58\u5728: ', file)\r\n }\r\n return ''\r\n}\r\n", "/* \u5BF9\u6253\u4E0A\u6807\u8BB0\u7684\u6587\u4EF6\u8FDB\u884C\u5206\u7C7B\u5199\u5165, \u5206\u6B65\u9AA4\u5199\u65B9\u6CD5, \u867D\u7136\u5BF9\u4E8E\u6027\u80FD\u6709\u5F71\u54CD, \u4F46\u4E00\u70B9\u70B9\u7B97\u4EC0\u4E48, \u80FD\u591F\u5206\u6B65\u9AA4\u8C03\u8BD5\u6700\u597D, \u4E0D\u8981\u8FD9\u4E2A\u6B65\u9AA4, \u76F4\u63A5\u6CE8\u91CA\u6389\u8FD9\u4E2A\u65B9\u6CD5\u5C31\u884C */\r\nimport createDebugger from 'debug'\r\nimport { findNodes } from './mark-file'\r\nimport { ItemType } from './get-file'\r\nimport fs from 'fs-extra'\r\nimport logger from '../shared/logger'\r\nconst rootPath = process.cwd().replace(/\\\\/g, '/')\r\nconst debug = createDebugger('mark-write-file')\r\ndebug.enabled = false\r\n/**\r\n * @desc: \u9012\u5F52\u6587\u4EF6\u5B50\u4F9D\u8D56\u521B\u5EFA\u6587\u4EF6- \u6587\u4EF6\u5916\u9012\u5F52\r\n * @author: majun\r\n * @param {ItemType} nodes\r\n * @param {string} name\r\n * @param {string} path \u7EDD\u5BF9\u8DEF\u5F84\r\n * @param {string} rootPath \u786E\u5B9A\u54EA\u4E00\u7EA7\u5F00\u59CB\u521B\u5EFA\u6587\u4EF6\u5939\r\n */\r\nexport async function markWriteFile(nodes: ItemType[], name: string, path: string) {\r\n // debug('\u5165\u53C2: ', name, path)\r\n // \u901A\u8FC7\u6587\u4EF6\u5730\u5740, \u627E\u5230nodes\u7684\u4F9D\u8D56\u5730\u5740, \u628A\u4F9D\u8D56\u6587\u4EF6\u4E5F\u6253\u6807\u8BB0\r\n const node = findNodes(nodes, path)\r\n // debug('\u67E5\u627E\u7684node: ', node)\r\n if (node) {\r\n if (node.copyed) return // \u5982\u679C\u8FD9\u4E2A\u6587\u4EF6\u5DF2\u7ECF\u88AB\u5206\u6790\u8FC7\u4E86,\u90A3\u4E48\u8DF3\u8FC7, \u5426\u5219\u4F1A\u65E0\u9650\u5206\u6790\r\n node.copyed = true\r\n // \u5F97\u5230\u6807\u8BB0\r\n const belongTo = node.belongTo\r\n if (belongTo.length > 0) {\r\n await setDispFileNew(path, name)\r\n }\r\n if (node.imports) {\r\n // \u627E\u5230\u6709\u5B50\u6587\u4EF6\u4E86,\u5FAA\u73AF\u5B83\r\n for (let index = 0; index < node.imports.length; index++) {\r\n const element = node.imports[index]\r\n // debug('\u4F9D\u8D56\u6587\u4EF6: ', element)\r\n // \u5982\u679C\u6587\u4EF6\u5B58\u5728\r\n if (fs.existsSync(path)) {\r\n // \u7EE7\u7EED\u9012\u5F52,\u76F4\u5230\u5B50\u6587\u4EF6\u6CA1\u6709\u5B50\u6587\u4EF6\r\n await markWriteFile(nodes, name, element)\r\n } else {\r\n logger.error( `${path}\u6587\u4EF6\u4E0D\u5B58\u5728`, )\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u529F\u80FD\u5C31\u662F\u627E\u5230\u6587\u4EF6\u7136\u540Ecopy\u6587\u4EF6,\r\n * @author: majun\r\n * @param {string} pathN\r\n * @param {string} name\r\n * @param {string} rootPath\r\n */\r\nexport async function setDispFileNew(pathN: string, name: string) {\r\n const relative = pathN.replace(rootPath, '')\r\n const originPath = pathN\r\n const writeFileName = rootPath + '/' + name + relative\r\n try {\r\n if (fs.existsSync(writeFileName)) return // \u5982\u679C\u6587\u4EF6\u90FD\u5B58\u5728\u90A3\u7B97\u4E86\r\n await fs.copy(originPath, writeFileName)\r\n debug('\u5199\u5165\u6587\u4EF6success! : ', writeFileName)\r\n } catch (err) {\r\n console.error(err)\r\n }\r\n}\r\n", "import fs from 'fs'\r\nimport createDebugger from 'debug'\r\nimport logger from '../shared/logger'\r\nconst debug = createDebugger('get-file')\r\ndebug.enabled = false\r\nconst rootPath = process.cwd().replace(/\\\\/g, '/')\r\n/**\r\n * @desc: \u5F97\u5230\u8DEF\u7531\r\n * @author: majun\r\n */\r\nexport function getRouter() {\r\n const routerPath = rootPath + '/router/index.js';\r\n let routers = []\r\n let path=''\r\n if (fs.existsSync(routerPath)) {\r\n const str = fs.readFileSync(routerPath, 'utf-8')\r\n const sarrs = str.split(/[\\n]/g)\r\n for (let index = 0; index < sarrs.length; index++) {\r\n const st = sarrs[index]\r\n if (st.indexOf('//') > -1) continue // \u6253\u4E86\u6CE8\u91CA\u7684\u4E0D\u8981\r\n // path: '/form/base-form' \u5339\u914D\u8FD9\u6837\u5B50\u7684path\r\n const pathReg = /path: (.*),/\r\n const pathStrs = st.match(pathReg)\r\n if (pathStrs) {\r\n path = pathStrs[1]\r\n }\r\n // \u7528\u6B63\u5219\u5339\u914D\u51FA\u6240\u6709 component: () => import( )\u4E2D\u7684\u7EC4\u4EF6\r\n const reg = /component: \\(\\) => import\\((.*)\\)/\r\n const impStr = st.match(reg)\r\n if (impStr) {\r\n routers.push({\r\n path,\r\n component: impStr[1]\r\n })\r\n debug(impStr[1])\r\n }\r\n }\r\n }\r\n return routers\r\n}\r\n\r\n/**\r\n * @desc: \u83B7\u53D6\u8981\u64CD\u4F5C\u7684\u8DEF\u7531\r\n * @author: majun\r\n */\r\nexport function getRouterArrs() {\r\n let pathName = rootPath + '/classify.js'\r\n let routers = null\r\n if (fs.existsSync(pathName)) {\r\n routers = require(pathName)\r\n } else {\r\n // \u5982\u679C\u6CA1\u6709classify,\u90A3\u4E48\u76F4\u63A5\u627E\u8DEF\u7531\r\n routers = [{\r\n name: 'plan',\r\n router: getRouter()\r\n }]\r\n }\r\n if (!routers) {\r\n logger.error('\u8DDF\u8DEF\u5F84\u6CA1\u53D1\u73B0\u6709classify.js,\u5E76\u4E14src\u91CC\u9762\u6CA1\u6709router\u6587\u4EF6, \u73B0\u5728\u9000\u51FA')\r\n process.exit(1)\r\n }\r\n return routers\r\n}\r\n"],
5
- "mappings": ";quBAAA,cAMA,oBAA6B,MAAM,CAQjC,YAAY,EAAU,EAAM,EAAS,CACnC,MAAM,CAAO,EAEb,MAAM,kBAAkB,KAAM,KAAK,WAAW,EAC9C,KAAK,KAAO,KAAK,YAAY,KAC7B,KAAK,KAAO,EACZ,KAAK,SAAW,EAChB,KAAK,YAAc,MACrB,CACF,EAMA,gBAAmC,GAAe,CAMhD,YAAY,EAAS,CACnB,MAAM,EAAG,4BAA6B,CAAO,EAE7C,MAAM,kBAAkB,KAAM,KAAK,WAAW,EAC9C,KAAK,KAAO,KAAK,YAAY,IAC/B,C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K,CACpC,CAAC,EACD,EAAU,IAAI,sBAAuB,CACnC,MAAO,sBACP,MAAO,sBACP,OAAQ,IAAM,GAAiB,CAAK,CACtC,CAAC,EACD,EAAU,IAAI,sBAAuB,CACnC,MAAO,sBACP,MAAO,sBACP,OAAQ,IAAM,GAAiB,CAAK,CACtC,CAAC,EAGD,EAAU,IAAI,mBAAoB,CAChC,MAAO,mBACP,MAAO,mBACP,OAAQ,IAAM,GAAa,KAAK,UAAU,CAAK,EAAG,GAAW,iBAAiB,CAChF,CAAC,EACD,EAAU,IAAI,4CAA6C,CACzD,MAAO,4CACP,MAAO,4CACP,OAAQ,IAAM,GAAmB,CAAK,CACxC,CAAC,EACM,CACT,CAOA,YAAyC,EAAc,gCACrD,AAAI,EAAI,KAGR,GAAc,CAChB,GAMA,aAA+B,gCAC7B,GAAM,GAAU,GAAW,EACvB,EAAc,CAAC,EACnB,GAAI,CACF,EAAS,KAAM,eACb,CACE,CACE,KAAM,UACN,KAAM,SACN,QAAS,2BACT,QAAS,MAAM,KAAK,EAAQ,OAAO,CAAC,CACtC,CACF,EACA,CACE,SAAU,IAAM,CACd,KAAM,IAAI,OAAM,sBAAsB,CACxC,CACF,CACF,CACF,OAAS,EAAP,CACA,EAAO,MAAM,EAAE,OAAO,EACtB,QAAQ,KAAK,CAAC,CAChB,CACA,EAAQ,IAAI,EAAO,OAAO,EAAG,OAAO,CACtC,GD3NA,GAAM,IAAU,GAAI,YACpB,GAAQ,OAAO,EAAU,EACzB,GAAQ,MAAM,QAAQ,IAAI",
3
+ "sources": ["../node_modules/_commander@8.3.0@commander/lib/error.js", "../node_modules/_commander@8.3.0@commander/lib/argument.js", "../node_modules/_commander@8.3.0@commander/lib/help.js", "../node_modules/_commander@8.3.0@commander/lib/option.js", "../node_modules/_commander@8.3.0@commander/lib/suggestSimilar.js", "../node_modules/_commander@8.3.0@commander/lib/command.js", "../node_modules/_commander@8.3.0@commander/index.js", "../node_modules/_kleur@3.0.3@kleur/index.js", "../node_modules/_prompts@2.4.2@prompts/dist/util/action.js", "../node_modules/_prompts@2.4.2@prompts/dist/util/strip.js", "../node_modules/_sisteransi@1.0.5@sisteransi/src/index.js", "../node_modules/_prompts@2.4.2@prompts/dist/util/clear.js", "../node_modules/_prompts@2.4.2@prompts/dist/util/figures.js", "../node_modules/_prompts@2.4.2@prompts/dist/util/style.js", "../node_modules/_prompts@2.4.2@prompts/dist/util/lines.js", "../node_modules/_prompts@2.4.2@prompts/dist/util/wrap.js", "../node_modules/_prompts@2.4.2@prompts/dist/util/entriesToDisplay.js", "../node_modules/_prompts@2.4.2@prompts/dist/util/index.js", "../node_modules/_prompts@2.4.2@prompts/dist/elements/prompt.js", "../node_modules/_prompts@2.4.2@prompts/dist/elements/text.js", "../node_modules/_prompts@2.4.2@prompts/dist/elements/select.js", "../node_modules/_prompts@2.4.2@prompts/dist/elements/toggle.js", "../node_modules/_prompts@2.4.2@prompts/dist/dateparts/datepart.js", "../node_modules/_prompts@2.4.2@prompts/dist/dateparts/meridiem.js", "../node_modules/_prompts@2.4.2@prompts/dist/dateparts/day.js", "../node_modules/_prompts@2.4.2@prompts/dist/dateparts/hours.js", "../node_modules/_prompts@2.4.2@prompts/dist/dateparts/milliseconds.js", "../node_modules/_prompts@2.4.2@prompts/dist/dateparts/minutes.js", "../node_modules/_prompts@2.4.2@prompts/dist/dateparts/month.js", "../node_modules/_prompts@2.4.2@prompts/dist/dateparts/seconds.js", "../node_modules/_prompts@2.4.2@prompts/dist/dateparts/year.js", "../node_modules/_prompts@2.4.2@prompts/dist/dateparts/index.js", "../node_modules/_prompts@2.4.2@prompts/dist/elements/date.js", "../node_modules/_prompts@2.4.2@prompts/dist/elements/number.js", "../node_modules/_prompts@2.4.2@prompts/dist/elements/multiselect.js", "../node_modules/_prompts@2.4.2@prompts/dist/elements/autocomplete.js", "../node_modules/_prompts@2.4.2@prompts/dist/elements/autocompleteMultiselect.js", "../node_modules/_prompts@2.4.2@prompts/dist/elements/confirm.js", "../node_modules/_prompts@2.4.2@prompts/dist/elements/index.js", "../node_modules/_prompts@2.4.2@prompts/dist/prompts.js", "../node_modules/_prompts@2.4.2@prompts/dist/index.js", "../node_modules/_prompts@2.4.2@prompts/lib/util/action.js", "../node_modules/_prompts@2.4.2@prompts/lib/util/strip.js", "../node_modules/_prompts@2.4.2@prompts/lib/util/clear.js", "../node_modules/_prompts@2.4.2@prompts/lib/util/figures.js", "../node_modules/_prompts@2.4.2@prompts/lib/util/style.js", "../node_modules/_prompts@2.4.2@prompts/lib/util/lines.js", "../node_modules/_prompts@2.4.2@prompts/lib/util/wrap.js", "../node_modules/_prompts@2.4.2@prompts/lib/util/entriesToDisplay.js", "../node_modules/_prompts@2.4.2@prompts/lib/util/index.js", "../node_modules/_prompts@2.4.2@prompts/lib/elements/prompt.js", "../node_modules/_prompts@2.4.2@prompts/lib/elements/text.js", "../node_modules/_prompts@2.4.2@prompts/lib/elements/select.js", "../node_modules/_prompts@2.4.2@prompts/lib/elements/toggle.js", "../node_modules/_prompts@2.4.2@prompts/lib/dateparts/datepart.js", "../node_modules/_prompts@2.4.2@prompts/lib/dateparts/meridiem.js", "../node_modules/_prompts@2.4.2@prompts/lib/dateparts/day.js", "../node_modules/_prompts@2.4.2@prompts/lib/dateparts/hours.js", "../node_modules/_prompts@2.4.2@prompts/lib/dateparts/milliseconds.js", "../node_modules/_prompts@2.4.2@prompts/lib/dateparts/minutes.js", "../node_modules/_prompts@2.4.2@prompts/lib/dateparts/month.js", "../node_modules/_prompts@2.4.2@prompts/lib/dateparts/seconds.js", "../node_modules/_prompts@2.4.2@prompts/lib/dateparts/year.js", "../node_modules/_prompts@2.4.2@prompts/lib/dateparts/index.js", "../node_modules/_prompts@2.4.2@prompts/lib/elements/date.js", "../node_modules/_prompts@2.4.2@prompts/lib/elements/number.js", "../node_modules/_prompts@2.4.2@prompts/lib/elements/multiselect.js", "../node_modules/_prompts@2.4.2@prompts/lib/elements/autocomplete.js", "../node_modules/_prompts@2.4.2@prompts/lib/elements/autocompleteMultiselect.js", "../node_modules/_prompts@2.4.2@prompts/lib/elements/confirm.js", "../node_modules/_prompts@2.4.2@prompts/lib/elements/index.js", "../node_modules/_prompts@2.4.2@prompts/lib/prompts.js", "../node_modules/_prompts@2.4.2@prompts/lib/index.js", "../node_modules/_prompts@2.4.2@prompts/index.js", "../node_modules/_ms@2.1.2@ms/index.js", "../node_modules/_debug@4.3.4@debug/src/common.js", "../node_modules/_debug@4.3.4@debug/src/browser.js", "../node_modules/_has-flag@4.0.0@has-flag/index.js", "../node_modules/_supports-color@8.1.1@supports-color/index.js", "../node_modules/_debug@4.3.4@debug/src/node.js", "../node_modules/_debug@4.3.4@debug/src/index.js", "../node_modules/_node-environment@0.5.1@node-environment/lib/compare-aliases.js", "../node_modules/_node-environment@0.5.1@node-environment/lib/modes.enum.js", "../node_modules/_node-environment@0.5.1@node-environment/lib/inspector.js", "../node_modules/_node-environment@0.5.1@node-environment/lib/index.js", "../node_modules/_universalify@2.0.0@universalify/index.js", "../node_modules/_graceful-fs@4.2.10@graceful-fs/polyfills.js", "../node_modules/_graceful-fs@4.2.10@graceful-fs/legacy-streams.js", "../node_modules/_graceful-fs@4.2.10@graceful-fs/clone.js", "../node_modules/_graceful-fs@4.2.10@graceful-fs/graceful-fs.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/fs/index.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/mkdirs/utils.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/mkdirs/make-dir.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/mkdirs/index.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/path-exists/index.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/util/utimes.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/util/stat.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/copy/copy.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/copy/copy-sync.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/copy/index.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/remove/rimraf.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/remove/index.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/empty/index.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/ensure/file.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/ensure/link.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/ensure/symlink-paths.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/ensure/symlink-type.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/ensure/symlink.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/ensure/index.js", "../node_modules/_jsonfile@6.1.0@jsonfile/utils.js", "../node_modules/_jsonfile@6.1.0@jsonfile/index.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/json/jsonfile.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/output-file/index.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/json/output-json.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/json/output-json-sync.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/json/index.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/move/move.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/move/move-sync.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/move/index.js", "../node_modules/_fs-extra@10.1.0@fs-extra/lib/index.js", "../node_modules/_arg@5.0.1@arg/index.js", "../src/bin.ts", "../src/commands/base.ts", "../src/commands/wirte-md.ts", "../src/commands/get-file.ts", "../src/commands/change-path.ts", "../node_modules/_kolorist@1.5.1@kolorist/src/index.ts", "../src/shared/logger.ts", "../src/commands/rename-path.ts", "../script/cli/index.ts", "../script/help/index.ts", "../script/cli/handle.ts", "../src/commands/mark-file.ts", "../src/commands/mark-write-file.ts", "../src/commands/get-router.ts", "../src/shared/constant.ts"],
4
+ "sourcesContent": ["// @ts-check\n\n/**\n * CommanderError class\n * @class\n */\nclass CommanderError extends Error {\n /**\n * Constructs the CommanderError class\n * @param {number} exitCode suggested exit code which could be used with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n * @constructor\n */\n constructor(exitCode, code, message) {\n super(message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n this.code = code;\n this.exitCode = exitCode;\n this.nestedError = undefined;\n }\n}\n\n/**\n * InvalidArgumentError class\n * @class\n */\nclass InvalidArgumentError extends CommanderError {\n /**\n * Constructs the InvalidArgumentError class\n * @param {string} [message] explanation of why argument is invalid\n * @constructor\n */\n constructor(message) {\n super(1, 'commander.invalidArgument', message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n }\n}\n\nexports.CommanderError = CommanderError;\nexports.InvalidArgumentError = InvalidArgumentError;\n", "const { InvalidArgumentError } = require('./error.js');\n\n// @ts-check\n\nclass Argument {\n /**\n * Initialize a new command argument with the given name and description.\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @param {string} name\n * @param {string} [description]\n */\n\n constructor(name, description) {\n this.description = description || '';\n this.variadic = false;\n this.parseArg = undefined;\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.argChoices = undefined;\n\n switch (name[0]) {\n case '<': // e.g. <required>\n this.required = true;\n this._name = name.slice(1, -1);\n break;\n case '[': // e.g. [optional]\n this.required = false;\n this._name = name.slice(1, -1);\n break;\n default:\n this.required = true;\n this._name = name;\n break;\n }\n\n if (this._name.length > 3 && this._name.slice(-3) === '...') {\n this.variadic = true;\n this._name = this._name.slice(0, -3);\n }\n }\n\n /**\n * Return argument name.\n *\n * @return {string}\n */\n\n name() {\n return this._name;\n };\n\n /**\n * @api private\n */\n\n _concatValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n return previous.concat(value);\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {any} value\n * @param {string} [description]\n * @return {Argument}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n };\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n *\n * @param {Function} [fn]\n * @return {Argument}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n };\n\n /**\n * Only allow option value to be one of choices.\n *\n * @param {string[]} values\n * @return {Argument}\n */\n\n choices(values) {\n this.argChoices = values;\n this.parseArg = (arg, previous) => {\n if (!values.includes(arg)) {\n throw new InvalidArgumentError(`Allowed choices are ${values.join(', ')}.`);\n }\n if (this.variadic) {\n return this._concatValue(arg, previous);\n }\n return arg;\n };\n return this;\n };\n\n /**\n * Make option-argument required.\n */\n argRequired() {\n this.required = true;\n return this;\n }\n\n /**\n * Make option-argument optional.\n */\n argOptional() {\n this.required = false;\n return this;\n }\n}\n\n/**\n * Takes an argument and returns its human readable equivalent for help usage.\n *\n * @param {Argument} arg\n * @return {string}\n * @api private\n */\n\nfunction humanReadableArgName(arg) {\n const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');\n\n return arg.required\n ? '<' + nameOutput + '>'\n : '[' + nameOutput + ']';\n}\n\nexports.Argument = Argument;\nexports.humanReadableArgName = humanReadableArgName;\n", "const { humanReadableArgName } = require('./argument.js');\n\n/**\n * TypeScript import types for JSDoc, used by Visual Studio Code IntelliSense and `npm run typescript-checkJS`\n * https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types\n * @typedef { import(\"./argument.js\").Argument } Argument\n * @typedef { import(\"./command.js\").Command } Command\n * @typedef { import(\"./option.js\").Option } Option\n */\n\n// @ts-check\n\n// Although this is a class, methods are static in style to allow override using subclass or just functions.\nclass Help {\n constructor() {\n this.helpWidth = undefined;\n this.sortSubcommands = false;\n this.sortOptions = false;\n }\n\n /**\n * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.\n *\n * @param {Command} cmd\n * @returns {Command[]}\n */\n\n visibleCommands(cmd) {\n const visibleCommands = cmd.commands.filter(cmd => !cmd._hidden);\n if (cmd._hasImplicitHelpCommand()) {\n // Create a command matching the implicit help command.\n const [, helpName, helpArgs] = cmd._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/);\n const helpCommand = cmd.createCommand(helpName)\n .helpOption(false);\n helpCommand.description(cmd._helpCommandDescription);\n if (helpArgs) helpCommand.arguments(helpArgs);\n visibleCommands.push(helpCommand);\n }\n if (this.sortSubcommands) {\n visibleCommands.sort((a, b) => {\n // @ts-ignore: overloaded return type\n return a.name().localeCompare(b.name());\n });\n }\n return visibleCommands;\n }\n\n /**\n * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleOptions(cmd) {\n const visibleOptions = cmd.options.filter((option) => !option.hidden);\n // Implicit help\n const showShortHelpFlag = cmd._hasHelpOption && cmd._helpShortFlag && !cmd._findOption(cmd._helpShortFlag);\n const showLongHelpFlag = cmd._hasHelpOption && !cmd._findOption(cmd._helpLongFlag);\n if (showShortHelpFlag || showLongHelpFlag) {\n let helpOption;\n if (!showShortHelpFlag) {\n helpOption = cmd.createOption(cmd._helpLongFlag, cmd._helpDescription);\n } else if (!showLongHelpFlag) {\n helpOption = cmd.createOption(cmd._helpShortFlag, cmd._helpDescription);\n } else {\n helpOption = cmd.createOption(cmd._helpFlags, cmd._helpDescription);\n }\n visibleOptions.push(helpOption);\n }\n if (this.sortOptions) {\n const getSortKey = (option) => {\n // WYSIWYG for order displayed in help with short before long, no special handling for negated.\n return option.short ? option.short.replace(/^-/, '') : option.long.replace(/^--/, '');\n };\n visibleOptions.sort((a, b) => {\n return getSortKey(a).localeCompare(getSortKey(b));\n });\n }\n return visibleOptions;\n }\n\n /**\n * Get an array of the arguments if any have a description.\n *\n * @param {Command} cmd\n * @returns {Argument[]}\n */\n\n visibleArguments(cmd) {\n // Side effect! Apply the legacy descriptions before the arguments are displayed.\n if (cmd._argsDescription) {\n cmd._args.forEach(argument => {\n argument.description = argument.description || cmd._argsDescription[argument.name()] || '';\n });\n }\n\n // If there are any arguments with a description then return all the arguments.\n if (cmd._args.find(argument => argument.description)) {\n return cmd._args;\n };\n return [];\n }\n\n /**\n * Get the command term to show in the list of subcommands.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandTerm(cmd) {\n // Legacy. Ignores custom usage string, and nested commands.\n const args = cmd._args.map(arg => humanReadableArgName(arg)).join(' ');\n return cmd._name +\n (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +\n (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option\n (args ? ' ' + args : '');\n }\n\n /**\n * Get the option term to show in the list of options.\n *\n * @param {Option} option\n * @returns {string}\n */\n\n optionTerm(option) {\n return option.flags;\n }\n\n /**\n * Get the argument term to show in the list of arguments.\n *\n * @param {Argument} argument\n * @returns {string}\n */\n\n argumentTerm(argument) {\n return argument.name();\n }\n\n /**\n * Get the longest command term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestSubcommandTermLength(cmd, helper) {\n return helper.visibleCommands(cmd).reduce((max, command) => {\n return Math.max(max, helper.subcommandTerm(command).length);\n }, 0);\n };\n\n /**\n * Get the longest option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestOptionTermLength(cmd, helper) {\n return helper.visibleOptions(cmd).reduce((max, option) => {\n return Math.max(max, helper.optionTerm(option).length);\n }, 0);\n };\n\n /**\n * Get the longest argument term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestArgumentTermLength(cmd, helper) {\n return helper.visibleArguments(cmd).reduce((max, argument) => {\n return Math.max(max, helper.argumentTerm(argument).length);\n }, 0);\n };\n\n /**\n * Get the command usage to be displayed at the top of the built-in help.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandUsage(cmd) {\n // Usage\n let cmdName = cmd._name;\n if (cmd._aliases[0]) {\n cmdName = cmdName + '|' + cmd._aliases[0];\n }\n let parentCmdNames = '';\n for (let parentCmd = cmd.parent; parentCmd; parentCmd = parentCmd.parent) {\n parentCmdNames = parentCmd.name() + ' ' + parentCmdNames;\n }\n return parentCmdNames + cmdName + ' ' + cmd.usage();\n }\n\n /**\n * Get the description for the command.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandDescription(cmd) {\n // @ts-ignore: overloaded return type\n return cmd.description();\n }\n\n /**\n * Get the command description to show in the list of subcommands.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandDescription(cmd) {\n // @ts-ignore: overloaded return type\n return cmd.description();\n }\n\n /**\n * Get the option description to show in the list of options.\n *\n * @param {Option} option\n * @return {string}\n */\n\n optionDescription(option) {\n const extraInfo = [];\n // Some of these do not make sense for negated boolean and suppress for backwards compatibility.\n\n if (option.argChoices && !option.negate) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`);\n }\n if (option.defaultValue !== undefined && !option.negate) {\n extraInfo.push(`default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`);\n }\n if (option.envVar !== undefined) {\n extraInfo.push(`env: ${option.envVar}`);\n }\n if (extraInfo.length > 0) {\n return `${option.description} (${extraInfo.join(', ')})`;\n }\n\n return option.description;\n };\n\n /**\n * Get the argument description to show in the list of arguments.\n *\n * @param {Argument} argument\n * @return {string}\n */\n\n argumentDescription(argument) {\n const extraInfo = [];\n if (argument.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`);\n }\n if (argument.defaultValue !== undefined) {\n extraInfo.push(`default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`);\n }\n if (extraInfo.length > 0) {\n const extraDescripton = `(${extraInfo.join(', ')})`;\n if (argument.description) {\n return `${argument.description} ${extraDescripton}`;\n }\n return extraDescripton;\n }\n return argument.description;\n }\n\n /**\n * Generate the built-in help text.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {string}\n */\n\n formatHelp(cmd, helper) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth || 80;\n const itemIndentWidth = 2;\n const itemSeparatorWidth = 2; // between term and description\n function formatItem(term, description) {\n if (description) {\n const fullText = `${term.padEnd(termWidth + itemSeparatorWidth)}${description}`;\n return helper.wrap(fullText, helpWidth - itemIndentWidth, termWidth + itemSeparatorWidth);\n }\n return term;\n };\n function formatList(textArray) {\n return textArray.join('\\n').replace(/^/gm, ' '.repeat(itemIndentWidth));\n }\n\n // Usage\n let output = [`Usage: ${helper.commandUsage(cmd)}`, ''];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([commandDescription, '']);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument) => {\n return formatItem(helper.argumentTerm(argument), helper.argumentDescription(argument));\n });\n if (argumentList.length > 0) {\n output = output.concat(['Arguments:', formatList(argumentList), '']);\n }\n\n // Options\n const optionList = helper.visibleOptions(cmd).map((option) => {\n return formatItem(helper.optionTerm(option), helper.optionDescription(option));\n });\n if (optionList.length > 0) {\n output = output.concat(['Options:', formatList(optionList), '']);\n }\n\n // Commands\n const commandList = helper.visibleCommands(cmd).map((cmd) => {\n return formatItem(helper.subcommandTerm(cmd), helper.subcommandDescription(cmd));\n });\n if (commandList.length > 0) {\n output = output.concat(['Commands:', formatList(commandList), '']);\n }\n\n return output.join('\\n');\n }\n\n /**\n * Calculate the pad width from the maximum term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n padWidth(cmd, helper) {\n return Math.max(\n helper.longestOptionTermLength(cmd, helper),\n helper.longestSubcommandTermLength(cmd, helper),\n helper.longestArgumentTermLength(cmd, helper)\n );\n };\n\n /**\n * Wrap the given string to width characters per line, with lines after the first indented.\n * Do not wrap if insufficient room for wrapping (minColumnWidth), or string is manually formatted.\n *\n * @param {string} str\n * @param {number} width\n * @param {number} indent\n * @param {number} [minColumnWidth=40]\n * @return {string}\n *\n */\n\n wrap(str, width, indent, minColumnWidth = 40) {\n // Detect manually wrapped and indented strings by searching for line breaks\n // followed by multiple spaces/tabs.\n if (str.match(/[\\n]\\s+/)) return str;\n // Do not wrap if not enough room for a wrapped column of text (as could end up with a word per line).\n const columnWidth = width - indent;\n if (columnWidth < minColumnWidth) return str;\n\n const leadingStr = str.substr(0, indent);\n const columnText = str.substr(indent);\n\n const indentString = ' '.repeat(indent);\n const regex = new RegExp('.{1,' + (columnWidth - 1) + '}([\\\\s\\u200B]|$)|[^\\\\s\\u200B]+?([\\\\s\\u200B]|$)', 'g');\n const lines = columnText.match(regex) || [];\n return leadingStr + lines.map((line, i) => {\n if (line.slice(-1) === '\\n') {\n line = line.slice(0, line.length - 1);\n }\n return ((i > 0) ? indentString : '') + line.trimRight();\n }).join('\\n');\n }\n}\n\nexports.Help = Help;\n", "const { InvalidArgumentError } = require('./error.js');\n\n// @ts-check\n\nclass Option {\n /**\n * Initialize a new `Option` with the given `flags` and `description`.\n *\n * @param {string} flags\n * @param {string} [description]\n */\n\n constructor(flags, description) {\n this.flags = flags;\n this.description = description || '';\n\n this.required = flags.includes('<'); // A value must be supplied when the option is specified.\n this.optional = flags.includes('['); // A value is optional when the option is specified.\n // variadic test ignores <value,...> et al which might be used to describe custom splitting of single argument\n this.variadic = /\\w\\.\\.\\.[>\\]]$/.test(flags); // The option can take multiple values.\n this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.\n const optionFlags = splitOptionFlags(flags);\n this.short = optionFlags.shortFlag;\n this.long = optionFlags.longFlag;\n this.negate = false;\n if (this.long) {\n this.negate = this.long.startsWith('--no-');\n }\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.envVar = undefined;\n this.parseArg = undefined;\n this.hidden = false;\n this.argChoices = undefined;\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {any} value\n * @param {string} [description]\n * @return {Option}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n };\n\n /**\n * Set environment variable to check for option value.\n * Priority order of option values is default < env < cli\n *\n * @param {string} name\n * @return {Option}\n */\n\n env(name) {\n this.envVar = name;\n return this;\n };\n\n /**\n * Set the custom handler for processing CLI option arguments into option values.\n *\n * @param {Function} [fn]\n * @return {Option}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n };\n\n /**\n * Whether the option is mandatory and must have a value after parsing.\n *\n * @param {boolean} [mandatory=true]\n * @return {Option}\n */\n\n makeOptionMandatory(mandatory = true) {\n this.mandatory = !!mandatory;\n return this;\n };\n\n /**\n * Hide option in help.\n *\n * @param {boolean} [hide=true]\n * @return {Option}\n */\n\n hideHelp(hide = true) {\n this.hidden = !!hide;\n return this;\n };\n\n /**\n * @api private\n */\n\n _concatValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n return previous.concat(value);\n }\n\n /**\n * Only allow option value to be one of choices.\n *\n * @param {string[]} values\n * @return {Option}\n */\n\n choices(values) {\n this.argChoices = values;\n this.parseArg = (arg, previous) => {\n if (!values.includes(arg)) {\n throw new InvalidArgumentError(`Allowed choices are ${values.join(', ')}.`);\n }\n if (this.variadic) {\n return this._concatValue(arg, previous);\n }\n return arg;\n };\n return this;\n };\n\n /**\n * Return option name.\n *\n * @return {string}\n */\n\n name() {\n if (this.long) {\n return this.long.replace(/^--/, '');\n }\n return this.short.replace(/^-/, '');\n };\n\n /**\n * Return option name, in a camelcase format that can be used\n * as a object attribute key.\n *\n * @return {string}\n * @api private\n */\n\n attributeName() {\n return camelcase(this.name().replace(/^no-/, ''));\n };\n\n /**\n * Check if `arg` matches the short or long flag.\n *\n * @param {string} arg\n * @return {boolean}\n * @api private\n */\n\n is(arg) {\n return this.short === arg || this.long === arg;\n };\n}\n\n/**\n * Convert string from kebab-case to camelCase.\n *\n * @param {string} str\n * @return {string}\n * @api private\n */\n\nfunction camelcase(str) {\n return str.split('-').reduce((str, word) => {\n return str + word[0].toUpperCase() + word.slice(1);\n });\n}\n\n/**\n * Split the short and long flag out of something like '-m,--mixed <value>'\n *\n * @api private\n */\n\nfunction splitOptionFlags(flags) {\n let shortFlag;\n let longFlag;\n // Use original very loose parsing to maintain backwards compatibility for now,\n // which allowed for example unintended `-sw, --short-word` [sic].\n const flagParts = flags.split(/[ |,]+/);\n if (flagParts.length > 1 && !/^[[<]/.test(flagParts[1])) shortFlag = flagParts.shift();\n longFlag = flagParts.shift();\n // Add support for lone short flag without significantly changing parsing!\n if (!shortFlag && /^-[^-]$/.test(longFlag)) {\n shortFlag = longFlag;\n longFlag = undefined;\n }\n return { shortFlag, longFlag };\n}\n\nexports.Option = Option;\nexports.splitOptionFlags = splitOptionFlags;\n", "const maxDistance = 3;\n\nfunction editDistance(a, b) {\n // https://en.wikipedia.org/wiki/Damerau\u2013Levenshtein_distance\n // Calculating optimal string alignment distance, no substring is edited more than once.\n // (Simple implementation.)\n\n // Quick early exit, return worst case.\n if (Math.abs(a.length - b.length) > maxDistance) return Math.max(a.length, b.length);\n\n // distance between prefix substrings of a and b\n const d = [];\n\n // pure deletions turn a into empty string\n for (let i = 0; i <= a.length; i++) {\n d[i] = [i];\n }\n // pure insertions turn empty string into b\n for (let j = 0; j <= b.length; j++) {\n d[0][j] = j;\n }\n\n // fill matrix\n for (let j = 1; j <= b.length; j++) {\n for (let i = 1; i <= a.length; i++) {\n let cost = 1;\n if (a[i - 1] === b[j - 1]) {\n cost = 0;\n } else {\n cost = 1;\n }\n d[i][j] = Math.min(\n d[i - 1][j] + 1, // deletion\n d[i][j - 1] + 1, // insertion\n d[i - 1][j - 1] + cost // substitution\n );\n // transposition\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);\n }\n }\n }\n\n return d[a.length][b.length];\n}\n\n/**\n * Find close matches, restricted to same number of edits.\n *\n * @param {string} word\n * @param {string[]} candidates\n * @returns {string}\n */\n\nfunction suggestSimilar(word, candidates) {\n if (!candidates || candidates.length === 0) return '';\n // remove possible duplicates\n candidates = Array.from(new Set(candidates));\n\n const searchingOptions = word.startsWith('--');\n if (searchingOptions) {\n word = word.slice(2);\n candidates = candidates.map(candidate => candidate.slice(2));\n }\n\n let similar = [];\n let bestDistance = maxDistance;\n const minSimilarity = 0.4;\n candidates.forEach((candidate) => {\n if (candidate.length <= 1) return; // no one character guesses\n\n const distance = editDistance(word, candidate);\n const length = Math.max(word.length, candidate.length);\n const similarity = (length - distance) / length;\n if (similarity > minSimilarity) {\n if (distance < bestDistance) {\n // better edit distance, throw away previous worse matches\n bestDistance = distance;\n similar = [candidate];\n } else if (distance === bestDistance) {\n similar.push(candidate);\n }\n }\n });\n\n similar.sort((a, b) => a.localeCompare(b));\n if (searchingOptions) {\n similar = similar.map(candidate => `--${candidate}`);\n }\n\n if (similar.length > 1) {\n return `\\n(Did you mean one of ${similar.join(', ')}?)`;\n }\n if (similar.length === 1) {\n return `\\n(Did you mean ${similar[0]}?)`;\n }\n return '';\n}\n\nexports.suggestSimilar = suggestSimilar;\n", "const EventEmitter = require('events').EventEmitter;\nconst childProcess = require('child_process');\nconst path = require('path');\nconst fs = require('fs');\n\nconst { Argument, humanReadableArgName } = require('./argument.js');\nconst { CommanderError } = require('./error.js');\nconst { Help } = require('./help.js');\nconst { Option, splitOptionFlags } = require('./option.js');\nconst { suggestSimilar } = require('./suggestSimilar');\n\n// @ts-check\n\nclass Command extends EventEmitter {\n /**\n * Initialize a new `Command`.\n *\n * @param {string} [name]\n */\n\n constructor(name) {\n super();\n /** @type {Command[]} */\n this.commands = [];\n /** @type {Option[]} */\n this.options = [];\n this.parent = null;\n this._allowUnknownOption = false;\n this._allowExcessArguments = true;\n /** @type {Argument[]} */\n this._args = [];\n /** @type {string[]} */\n this.args = []; // cli args with options removed\n this.rawArgs = [];\n this.processedArgs = []; // like .args but after custom processing and collecting variadic\n this._scriptPath = null;\n this._name = name || '';\n this._optionValues = {};\n this._optionValueSources = {}; // default < config < env < cli\n this._storeOptionsAsProperties = false;\n this._actionHandler = null;\n this._executableHandler = false;\n this._executableFile = null; // custom name for executable\n this._defaultCommandName = null;\n this._exitCallback = null;\n this._aliases = [];\n this._combineFlagAndOptionalValue = true;\n this._description = '';\n this._argsDescription = undefined; // legacy\n this._enablePositionalOptions = false;\n this._passThroughOptions = false;\n this._lifeCycleHooks = {}; // a hash of arrays\n /** @type {boolean | string} */\n this._showHelpAfterError = false;\n this._showSuggestionAfterError = false;\n\n // see .configureOutput() for docs\n this._outputConfiguration = {\n writeOut: (str) => process.stdout.write(str),\n writeErr: (str) => process.stderr.write(str),\n getOutHelpWidth: () => process.stdout.isTTY ? process.stdout.columns : undefined,\n getErrHelpWidth: () => process.stderr.isTTY ? process.stderr.columns : undefined,\n outputError: (str, write) => write(str)\n };\n\n this._hidden = false;\n this._hasHelpOption = true;\n this._helpFlags = '-h, --help';\n this._helpDescription = 'display help for command';\n this._helpShortFlag = '-h';\n this._helpLongFlag = '--help';\n this._addImplicitHelpCommand = undefined; // Deliberately undefined, not decided whether true or false\n this._helpCommandName = 'help';\n this._helpCommandnameAndArgs = 'help [command]';\n this._helpCommandDescription = 'display help for command';\n this._helpConfiguration = {};\n }\n\n /**\n * Copy settings that are useful to have in common across root command and subcommands.\n *\n * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)\n *\n * @param {Command} sourceCommand\n * @return {Command} returns `this` for executable command\n */\n copyInheritedSettings(sourceCommand) {\n this._outputConfiguration = sourceCommand._outputConfiguration;\n this._hasHelpOption = sourceCommand._hasHelpOption;\n this._helpFlags = sourceCommand._helpFlags;\n this._helpDescription = sourceCommand._helpDescription;\n this._helpShortFlag = sourceCommand._helpShortFlag;\n this._helpLongFlag = sourceCommand._helpLongFlag;\n this._helpCommandName = sourceCommand._helpCommandName;\n this._helpCommandnameAndArgs = sourceCommand._helpCommandnameAndArgs;\n this._helpCommandDescription = sourceCommand._helpCommandDescription;\n this._helpConfiguration = sourceCommand._helpConfiguration;\n this._exitCallback = sourceCommand._exitCallback;\n this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;\n this._combineFlagAndOptionalValue = sourceCommand._combineFlagAndOptionalValue;\n this._allowExcessArguments = sourceCommand._allowExcessArguments;\n this._enablePositionalOptions = sourceCommand._enablePositionalOptions;\n this._showHelpAfterError = sourceCommand._showHelpAfterError;\n this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;\n\n return this;\n }\n\n /**\n * Define a command.\n *\n * There are two styles of command: pay attention to where to put the description.\n *\n * @example\n * // Command implemented using action handler (description is supplied separately to `.command`)\n * program\n * .command('clone <source> [destination]')\n * .description('clone a repository into a newly created directory')\n * .action((source, destination) => {\n * console.log('clone command called');\n * });\n *\n * // Command implemented using separate executable file (description is second parameter to `.command`)\n * program\n * .command('start <service>', 'start named service')\n * .command('stop [service]', 'stop named service, or all if no name supplied');\n *\n * @param {string} nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`\n * @param {Object|string} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)\n * @param {Object} [execOpts] - configuration options (for executable)\n * @return {Command} returns new command for action handler, or `this` for executable command\n */\n\n command(nameAndArgs, actionOptsOrExecDesc, execOpts) {\n let desc = actionOptsOrExecDesc;\n let opts = execOpts;\n if (typeof desc === 'object' && desc !== null) {\n opts = desc;\n desc = null;\n }\n opts = opts || {};\n const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);\n\n const cmd = this.createCommand(name);\n if (desc) {\n cmd.description(desc);\n cmd._executableHandler = true;\n }\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden\n cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor\n if (args) cmd.arguments(args);\n this.commands.push(cmd);\n cmd.parent = this;\n cmd.copyInheritedSettings(this);\n\n if (desc) return this;\n return cmd;\n };\n\n /**\n * Factory routine to create a new unattached command.\n *\n * See .command() for creating an attached subcommand, which uses this routine to\n * create the command. You can override createCommand to customise subcommands.\n *\n * @param {string} [name]\n * @return {Command} new command\n */\n\n createCommand(name) {\n return new Command(name);\n };\n\n /**\n * You can customise the help with a subclass of Help by overriding createHelp,\n * or by overriding Help properties using configureHelp().\n *\n * @return {Help}\n */\n\n createHelp() {\n return Object.assign(new Help(), this.configureHelp());\n };\n\n /**\n * You can customise the help by overriding Help properties using configureHelp(),\n * or with a subclass of Help by overriding createHelp().\n *\n * @param {Object} [configuration] - configuration options\n * @return {Command|Object} `this` command for chaining, or stored configuration\n */\n\n configureHelp(configuration) {\n if (configuration === undefined) return this._helpConfiguration;\n\n this._helpConfiguration = configuration;\n return this;\n }\n\n /**\n * The default output goes to stdout and stderr. You can customise this for special\n * applications. You can also customise the display of errors by overriding outputError.\n *\n * The configuration properties are all functions:\n *\n * // functions to change where being written, stdout and stderr\n * writeOut(str)\n * writeErr(str)\n * // matching functions to specify width for wrapping help\n * getOutHelpWidth()\n * getErrHelpWidth()\n * // functions based on what is being written out\n * outputError(str, write) // used for displaying errors, and not used for displaying help\n *\n * @param {Object} [configuration] - configuration options\n * @return {Command|Object} `this` command for chaining, or stored configuration\n */\n\n configureOutput(configuration) {\n if (configuration === undefined) return this._outputConfiguration;\n\n Object.assign(this._outputConfiguration, configuration);\n return this;\n }\n\n /**\n * Display the help or a custom message after an error occurs.\n *\n * @param {boolean|string} [displayHelp]\n * @return {Command} `this` command for chaining\n */\n showHelpAfterError(displayHelp = true) {\n if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;\n this._showHelpAfterError = displayHelp;\n return this;\n }\n\n /**\n * Display suggestion of similar commands for unknown commands, or options for unknown options.\n *\n * @param {boolean} [displaySuggestion]\n * @return {Command} `this` command for chaining\n */\n showSuggestionAfterError(displaySuggestion = true) {\n this._showSuggestionAfterError = !!displaySuggestion;\n return this;\n }\n\n /**\n * Add a prepared subcommand.\n *\n * See .command() for creating an attached subcommand which inherits settings from its parent.\n *\n * @param {Command} cmd - new subcommand\n * @param {Object} [opts] - configuration options\n * @return {Command} `this` command for chaining\n */\n\n addCommand(cmd, opts) {\n if (!cmd._name) throw new Error('Command passed to .addCommand() must have a name');\n\n // To keep things simple, block automatic name generation for deeply nested executables.\n // Fail fast and detect when adding rather than later when parsing.\n function checkExplicitNames(commandArray) {\n commandArray.forEach((cmd) => {\n if (cmd._executableHandler && !cmd._executableFile) {\n throw new Error(`Must specify executableFile for deeply nested executable: ${cmd.name()}`);\n }\n checkExplicitNames(cmd.commands);\n });\n }\n checkExplicitNames(cmd.commands);\n\n opts = opts || {};\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation\n\n this.commands.push(cmd);\n cmd.parent = this;\n return this;\n };\n\n /**\n * Factory routine to create a new unattached argument.\n *\n * See .argument() for creating an attached argument, which uses this routine to\n * create the argument. You can override createArgument to return a custom argument.\n *\n * @param {string} name\n * @param {string} [description]\n * @return {Argument} new argument\n */\n\n createArgument(name, description) {\n return new Argument(name, description);\n };\n\n /**\n * Define argument syntax for command.\n *\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @example\n * program.argument('<input-file>');\n * program.argument('[output-file]');\n *\n * @param {string} name\n * @param {string} [description]\n * @param {Function|*} [fn] - custom argument processing function\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n argument(name, description, fn, defaultValue) {\n const argument = this.createArgument(name, description);\n if (typeof fn === 'function') {\n argument.default(defaultValue).argParser(fn);\n } else {\n argument.default(fn);\n }\n this.addArgument(argument);\n return this;\n }\n\n /**\n * Define argument syntax for command, adding multiple at once (without descriptions).\n *\n * See also .argument().\n *\n * @example\n * program.arguments('<cmd> [env]');\n *\n * @param {string} names\n * @return {Command} `this` command for chaining\n */\n\n arguments(names) {\n names.split(/ +/).forEach((detail) => {\n this.argument(detail);\n });\n return this;\n };\n\n /**\n * Define argument syntax for command, adding a prepared argument.\n *\n * @param {Argument} argument\n * @return {Command} `this` command for chaining\n */\n addArgument(argument) {\n const previousArgument = this._args.slice(-1)[0];\n if (previousArgument && previousArgument.variadic) {\n throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`);\n }\n if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) {\n throw new Error(`a default value for a required argument is never used: '${argument.name()}'`);\n }\n this._args.push(argument);\n return this;\n }\n\n /**\n * Override default decision whether to add implicit help command.\n *\n * addHelpCommand() // force on\n * addHelpCommand(false); // force off\n * addHelpCommand('help [cmd]', 'display help for [cmd]'); // force on with custom details\n *\n * @return {Command} `this` command for chaining\n */\n\n addHelpCommand(enableOrNameAndArgs, description) {\n if (enableOrNameAndArgs === false) {\n this._addImplicitHelpCommand = false;\n } else {\n this._addImplicitHelpCommand = true;\n if (typeof enableOrNameAndArgs === 'string') {\n this._helpCommandName = enableOrNameAndArgs.split(' ')[0];\n this._helpCommandnameAndArgs = enableOrNameAndArgs;\n }\n this._helpCommandDescription = description || this._helpCommandDescription;\n }\n return this;\n };\n\n /**\n * @return {boolean}\n * @api private\n */\n\n _hasImplicitHelpCommand() {\n if (this._addImplicitHelpCommand === undefined) {\n return this.commands.length && !this._actionHandler && !this._findCommand('help');\n }\n return this._addImplicitHelpCommand;\n };\n\n /**\n * Add hook for life cycle event.\n *\n * @param {string} event\n * @param {Function} listener\n * @return {Command} `this` command for chaining\n */\n\n hook(event, listener) {\n const allowedValues = ['preAction', 'postAction'];\n if (!allowedValues.includes(event)) {\n throw new Error(`Unexpected value for event passed to hook : '${event}'.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n if (this._lifeCycleHooks[event]) {\n this._lifeCycleHooks[event].push(listener);\n } else {\n this._lifeCycleHooks[event] = [listener];\n }\n return this;\n }\n\n /**\n * Register callback to use as replacement for calling process.exit.\n *\n * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing\n * @return {Command} `this` command for chaining\n */\n\n exitOverride(fn) {\n if (fn) {\n this._exitCallback = fn;\n } else {\n this._exitCallback = (err) => {\n if (err.code !== 'commander.executeSubCommandAsync') {\n throw err;\n } else {\n // Async callback from spawn events, not useful to throw.\n }\n };\n }\n return this;\n };\n\n /**\n * Call process.exit, and _exitCallback if defined.\n *\n * @param {number} exitCode exit code for using with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n * @return never\n * @api private\n */\n\n _exit(exitCode, code, message) {\n if (this._exitCallback) {\n this._exitCallback(new CommanderError(exitCode, code, message));\n // Expecting this line is not reached.\n }\n process.exit(exitCode);\n };\n\n /**\n * Register callback `fn` for the command.\n *\n * @example\n * program\n * .command('serve')\n * .description('start service')\n * .action(function() {\n * // do work here\n * });\n *\n * @param {Function} fn\n * @return {Command} `this` command for chaining\n */\n\n action(fn) {\n const listener = (args) => {\n // The .action callback takes an extra parameter which is the command or options.\n const expectedArgsCount = this._args.length;\n const actionArgs = args.slice(0, expectedArgsCount);\n if (this._storeOptionsAsProperties) {\n actionArgs[expectedArgsCount] = this; // backwards compatible \"options\"\n } else {\n actionArgs[expectedArgsCount] = this.opts();\n }\n actionArgs.push(this);\n\n return fn.apply(this, actionArgs);\n };\n this._actionHandler = listener;\n return this;\n };\n\n /**\n * Factory routine to create a new unattached option.\n *\n * See .option() for creating an attached option, which uses this routine to\n * create the option. You can override createOption to return a custom option.\n *\n * @param {string} flags\n * @param {string} [description]\n * @return {Option} new option\n */\n\n createOption(flags, description) {\n return new Option(flags, description);\n };\n\n /**\n * Add an option.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addOption(option) {\n const oname = option.name();\n const name = option.attributeName();\n\n let defaultValue = option.defaultValue;\n\n // preassign default value for --no-*, [optional], <required>, or plain flag if boolean value\n if (option.negate || option.optional || option.required || typeof defaultValue === 'boolean') {\n // when --no-foo we make sure default is true, unless a --foo option is already defined\n if (option.negate) {\n const positiveLongFlag = option.long.replace(/^--no-/, '--');\n defaultValue = this._findOption(positiveLongFlag) ? this.getOptionValue(name) : true;\n }\n // preassign only if we have a default\n if (defaultValue !== undefined) {\n this.setOptionValueWithSource(name, defaultValue, 'default');\n }\n }\n\n // register the option\n this.options.push(option);\n\n // handler for cli and env supplied values\n const handleOptionValue = (val, invalidValueMessage, valueSource) => {\n // Note: using closure to access lots of lexical scoped variables.\n const oldValue = this.getOptionValue(name);\n\n // custom processing\n if (val !== null && option.parseArg) {\n try {\n val = option.parseArg(val, oldValue === undefined ? defaultValue : oldValue);\n } catch (err) {\n if (err.code === 'commander.invalidArgument') {\n const message = `${invalidValueMessage} ${err.message}`;\n this._displayError(err.exitCode, err.code, message);\n }\n throw err;\n }\n } else if (val !== null && option.variadic) {\n val = option._concatValue(val, oldValue);\n }\n\n // unassigned or boolean value\n if (typeof oldValue === 'boolean' || typeof oldValue === 'undefined') {\n // if no value, negate false, and we have a default, then use it!\n if (val == null) {\n this.setOptionValueWithSource(name, option.negate ? false : defaultValue || true, valueSource);\n } else {\n this.setOptionValueWithSource(name, val, valueSource);\n }\n } else if (val !== null) {\n // reassign\n this.setOptionValueWithSource(name, option.negate ? false : val, valueSource);\n }\n };\n\n this.on('option:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'cli');\n });\n\n if (option.envVar) {\n this.on('optionEnv:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'env');\n });\n }\n\n return this;\n }\n\n /**\n * Internal implementation shared by .option() and .requiredOption()\n *\n * @api private\n */\n _optionEx(config, flags, description, fn, defaultValue) {\n const option = this.createOption(flags, description);\n option.makeOptionMandatory(!!config.mandatory);\n if (typeof fn === 'function') {\n option.default(defaultValue).argParser(fn);\n } else if (fn instanceof RegExp) {\n // deprecated\n const regex = fn;\n fn = (val, def) => {\n const m = regex.exec(val);\n return m ? m[0] : def;\n };\n option.default(defaultValue).argParser(fn);\n } else {\n option.default(fn);\n }\n\n return this.addOption(option);\n }\n\n /**\n * Define option with `flags`, `description` and optional\n * coercion `fn`.\n *\n * The `flags` string contains the short and/or long flags,\n * separated by comma, a pipe or space. The following are all valid\n * all will output this way when `--help` is used.\n *\n * \"-p, --pepper\"\n * \"-p|--pepper\"\n * \"-p --pepper\"\n *\n * @example\n * // simple boolean defaulting to undefined\n * program.option('-p, --pepper', 'add pepper');\n *\n * program.pepper\n * // => undefined\n *\n * --pepper\n * program.pepper\n * // => true\n *\n * // simple boolean defaulting to true (unless non-negated option is also defined)\n * program.option('-C, --no-cheese', 'remove cheese');\n *\n * program.cheese\n * // => true\n *\n * --no-cheese\n * program.cheese\n * // => false\n *\n * // required argument\n * program.option('-C, --chdir <path>', 'change the working directory');\n *\n * --chdir /tmp\n * program.chdir\n * // => \"/tmp\"\n *\n * // optional argument\n * program.option('-c, --cheese [type]', 'add cheese [marble]');\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {Function|*} [fn] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n option(flags, description, fn, defaultValue) {\n return this._optionEx({}, flags, description, fn, defaultValue);\n };\n\n /**\n * Add a required option which must have a value after parsing. This usually means\n * the option must be specified on the command line. (Otherwise the same as .option().)\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {Function|*} [fn] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n requiredOption(flags, description, fn, defaultValue) {\n return this._optionEx({ mandatory: true }, flags, description, fn, defaultValue);\n };\n\n /**\n * Alter parsing of short flags with optional values.\n *\n * @example\n * // for `.option('-f,--flag [value]'):\n * program.combineFlagAndOptionalValue(true); // `-f80` is treated like `--flag=80`, this is the default behaviour\n * program.combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`\n *\n * @param {Boolean} [combine=true] - if `true` or omitted, an optional value can be specified directly after the flag.\n */\n combineFlagAndOptionalValue(combine = true) {\n this._combineFlagAndOptionalValue = !!combine;\n return this;\n };\n\n /**\n * Allow unknown options on the command line.\n *\n * @param {Boolean} [allowUnknown=true] - if `true` or omitted, no error will be thrown\n * for unknown options.\n */\n allowUnknownOption(allowUnknown = true) {\n this._allowUnknownOption = !!allowUnknown;\n return this;\n };\n\n /**\n * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.\n *\n * @param {Boolean} [allowExcess=true] - if `true` or omitted, no error will be thrown\n * for excess arguments.\n */\n allowExcessArguments(allowExcess = true) {\n this._allowExcessArguments = !!allowExcess;\n return this;\n };\n\n /**\n * Enable positional options. Positional means global options are specified before subcommands which lets\n * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.\n * The default behaviour is non-positional and global options may appear anywhere on the command line.\n *\n * @param {Boolean} [positional=true]\n */\n enablePositionalOptions(positional = true) {\n this._enablePositionalOptions = !!positional;\n return this;\n };\n\n /**\n * Pass through options that come after command-arguments rather than treat them as command-options,\n * so actual command-options come before command-arguments. Turning this on for a subcommand requires\n * positional options to have been enabled on the program (parent commands).\n * The default behaviour is non-positional and options may appear before or after command-arguments.\n *\n * @param {Boolean} [passThrough=true]\n * for unknown options.\n */\n passThroughOptions(passThrough = true) {\n this._passThroughOptions = !!passThrough;\n if (!!this.parent && passThrough && !this.parent._enablePositionalOptions) {\n throw new Error('passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)');\n }\n return this;\n };\n\n /**\n * Whether to store option values as properties on command object,\n * or store separately (specify false). In both cases the option values can be accessed using .opts().\n *\n * @param {boolean} [storeAsProperties=true]\n * @return {Command} `this` command for chaining\n */\n\n storeOptionsAsProperties(storeAsProperties = true) {\n this._storeOptionsAsProperties = !!storeAsProperties;\n if (this.options.length) {\n throw new Error('call .storeOptionsAsProperties() before adding options');\n }\n return this;\n };\n\n /**\n * Retrieve option value.\n *\n * @param {string} key\n * @return {Object} value\n */\n\n getOptionValue(key) {\n if (this._storeOptionsAsProperties) {\n return this[key];\n }\n return this._optionValues[key];\n };\n\n /**\n * Store option value.\n *\n * @param {string} key\n * @param {Object} value\n * @return {Command} `this` command for chaining\n */\n\n setOptionValue(key, value) {\n if (this._storeOptionsAsProperties) {\n this[key] = value;\n } else {\n this._optionValues[key] = value;\n }\n return this;\n };\n\n /**\n * Store option value and where the value came from.\n *\n * @param {string} key\n * @param {Object} value\n * @param {string} source - expected values are default/config/env/cli\n * @return {Command} `this` command for chaining\n */\n\n setOptionValueWithSource(key, value, source) {\n this.setOptionValue(key, value);\n this._optionValueSources[key] = source;\n return this;\n }\n\n /**\n * Get source of option value.\n * Expected values are default | config | env | cli\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSource(key) {\n return this._optionValueSources[key];\n };\n\n /**\n * Get user arguments implied or explicit arguments.\n * Side-effects: set _scriptPath if args included application, and use that to set implicit command name.\n *\n * @api private\n */\n\n _prepareUserArgs(argv, parseOptions) {\n if (argv !== undefined && !Array.isArray(argv)) {\n throw new Error('first parameter to parse must be array or undefined');\n }\n parseOptions = parseOptions || {};\n\n // Default to using process.argv\n if (argv === undefined) {\n argv = process.argv;\n // @ts-ignore: unknown property\n if (process.versions && process.versions.electron) {\n parseOptions.from = 'electron';\n }\n }\n this.rawArgs = argv.slice();\n\n // make it a little easier for callers by supporting various argv conventions\n let userArgs;\n switch (parseOptions.from) {\n case undefined:\n case 'node':\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n break;\n case 'electron':\n // @ts-ignore: unknown property\n if (process.defaultApp) {\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n } else {\n userArgs = argv.slice(1);\n }\n break;\n case 'user':\n userArgs = argv.slice(0);\n break;\n default:\n throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`);\n }\n if (!this._scriptPath && require.main) {\n this._scriptPath = require.main.filename;\n }\n\n // Guess name, used in usage in help.\n this._name = this._name || (this._scriptPath && path.basename(this._scriptPath, path.extname(this._scriptPath)));\n\n return userArgs;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * The default expectation is that the arguments are from node and have the application as argv[0]\n * and the script being run in argv[1], with user parameters after that.\n *\n * @example\n * program.parse(process.argv);\n * program.parse(); // implicitly use process.argv and auto-detect node vs electron conventions\n * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv] - optional, defaults to process.argv\n * @param {Object} [parseOptions] - optionally specify style of options with from: node/user/electron\n * @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron'\n * @return {Command} `this` command for chaining\n */\n\n parse(argv, parseOptions) {\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n this._parseCommand([], userArgs);\n\n return this;\n };\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise.\n *\n * The default expectation is that the arguments are from node and have the application as argv[0]\n * and the script being run in argv[1], with user parameters after that.\n *\n * @example\n * await program.parseAsync(process.argv);\n * await program.parseAsync(); // implicitly use process.argv and auto-detect node vs electron conventions\n * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv]\n * @param {Object} [parseOptions]\n * @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron'\n * @return {Promise}\n */\n\n async parseAsync(argv, parseOptions) {\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n await this._parseCommand([], userArgs);\n\n return this;\n };\n\n /**\n * Execute a sub-command executable.\n *\n * @api private\n */\n\n _executeSubCommand(subcommand, args) {\n args = args.slice();\n let launchWithNode = false; // Use node for source targets so do not need to get permissions correct, and on Windows.\n const sourceExt = ['.js', '.ts', '.tsx', '.mjs', '.cjs'];\n\n // Not checking for help first. Unlikely to have mandatory and executable, and can't robustly test for help flags in external command.\n this._checkForMissingMandatoryOptions();\n\n // Want the entry script as the reference for command name and directory for searching for other files.\n let scriptPath = this._scriptPath;\n // Fallback in case not set, due to how Command created or called.\n if (!scriptPath && require.main) {\n scriptPath = require.main.filename;\n }\n\n let baseDir;\n try {\n const resolvedLink = fs.realpathSync(scriptPath);\n baseDir = path.dirname(resolvedLink);\n } catch (e) {\n baseDir = '.'; // dummy, probably not going to find executable!\n }\n\n // name of the subcommand, like `pm-install`\n let bin = path.basename(scriptPath, path.extname(scriptPath)) + '-' + subcommand._name;\n if (subcommand._executableFile) {\n bin = subcommand._executableFile;\n }\n\n const localBin = path.join(baseDir, bin);\n if (fs.existsSync(localBin)) {\n // prefer local `./<bin>` to bin in the $PATH\n bin = localBin;\n } else {\n // Look for source files.\n sourceExt.forEach((ext) => {\n if (fs.existsSync(`${localBin}${ext}`)) {\n bin = `${localBin}${ext}`;\n }\n });\n }\n launchWithNode = sourceExt.includes(path.extname(bin));\n\n let proc;\n if (process.platform !== 'win32') {\n if (launchWithNode) {\n args.unshift(bin);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n\n proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });\n } else {\n proc = childProcess.spawn(bin, args, { stdio: 'inherit' });\n }\n } else {\n args.unshift(bin);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });\n }\n\n const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];\n signals.forEach((signal) => {\n // @ts-ignore\n process.on(signal, () => {\n if (proc.killed === false && proc.exitCode === null) {\n proc.kill(signal);\n }\n });\n });\n\n // By default terminate process when spawned process terminates.\n // Suppressing the exit if exitCallback defined is a bit messy and of limited use, but does allow process to stay running!\n const exitCallback = this._exitCallback;\n if (!exitCallback) {\n proc.on('close', process.exit.bind(process));\n } else {\n proc.on('close', () => {\n exitCallback(new CommanderError(process.exitCode || 0, 'commander.executeSubCommandAsync', '(close)'));\n });\n }\n proc.on('error', (err) => {\n // @ts-ignore\n if (err.code === 'ENOENT') {\n const executableMissing = `'${bin}' does not exist\n - if '${subcommand._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name`;\n throw new Error(executableMissing);\n // @ts-ignore\n } else if (err.code === 'EACCES') {\n throw new Error(`'${bin}' not executable`);\n }\n if (!exitCallback) {\n process.exit(1);\n } else {\n const wrappedError = new CommanderError(1, 'commander.executeSubCommandAsync', '(error)');\n wrappedError.nestedError = err;\n exitCallback(wrappedError);\n }\n });\n\n // Store the reference to the child process\n this.runningCommand = proc;\n };\n\n /**\n * @api private\n */\n\n _dispatchSubcommand(commandName, operands, unknown) {\n const subCommand = this._findCommand(commandName);\n if (!subCommand) this.help({ error: true });\n\n if (subCommand._executableHandler) {\n this._executeSubCommand(subCommand, operands.concat(unknown));\n } else {\n return subCommand._parseCommand(operands, unknown);\n }\n };\n\n /**\n * Check this.args against expected this._args.\n *\n * @api private\n */\n\n _checkNumberOfArguments() {\n // too few\n this._args.forEach((arg, i) => {\n if (arg.required && this.args[i] == null) {\n this.missingArgument(arg.name());\n }\n });\n // too many\n if (this._args.length > 0 && this._args[this._args.length - 1].variadic) {\n return;\n }\n if (this.args.length > this._args.length) {\n this._excessArguments(this.args);\n }\n };\n\n /**\n * Process this.args using this._args and save as this.processedArgs!\n *\n * @api private\n */\n\n _processArguments() {\n const myParseArg = (argument, value, previous) => {\n // Extra processing for nice error message on parsing failure.\n let parsedValue = value;\n if (value !== null && argument.parseArg) {\n try {\n parsedValue = argument.parseArg(value, previous);\n } catch (err) {\n if (err.code === 'commander.invalidArgument') {\n const message = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'. ${err.message}`;\n this._displayError(err.exitCode, err.code, message);\n }\n throw err;\n }\n }\n return parsedValue;\n };\n\n this._checkNumberOfArguments();\n\n const processedArgs = [];\n this._args.forEach((declaredArg, index) => {\n let value = declaredArg.defaultValue;\n if (declaredArg.variadic) {\n // Collect together remaining arguments for passing together as an array.\n if (index < this.args.length) {\n value = this.args.slice(index);\n if (declaredArg.parseArg) {\n value = value.reduce((processed, v) => {\n return myParseArg(declaredArg, v, processed);\n }, declaredArg.defaultValue);\n }\n } else if (value === undefined) {\n value = [];\n }\n } else if (index < this.args.length) {\n value = this.args[index];\n if (declaredArg.parseArg) {\n value = myParseArg(declaredArg, value, declaredArg.defaultValue);\n }\n }\n processedArgs[index] = value;\n });\n this.processedArgs = processedArgs;\n }\n\n /**\n * Once we have a promise we chain, but call synchronously until then.\n *\n * @param {Promise|undefined} promise\n * @param {Function} fn\n * @return {Promise|undefined}\n * @api private\n */\n\n _chainOrCall(promise, fn) {\n // thenable\n if (promise && promise.then && typeof promise.then === 'function') {\n // already have a promise, chain callback\n return promise.then(() => fn());\n }\n // callback might return a promise\n return fn();\n }\n\n /**\n *\n * @param {Promise|undefined} promise\n * @param {string} event\n * @return {Promise|undefined}\n * @api private\n */\n\n _chainOrCallHooks(promise, event) {\n let result = promise;\n const hooks = [];\n getCommandAndParents(this)\n .reverse()\n .filter(cmd => cmd._lifeCycleHooks[event] !== undefined)\n .forEach(hookedCommand => {\n hookedCommand._lifeCycleHooks[event].forEach((callback) => {\n hooks.push({ hookedCommand, callback });\n });\n });\n if (event === 'postAction') {\n hooks.reverse();\n }\n\n hooks.forEach((hookDetail) => {\n result = this._chainOrCall(result, () => {\n return hookDetail.callback(hookDetail.hookedCommand, this);\n });\n });\n return result;\n }\n\n /**\n * Process arguments in context of this command.\n * Returns action result, in case it is a promise.\n *\n * @api private\n */\n\n _parseCommand(operands, unknown) {\n const parsed = this.parseOptions(unknown);\n this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env\n operands = operands.concat(parsed.operands);\n unknown = parsed.unknown;\n this.args = operands.concat(unknown);\n\n if (operands && this._findCommand(operands[0])) {\n return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);\n }\n if (this._hasImplicitHelpCommand() && operands[0] === this._helpCommandName) {\n if (operands.length === 1) {\n this.help();\n }\n return this._dispatchSubcommand(operands[1], [], [this._helpLongFlag]);\n }\n if (this._defaultCommandName) {\n outputHelpIfRequested(this, unknown); // Run the help for default command from parent rather than passing to default command\n return this._dispatchSubcommand(this._defaultCommandName, operands, unknown);\n }\n if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) {\n // probably missing subcommand and no handler, user needs help (and exit)\n this.help({ error: true });\n }\n\n outputHelpIfRequested(this, parsed.unknown);\n this._checkForMissingMandatoryOptions();\n\n // We do not always call this check to avoid masking a \"better\" error, like unknown command.\n const checkForUnknownOptions = () => {\n if (parsed.unknown.length > 0) {\n this.unknownOption(parsed.unknown[0]);\n }\n };\n\n const commandEvent = `command:${this.name()}`;\n if (this._actionHandler) {\n checkForUnknownOptions();\n this._processArguments();\n\n let actionResult;\n actionResult = this._chainOrCallHooks(actionResult, 'preAction');\n actionResult = this._chainOrCall(actionResult, () => this._actionHandler(this.processedArgs));\n if (this.parent) this.parent.emit(commandEvent, operands, unknown); // legacy\n actionResult = this._chainOrCallHooks(actionResult, 'postAction');\n return actionResult;\n }\n if (this.parent && this.parent.listenerCount(commandEvent)) {\n checkForUnknownOptions();\n this._processArguments();\n this.parent.emit(commandEvent, operands, unknown); // legacy\n } else if (operands.length) {\n if (this._findCommand('*')) { // legacy default command\n return this._dispatchSubcommand('*', operands, unknown);\n }\n if (this.listenerCount('command:*')) {\n // skip option check, emit event for possible misspelling suggestion\n this.emit('command:*', operands, unknown);\n } else if (this.commands.length) {\n this.unknownCommand();\n } else {\n checkForUnknownOptions();\n this._processArguments();\n }\n } else if (this.commands.length) {\n checkForUnknownOptions();\n // This command has subcommands and nothing hooked up at this level, so display help (and exit).\n this.help({ error: true });\n } else {\n checkForUnknownOptions();\n this._processArguments();\n // fall through for caller to handle after calling .parse()\n }\n };\n\n /**\n * Find matching command.\n *\n * @api private\n */\n _findCommand(name) {\n if (!name) return undefined;\n return this.commands.find(cmd => cmd._name === name || cmd._aliases.includes(name));\n };\n\n /**\n * Return an option matching `arg` if any.\n *\n * @param {string} arg\n * @return {Option}\n * @api private\n */\n\n _findOption(arg) {\n return this.options.find(option => option.is(arg));\n };\n\n /**\n * Display an error message if a mandatory option does not have a value.\n * Lazy calling after checking for help flags from leaf subcommand.\n *\n * @api private\n */\n\n _checkForMissingMandatoryOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n for (let cmd = this; cmd; cmd = cmd.parent) {\n cmd.options.forEach((anOption) => {\n if (anOption.mandatory && (cmd.getOptionValue(anOption.attributeName()) === undefined)) {\n cmd.missingMandatoryOptionValue(anOption);\n }\n });\n }\n };\n\n /**\n * Parse options from `argv` removing known options,\n * and return argv split into operands and unknown arguments.\n *\n * Examples:\n *\n * argv => operands, unknown\n * --known kkk op => [op], []\n * op --known kkk => [op], []\n * sub --unknown uuu op => [sub], [--unknown uuu op]\n * sub -- --unknown uuu op => [sub --unknown uuu op], []\n *\n * @param {String[]} argv\n * @return {{operands: String[], unknown: String[]}}\n */\n\n parseOptions(argv) {\n const operands = []; // operands, not options or values\n const unknown = []; // first unknown option and remaining unknown args\n let dest = operands;\n const args = argv.slice();\n\n function maybeOption(arg) {\n return arg.length > 1 && arg[0] === '-';\n }\n\n // parse options\n let activeVariadicOption = null;\n while (args.length) {\n const arg = args.shift();\n\n // literal\n if (arg === '--') {\n if (dest === unknown) dest.push(arg);\n dest.push(...args);\n break;\n }\n\n if (activeVariadicOption && !maybeOption(arg)) {\n this.emit(`option:${activeVariadicOption.name()}`, arg);\n continue;\n }\n activeVariadicOption = null;\n\n if (maybeOption(arg)) {\n const option = this._findOption(arg);\n // recognised option, call listener to assign value with possible custom processing\n if (option) {\n if (option.required) {\n const value = args.shift();\n if (value === undefined) this.optionMissingArgument(option);\n this.emit(`option:${option.name()}`, value);\n } else if (option.optional) {\n let value = null;\n // historical behaviour is optional value is following arg unless an option\n if (args.length > 0 && !maybeOption(args[0])) {\n value = args.shift();\n }\n this.emit(`option:${option.name()}`, value);\n } else { // boolean flag\n this.emit(`option:${option.name()}`);\n }\n activeVariadicOption = option.variadic ? option : null;\n continue;\n }\n }\n\n // Look for combo options following single dash, eat first one if known.\n if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {\n const option = this._findOption(`-${arg[1]}`);\n if (option) {\n if (option.required || (option.optional && this._combineFlagAndOptionalValue)) {\n // option with value following in same argument\n this.emit(`option:${option.name()}`, arg.slice(2));\n } else {\n // boolean option, emit and put back remainder of arg for further processing\n this.emit(`option:${option.name()}`);\n args.unshift(`-${arg.slice(2)}`);\n }\n continue;\n }\n }\n\n // Look for known long flag with value, like --foo=bar\n if (/^--[^=]+=/.test(arg)) {\n const index = arg.indexOf('=');\n const option = this._findOption(arg.slice(0, index));\n if (option && (option.required || option.optional)) {\n this.emit(`option:${option.name()}`, arg.slice(index + 1));\n continue;\n }\n }\n\n // Not a recognised option by this command.\n // Might be a command-argument, or subcommand option, or unknown option, or help command or option.\n\n // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.\n if (maybeOption(arg)) {\n dest = unknown;\n }\n\n // If using positionalOptions, stop processing our options at subcommand.\n if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) {\n if (this._findCommand(arg)) {\n operands.push(arg);\n if (args.length > 0) unknown.push(...args);\n break;\n } else if (arg === this._helpCommandName && this._hasImplicitHelpCommand()) {\n operands.push(arg);\n if (args.length > 0) operands.push(...args);\n break;\n } else if (this._defaultCommandName) {\n unknown.push(arg);\n if (args.length > 0) unknown.push(...args);\n break;\n }\n }\n\n // If using passThroughOptions, stop processing options at first command-argument.\n if (this._passThroughOptions) {\n dest.push(arg);\n if (args.length > 0) dest.push(...args);\n break;\n }\n\n // add arg\n dest.push(arg);\n }\n\n return { operands, unknown };\n };\n\n /**\n * Return an object containing options as key-value pairs\n *\n * @return {Object}\n */\n opts() {\n if (this._storeOptionsAsProperties) {\n // Preserve original behaviour so backwards compatible when still using properties\n const result = {};\n const len = this.options.length;\n\n for (let i = 0; i < len; i++) {\n const key = this.options[i].attributeName();\n result[key] = key === this._versionOptionName ? this._version : this[key];\n }\n return result;\n }\n\n return this._optionValues;\n };\n\n /**\n * Internal bottleneck for handling of parsing errors.\n *\n * @api private\n */\n _displayError(exitCode, code, message) {\n this._outputConfiguration.outputError(`${message}\\n`, this._outputConfiguration.writeErr);\n if (typeof this._showHelpAfterError === 'string') {\n this._outputConfiguration.writeErr(`${this._showHelpAfterError}\\n`);\n } else if (this._showHelpAfterError) {\n this._outputConfiguration.writeErr('\\n');\n this.outputHelp({ error: true });\n }\n this._exit(exitCode, code, message);\n }\n\n /**\n * Apply any option related environment variables, if option does\n * not have a value from cli or client code.\n *\n * @api private\n */\n _parseOptionsEnv() {\n this.options.forEach((option) => {\n if (option.envVar && option.envVar in process.env) {\n const optionKey = option.attributeName();\n // Priority check. Do not overwrite cli or options from unknown source (client-code).\n if (this.getOptionValue(optionKey) === undefined || ['default', 'config', 'env'].includes(this.getOptionValueSource(optionKey))) {\n if (option.required || option.optional) { // option can take a value\n // keep very simple, optional always takes value\n this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);\n } else { // boolean\n // keep very simple, only care that envVar defined and not the value\n this.emit(`optionEnv:${option.name()}`);\n }\n }\n }\n });\n }\n\n /**\n * Argument `name` is missing.\n *\n * @param {string} name\n * @api private\n */\n\n missingArgument(name) {\n const message = `error: missing required argument '${name}'`;\n this._displayError(1, 'commander.missingArgument', message);\n };\n\n /**\n * `Option` is missing an argument.\n *\n * @param {Option} option\n * @api private\n */\n\n optionMissingArgument(option) {\n const message = `error: option '${option.flags}' argument missing`;\n this._displayError(1, 'commander.optionMissingArgument', message);\n };\n\n /**\n * `Option` does not have a value, and is a mandatory option.\n *\n * @param {Option} option\n * @api private\n */\n\n missingMandatoryOptionValue(option) {\n const message = `error: required option '${option.flags}' not specified`;\n this._displayError(1, 'commander.missingMandatoryOptionValue', message);\n };\n\n /**\n * Unknown option `flag`.\n *\n * @param {string} flag\n * @api private\n */\n\n unknownOption(flag) {\n if (this._allowUnknownOption) return;\n let suggestion = '';\n\n if (flag.startsWith('--') && this._showSuggestionAfterError) {\n // Looping to pick up the global options too\n let candidateFlags = [];\n let command = this;\n do {\n const moreFlags = command.createHelp().visibleOptions(command)\n .filter(option => option.long)\n .map(option => option.long);\n candidateFlags = candidateFlags.concat(moreFlags);\n command = command.parent;\n } while (command && !command._enablePositionalOptions);\n suggestion = suggestSimilar(flag, candidateFlags);\n }\n\n const message = `error: unknown option '${flag}'${suggestion}`;\n this._displayError(1, 'commander.unknownOption', message);\n };\n\n /**\n * Excess arguments, more than expected.\n *\n * @param {string[]} receivedArgs\n * @api private\n */\n\n _excessArguments(receivedArgs) {\n if (this._allowExcessArguments) return;\n\n const expected = this._args.length;\n const s = (expected === 1) ? '' : 's';\n const forSubcommand = this.parent ? ` for '${this.name()}'` : '';\n const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;\n this._displayError(1, 'commander.excessArguments', message);\n };\n\n /**\n * Unknown command.\n *\n * @api private\n */\n\n unknownCommand() {\n const unknownName = this.args[0];\n let suggestion = '';\n\n if (this._showSuggestionAfterError) {\n const candidateNames = [];\n this.createHelp().visibleCommands(this).forEach((command) => {\n candidateNames.push(command.name());\n // just visible alias\n if (command.alias()) candidateNames.push(command.alias());\n });\n suggestion = suggestSimilar(unknownName, candidateNames);\n }\n\n const message = `error: unknown command '${unknownName}'${suggestion}`;\n this._displayError(1, 'commander.unknownCommand', message);\n };\n\n /**\n * Set the program version to `str`.\n *\n * This method auto-registers the \"-V, --version\" flag\n * which will print the version number when passed.\n *\n * You can optionally supply the flags and description to override the defaults.\n *\n * @param {string} str\n * @param {string} [flags]\n * @param {string} [description]\n * @return {this | string} `this` command for chaining, or version string if no arguments\n */\n\n version(str, flags, description) {\n if (str === undefined) return this._version;\n this._version = str;\n flags = flags || '-V, --version';\n description = description || 'output the version number';\n const versionOption = this.createOption(flags, description);\n this._versionOptionName = versionOption.attributeName();\n this.options.push(versionOption);\n this.on('option:' + versionOption.name(), () => {\n this._outputConfiguration.writeOut(`${str}\\n`);\n this._exit(0, 'commander.version', str);\n });\n return this;\n };\n\n /**\n * Set the description to `str`.\n *\n * @param {string} [str]\n * @param {Object} [argsDescription]\n * @return {string|Command}\n */\n description(str, argsDescription) {\n if (str === undefined && argsDescription === undefined) return this._description;\n this._description = str;\n if (argsDescription) {\n this._argsDescription = argsDescription;\n }\n return this;\n };\n\n /**\n * Set an alias for the command.\n *\n * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.\n *\n * @param {string} [alias]\n * @return {string|Command}\n */\n\n alias(alias) {\n if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility\n\n /** @type {Command} */\n let command = this;\n if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler) {\n // assume adding alias for last added executable subcommand, rather than this\n command = this.commands[this.commands.length - 1];\n }\n\n if (alias === command._name) throw new Error('Command alias can\\'t be the same as its name');\n\n command._aliases.push(alias);\n return this;\n };\n\n /**\n * Set aliases for the command.\n *\n * Only the first alias is shown in the auto-generated help.\n *\n * @param {string[]} [aliases]\n * @return {string[]|Command}\n */\n\n aliases(aliases) {\n // Getter for the array of aliases is the main reason for having aliases() in addition to alias().\n if (aliases === undefined) return this._aliases;\n\n aliases.forEach((alias) => this.alias(alias));\n return this;\n };\n\n /**\n * Set / get the command usage `str`.\n *\n * @param {string} [str]\n * @return {String|Command}\n */\n\n usage(str) {\n if (str === undefined) {\n if (this._usage) return this._usage;\n\n const args = this._args.map((arg) => {\n return humanReadableArgName(arg);\n });\n return [].concat(\n (this.options.length || this._hasHelpOption ? '[options]' : []),\n (this.commands.length ? '[command]' : []),\n (this._args.length ? args : [])\n ).join(' ');\n }\n\n this._usage = str;\n return this;\n };\n\n /**\n * Get or set the name of the command\n *\n * @param {string} [str]\n * @return {string|Command}\n */\n\n name(str) {\n if (str === undefined) return this._name;\n this._name = str;\n return this;\n };\n\n /**\n * Return program help documentation.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout\n * @return {string}\n */\n\n helpInformation(contextOptions) {\n const helper = this.createHelp();\n if (helper.helpWidth === undefined) {\n helper.helpWidth = (contextOptions && contextOptions.error) ? this._outputConfiguration.getErrHelpWidth() : this._outputConfiguration.getOutHelpWidth();\n }\n return helper.formatHelp(this, helper);\n };\n\n /**\n * @api private\n */\n\n _getHelpContext(contextOptions) {\n contextOptions = contextOptions || {};\n const context = { error: !!contextOptions.error };\n let write;\n if (context.error) {\n write = (arg) => this._outputConfiguration.writeErr(arg);\n } else {\n write = (arg) => this._outputConfiguration.writeOut(arg);\n }\n context.write = contextOptions.write || write;\n context.command = this;\n return context;\n }\n\n /**\n * Output help information for this command.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n outputHelp(contextOptions) {\n let deprecatedCallback;\n if (typeof contextOptions === 'function') {\n deprecatedCallback = contextOptions;\n contextOptions = undefined;\n }\n const context = this._getHelpContext(contextOptions);\n\n getCommandAndParents(this).reverse().forEach(command => command.emit('beforeAllHelp', context));\n this.emit('beforeHelp', context);\n\n let helpInformation = this.helpInformation(context);\n if (deprecatedCallback) {\n helpInformation = deprecatedCallback(helpInformation);\n if (typeof helpInformation !== 'string' && !Buffer.isBuffer(helpInformation)) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n }\n context.write(helpInformation);\n\n this.emit(this._helpLongFlag); // deprecated\n this.emit('afterHelp', context);\n getCommandAndParents(this).forEach(command => command.emit('afterAllHelp', context));\n };\n\n /**\n * You can pass in flags and a description to override the help\n * flags and help description for your command. Pass in false to\n * disable the built-in help option.\n *\n * @param {string | boolean} [flags]\n * @param {string} [description]\n * @return {Command} `this` command for chaining\n */\n\n helpOption(flags, description) {\n if (typeof flags === 'boolean') {\n this._hasHelpOption = flags;\n return this;\n }\n this._helpFlags = flags || this._helpFlags;\n this._helpDescription = description || this._helpDescription;\n\n const helpFlags = splitOptionFlags(this._helpFlags);\n this._helpShortFlag = helpFlags.shortFlag;\n this._helpLongFlag = helpFlags.longFlag;\n\n return this;\n };\n\n /**\n * Output help information and exit.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n help(contextOptions) {\n this.outputHelp(contextOptions);\n let exitCode = process.exitCode || 0;\n if (exitCode === 0 && contextOptions && typeof contextOptions !== 'function' && contextOptions.error) {\n exitCode = 1;\n }\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(exitCode, 'commander.help', '(outputHelp)');\n };\n\n /**\n * Add additional text to be displayed with the built-in help.\n *\n * Position is 'before' or 'after' to affect just this command,\n * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.\n *\n * @param {string} position - before or after built-in help\n * @param {string | Function} text - string to add, or a function returning a string\n * @return {Command} `this` command for chaining\n */\n addHelpText(position, text) {\n const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];\n if (!allowedValues.includes(position)) {\n throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n const helpEvent = `${position}Help`;\n this.on(helpEvent, (context) => {\n let helpStr;\n if (typeof text === 'function') {\n helpStr = text({ error: context.error, command: context.command });\n } else {\n helpStr = text;\n }\n // Ignore falsy value when nothing to output.\n if (helpStr) {\n context.write(`${helpStr}\\n`);\n }\n });\n return this;\n }\n};\n\n/**\n * Output help information if help flags specified\n *\n * @param {Command} cmd - command to output help for\n * @param {Array} args - array of options to search for help flags\n * @api private\n */\n\nfunction outputHelpIfRequested(cmd, args) {\n const helpOption = cmd._hasHelpOption && args.find(arg => arg === cmd._helpLongFlag || arg === cmd._helpShortFlag);\n if (helpOption) {\n cmd.outputHelp();\n // (Do not have all displayed text available so only passing placeholder.)\n cmd._exit(0, 'commander.helpDisplayed', '(outputHelp)');\n }\n}\n\n/**\n * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).\n *\n * @param {string[]} args - array of arguments from node.execArgv\n * @returns {string[]}\n * @api private\n */\n\nfunction incrementNodeInspectorPort(args) {\n // Testing for these options:\n // --inspect[=[host:]port]\n // --inspect-brk[=[host:]port]\n // --inspect-port=[host:]port\n return args.map((arg) => {\n if (!arg.startsWith('--inspect')) {\n return arg;\n }\n let debugOption;\n let debugHost = '127.0.0.1';\n let debugPort = '9229';\n let match;\n if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {\n // e.g. --inspect\n debugOption = match[1];\n } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {\n debugOption = match[1];\n if (/^\\d+$/.test(match[3])) {\n // e.g. --inspect=1234\n debugPort = match[3];\n } else {\n // e.g. --inspect=localhost\n debugHost = match[3];\n }\n } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\\d+)$/)) !== null) {\n // e.g. --inspect=localhost:1234\n debugOption = match[1];\n debugHost = match[3];\n debugPort = match[4];\n }\n\n if (debugOption && debugPort !== '0') {\n return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;\n }\n return arg;\n });\n}\n\n/**\n * @param {Command} startCommand\n * @returns {Command[]}\n * @api private\n */\n\nfunction getCommandAndParents(startCommand) {\n const result = [];\n for (let command = startCommand; command; command = command.parent) {\n result.push(command);\n }\n return result;\n}\n\nexports.Command = Command;\n", "const { Argument } = require('./lib/argument.js');\nconst { Command } = require('./lib/command.js');\nconst { CommanderError, InvalidArgumentError } = require('./lib/error.js');\nconst { Help } = require('./lib/help.js');\nconst { Option } = require('./lib/option.js');\n\n// @ts-check\n\n/**\n * Expose the root command.\n */\n\nexports = module.exports = new Command();\nexports.program = exports; // More explicit access to global command.\n// Implicit export of createArgument, createCommand, and createOption.\n\n/**\n * Expose classes\n */\n\nexports.Argument = Argument;\nexports.Command = Command;\nexports.CommanderError = CommanderError;\nexports.Help = Help;\nexports.InvalidArgumentError = InvalidArgumentError;\nexports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated\nexports.Option = Option;\n", "'use strict';\n\nconst { FORCE_COLOR, NODE_DISABLE_COLORS, TERM } = process.env;\n\nconst $ = {\n\tenabled: !NODE_DISABLE_COLORS && TERM !== 'dumb' && FORCE_COLOR !== '0',\n\n\t// modifiers\n\treset: init(0, 0),\n\tbold: init(1, 22),\n\tdim: init(2, 22),\n\titalic: init(3, 23),\n\tunderline: init(4, 24),\n\tinverse: init(7, 27),\n\thidden: init(8, 28),\n\tstrikethrough: init(9, 29),\n\n\t// colors\n\tblack: init(30, 39),\n\tred: init(31, 39),\n\tgreen: init(32, 39),\n\tyellow: init(33, 39),\n\tblue: init(34, 39),\n\tmagenta: init(35, 39),\n\tcyan: init(36, 39),\n\twhite: init(37, 39),\n\tgray: init(90, 39),\n\tgrey: init(90, 39),\n\n\t// background colors\n\tbgBlack: init(40, 49),\n\tbgRed: init(41, 49),\n\tbgGreen: init(42, 49),\n\tbgYellow: init(43, 49),\n\tbgBlue: init(44, 49),\n\tbgMagenta: init(45, 49),\n\tbgCyan: init(46, 49),\n\tbgWhite: init(47, 49)\n};\n\nfunction run(arr, str) {\n\tlet i=0, tmp, beg='', end='';\n\tfor (; i < arr.length; i++) {\n\t\ttmp = arr[i];\n\t\tbeg += tmp.open;\n\t\tend += tmp.close;\n\t\tif (str.includes(tmp.close)) {\n\t\t\tstr = str.replace(tmp.rgx, tmp.close + tmp.open);\n\t\t}\n\t}\n\treturn beg + str + end;\n}\n\nfunction chain(has, keys) {\n\tlet ctx = { has, keys };\n\n\tctx.reset = $.reset.bind(ctx);\n\tctx.bold = $.bold.bind(ctx);\n\tctx.dim = $.dim.bind(ctx);\n\tctx.italic = $.italic.bind(ctx);\n\tctx.underline = $.underline.bind(ctx);\n\tctx.inverse = $.inverse.bind(ctx);\n\tctx.hidden = $.hidden.bind(ctx);\n\tctx.strikethrough = $.strikethrough.bind(ctx);\n\n\tctx.black = $.black.bind(ctx);\n\tctx.red = $.red.bind(ctx);\n\tctx.green = $.green.bind(ctx);\n\tctx.yellow = $.yellow.bind(ctx);\n\tctx.blue = $.blue.bind(ctx);\n\tctx.magenta = $.magenta.bind(ctx);\n\tctx.cyan = $.cyan.bind(ctx);\n\tctx.white = $.white.bind(ctx);\n\tctx.gray = $.gray.bind(ctx);\n\tctx.grey = $.grey.bind(ctx);\n\n\tctx.bgBlack = $.bgBlack.bind(ctx);\n\tctx.bgRed = $.bgRed.bind(ctx);\n\tctx.bgGreen = $.bgGreen.bind(ctx);\n\tctx.bgYellow = $.bgYellow.bind(ctx);\n\tctx.bgBlue = $.bgBlue.bind(ctx);\n\tctx.bgMagenta = $.bgMagenta.bind(ctx);\n\tctx.bgCyan = $.bgCyan.bind(ctx);\n\tctx.bgWhite = $.bgWhite.bind(ctx);\n\n\treturn ctx;\n}\n\nfunction init(open, close) {\n\tlet blk = {\n\t\topen: `\\x1b[${open}m`,\n\t\tclose: `\\x1b[${close}m`,\n\t\trgx: new RegExp(`\\\\x1b\\\\[${close}m`, 'g')\n\t};\n\treturn function (txt) {\n\t\tif (this !== void 0 && this.has !== void 0) {\n\t\t\tthis.has.includes(open) || (this.has.push(open),this.keys.push(blk));\n\t\t\treturn txt === void 0 ? this : $.enabled ? run(this.keys, txt+'') : txt+'';\n\t\t}\n\t\treturn txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+'';\n\t};\n}\n\nmodule.exports = $;\n", "'use strict';\n\nmodule.exports = (key, isSelect) => {\n if (key.meta && key.name !== 'escape') return;\n\n if (key.ctrl) {\n if (key.name === 'a') return 'first';\n if (key.name === 'c') return 'abort';\n if (key.name === 'd') return 'abort';\n if (key.name === 'e') return 'last';\n if (key.name === 'g') return 'reset';\n }\n\n if (isSelect) {\n if (key.name === 'j') return 'down';\n if (key.name === 'k') return 'up';\n }\n\n if (key.name === 'return') return 'submit';\n if (key.name === 'enter') return 'submit'; // ctrl + J\n\n if (key.name === 'backspace') return 'delete';\n if (key.name === 'delete') return 'deleteForward';\n if (key.name === 'abort') return 'abort';\n if (key.name === 'escape') return 'exit';\n if (key.name === 'tab') return 'next';\n if (key.name === 'pagedown') return 'nextPage';\n if (key.name === 'pageup') return 'prevPage'; // TODO create home() in prompt types (e.g. TextPrompt)\n\n if (key.name === 'home') return 'home'; // TODO create end() in prompt types (e.g. TextPrompt)\n\n if (key.name === 'end') return 'end';\n if (key.name === 'up') return 'up';\n if (key.name === 'down') return 'down';\n if (key.name === 'right') return 'right';\n if (key.name === 'left') return 'left';\n return false;\n};", "'use strict';\n\nmodule.exports = str => {\n const pattern = ['[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)', '(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PRZcf-ntqry=><~]))'].join('|');\n const RGX = new RegExp(pattern, 'g');\n return typeof str === 'string' ? str.replace(RGX, '') : str;\n};", "'use strict';\n\nconst ESC = '\\x1B';\nconst CSI = `${ESC}[`;\nconst beep = '\\u0007';\n\nconst cursor = {\n to(x, y) {\n if (!y) return `${CSI}${x + 1}G`;\n return `${CSI}${y + 1};${x + 1}H`;\n },\n move(x, y) {\n let ret = '';\n\n if (x < 0) ret += `${CSI}${-x}D`;\n else if (x > 0) ret += `${CSI}${x}C`;\n\n if (y < 0) ret += `${CSI}${-y}A`;\n else if (y > 0) ret += `${CSI}${y}B`;\n\n return ret;\n },\n up: (count = 1) => `${CSI}${count}A`,\n down: (count = 1) => `${CSI}${count}B`,\n forward: (count = 1) => `${CSI}${count}C`,\n backward: (count = 1) => `${CSI}${count}D`,\n nextLine: (count = 1) => `${CSI}E`.repeat(count),\n prevLine: (count = 1) => `${CSI}F`.repeat(count),\n left: `${CSI}G`,\n hide: `${CSI}?25l`,\n show: `${CSI}?25h`,\n save: `${ESC}7`,\n restore: `${ESC}8`\n}\n\nconst scroll = {\n up: (count = 1) => `${CSI}S`.repeat(count),\n down: (count = 1) => `${CSI}T`.repeat(count)\n}\n\nconst erase = {\n screen: `${CSI}2J`,\n up: (count = 1) => `${CSI}1J`.repeat(count),\n down: (count = 1) => `${CSI}J`.repeat(count),\n line: `${CSI}2K`,\n lineEnd: `${CSI}K`,\n lineStart: `${CSI}1K`,\n lines(count) {\n let clear = '';\n for (let i = 0; i < count; i++)\n clear += this.line + (i < count - 1 ? cursor.up() : '');\n if (count)\n clear += cursor.left;\n return clear;\n }\n}\n\nmodule.exports = { cursor, scroll, erase, beep };\n", "'use strict';\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\n\nconst strip = require('./strip');\n\nconst _require = require('sisteransi'),\n erase = _require.erase,\n cursor = _require.cursor;\n\nconst width = str => [...strip(str)].length;\n/**\n * @param {string} prompt\n * @param {number} perLine\n */\n\n\nmodule.exports = function (prompt, perLine) {\n if (!perLine) return erase.line + cursor.to(0);\n let rows = 0;\n const lines = prompt.split(/\\r?\\n/);\n\n var _iterator = _createForOfIteratorHelper(lines),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n let line = _step.value;\n rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / perLine);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return erase.lines(rows);\n};", "'use strict';\n\nconst main = {\n arrowUp: '\u2191',\n arrowDown: '\u2193',\n arrowLeft: '\u2190',\n arrowRight: '\u2192',\n radioOn: '\u25C9',\n radioOff: '\u25EF',\n tick: '\u2714',\n cross: '\u2716',\n ellipsis: '\u2026',\n pointerSmall: '\u203A',\n line: '\u2500',\n pointer: '\u276F'\n};\nconst win = {\n arrowUp: main.arrowUp,\n arrowDown: main.arrowDown,\n arrowLeft: main.arrowLeft,\n arrowRight: main.arrowRight,\n radioOn: '(*)',\n radioOff: '( )',\n tick: '\u221A',\n cross: '\u00D7',\n ellipsis: '...',\n pointerSmall: '\u00BB',\n line: '\u2500',\n pointer: '>'\n};\nconst figures = process.platform === 'win32' ? win : main;\nmodule.exports = figures;", "'use strict';\n\nconst c = require('kleur');\n\nconst figures = require('./figures'); // rendering user input.\n\n\nconst styles = Object.freeze({\n password: {\n scale: 1,\n render: input => '*'.repeat(input.length)\n },\n emoji: {\n scale: 2,\n render: input => '\uD83D\uDE03'.repeat(input.length)\n },\n invisible: {\n scale: 0,\n render: input => ''\n },\n default: {\n scale: 1,\n render: input => `${input}`\n }\n});\n\nconst render = type => styles[type] || styles.default; // icon to signalize a prompt.\n\n\nconst symbols = Object.freeze({\n aborted: c.red(figures.cross),\n done: c.green(figures.tick),\n exited: c.yellow(figures.cross),\n default: c.cyan('?')\n});\n\nconst symbol = (done, aborted, exited) => aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default; // between the question and the user's input.\n\n\nconst delimiter = completing => c.gray(completing ? figures.ellipsis : figures.pointerSmall);\n\nconst item = (expandable, expanded) => c.gray(expandable ? expanded ? figures.pointerSmall : '+' : figures.line);\n\nmodule.exports = {\n styles,\n render,\n symbols,\n symbol,\n delimiter,\n item\n};", "'use strict';\n\nconst strip = require('./strip');\n/**\n * @param {string} msg\n * @param {number} perLine\n */\n\n\nmodule.exports = function (msg, perLine) {\n let lines = String(strip(msg) || '').split(/\\r?\\n/);\n if (!perLine) return lines.length;\n return lines.map(l => Math.ceil(l.length / perLine)).reduce((a, b) => a + b);\n};", "'use strict';\n/**\n * @param {string} msg The message to wrap\n * @param {object} opts\n * @param {number|string} [opts.margin] Left margin\n * @param {number} opts.width Maximum characters per line including the margin\n */\n\nmodule.exports = (msg, opts = {}) => {\n const tab = Number.isSafeInteger(parseInt(opts.margin)) ? new Array(parseInt(opts.margin)).fill(' ').join('') : opts.margin || '';\n const width = opts.width;\n return (msg || '').split(/\\r?\\n/g).map(line => line.split(/\\s+/g).reduce((arr, w) => {\n if (w.length + tab.length >= width || arr[arr.length - 1].length + w.length + 1 < width) arr[arr.length - 1] += ` ${w}`;else arr.push(`${tab}${w}`);\n return arr;\n }, [tab]).join('\\n')).join('\\n');\n};", "'use strict';\n/**\n * Determine what entries should be displayed on the screen, based on the\n * currently selected index and the maximum visible. Used in list-based\n * prompts like `select` and `multiselect`.\n *\n * @param {number} cursor the currently selected entry\n * @param {number} total the total entries available to display\n * @param {number} [maxVisible] the number of entries that can be displayed\n */\n\nmodule.exports = (cursor, total, maxVisible) => {\n maxVisible = maxVisible || total;\n let startIndex = Math.min(total - maxVisible, cursor - Math.floor(maxVisible / 2));\n if (startIndex < 0) startIndex = 0;\n let endIndex = Math.min(startIndex + maxVisible, total);\n return {\n startIndex,\n endIndex\n };\n};", "'use strict';\n\nmodule.exports = {\n action: require('./action'),\n clear: require('./clear'),\n style: require('./style'),\n strip: require('./strip'),\n figures: require('./figures'),\n lines: require('./lines'),\n wrap: require('./wrap'),\n entriesToDisplay: require('./entriesToDisplay')\n};", "'use strict';\n\nconst readline = require('readline');\n\nconst _require = require('../util'),\n action = _require.action;\n\nconst EventEmitter = require('events');\n\nconst _require2 = require('sisteransi'),\n beep = _require2.beep,\n cursor = _require2.cursor;\n\nconst color = require('kleur');\n/**\n * Base prompt skeleton\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\n\n\nclass Prompt extends EventEmitter {\n constructor(opts = {}) {\n super();\n this.firstRender = true;\n this.in = opts.stdin || process.stdin;\n this.out = opts.stdout || process.stdout;\n\n this.onRender = (opts.onRender || (() => void 0)).bind(this);\n\n const rl = readline.createInterface({\n input: this.in,\n escapeCodeTimeout: 50\n });\n readline.emitKeypressEvents(this.in, rl);\n if (this.in.isTTY) this.in.setRawMode(true);\n const isSelect = ['SelectPrompt', 'MultiselectPrompt'].indexOf(this.constructor.name) > -1;\n\n const keypress = (str, key) => {\n let a = action(key, isSelect);\n\n if (a === false) {\n this._ && this._(str, key);\n } else if (typeof this[a] === 'function') {\n this[a](key);\n } else {\n this.bell();\n }\n };\n\n this.close = () => {\n this.out.write(cursor.show);\n this.in.removeListener('keypress', keypress);\n if (this.in.isTTY) this.in.setRawMode(false);\n rl.close();\n this.emit(this.aborted ? 'abort' : this.exited ? 'exit' : 'submit', this.value);\n this.closed = true;\n };\n\n this.in.on('keypress', keypress);\n }\n\n fire() {\n this.emit('state', {\n value: this.value,\n aborted: !!this.aborted,\n exited: !!this.exited\n });\n }\n\n bell() {\n this.out.write(beep);\n }\n\n render() {\n this.onRender(color);\n if (this.firstRender) this.firstRender = false;\n }\n\n}\n\nmodule.exports = Prompt;", "\"use strict\";\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nconst color = require('kleur');\n\nconst Prompt = require('./prompt');\n\nconst _require = require('sisteransi'),\n erase = _require.erase,\n cursor = _require.cursor;\n\nconst _require2 = require('../util'),\n style = _require2.style,\n clear = _require2.clear,\n lines = _require2.lines,\n figures = _require2.figures;\n/**\n * TextPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {String} [opts.style='default'] Render style\n * @param {String} [opts.initial] Default value\n * @param {Function} [opts.validate] Validate function\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {String} [opts.error] The invalid error label\n */\n\n\nclass TextPrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.transform = style.render(opts.style);\n this.scale = this.transform.scale;\n this.msg = opts.message;\n this.initial = opts.initial || ``;\n\n this.validator = opts.validate || (() => true);\n\n this.value = ``;\n this.errorMsg = opts.error || `Please Enter A Valid Value`;\n this.cursor = Number(!!this.initial);\n this.cursorOffset = 0;\n this.clear = clear(``, this.out.columns);\n this.render();\n }\n\n set value(v) {\n if (!v && this.initial) {\n this.placeholder = true;\n this.rendered = color.gray(this.transform.render(this.initial));\n } else {\n this.placeholder = false;\n this.rendered = this.transform.render(v);\n }\n\n this._value = v;\n this.fire();\n }\n\n get value() {\n return this._value;\n }\n\n reset() {\n this.value = ``;\n this.cursor = Number(!!this.initial);\n this.cursorOffset = 0;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.value = this.value || this.initial;\n this.done = this.aborted = true;\n this.error = false;\n this.red = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n validate() {\n var _this = this;\n\n return _asyncToGenerator(function* () {\n let valid = yield _this.validator(_this.value);\n\n if (typeof valid === `string`) {\n _this.errorMsg = valid;\n valid = false;\n }\n\n _this.error = !valid;\n })();\n }\n\n submit() {\n var _this2 = this;\n\n return _asyncToGenerator(function* () {\n _this2.value = _this2.value || _this2.initial;\n _this2.cursorOffset = 0;\n _this2.cursor = _this2.rendered.length;\n yield _this2.validate();\n\n if (_this2.error) {\n _this2.red = true;\n\n _this2.fire();\n\n _this2.render();\n\n return;\n }\n\n _this2.done = true;\n _this2.aborted = false;\n\n _this2.fire();\n\n _this2.render();\n\n _this2.out.write('\\n');\n\n _this2.close();\n })();\n }\n\n next() {\n if (!this.placeholder) return this.bell();\n this.value = this.initial;\n this.cursor = this.rendered.length;\n this.fire();\n this.render();\n }\n\n moveCursor(n) {\n if (this.placeholder) return;\n this.cursor = this.cursor + n;\n this.cursorOffset += n;\n }\n\n _(c, key) {\n let s1 = this.value.slice(0, this.cursor);\n let s2 = this.value.slice(this.cursor);\n this.value = `${s1}${c}${s2}`;\n this.red = false;\n this.cursor = this.placeholder ? 0 : s1.length + 1;\n this.render();\n }\n\n delete() {\n if (this.isCursorAtStart()) return this.bell();\n let s1 = this.value.slice(0, this.cursor - 1);\n let s2 = this.value.slice(this.cursor);\n this.value = `${s1}${s2}`;\n this.red = false;\n\n if (this.isCursorAtStart()) {\n this.cursorOffset = 0;\n } else {\n this.cursorOffset++;\n this.moveCursor(-1);\n }\n\n this.render();\n }\n\n deleteForward() {\n if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell();\n let s1 = this.value.slice(0, this.cursor);\n let s2 = this.value.slice(this.cursor + 1);\n this.value = `${s1}${s2}`;\n this.red = false;\n\n if (this.isCursorAtEnd()) {\n this.cursorOffset = 0;\n } else {\n this.cursorOffset++;\n }\n\n this.render();\n }\n\n first() {\n this.cursor = 0;\n this.render();\n }\n\n last() {\n this.cursor = this.value.length;\n this.render();\n }\n\n left() {\n if (this.cursor <= 0 || this.placeholder) return this.bell();\n this.moveCursor(-1);\n this.render();\n }\n\n right() {\n if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell();\n this.moveCursor(1);\n this.render();\n }\n\n isCursorAtStart() {\n return this.cursor === 0 || this.placeholder && this.cursor === 1;\n }\n\n isCursorAtEnd() {\n return this.cursor === this.rendered.length || this.placeholder && this.cursor === this.rendered.length + 1;\n }\n\n render() {\n if (this.closed) return;\n\n if (!this.firstRender) {\n if (this.outputError) this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));\n this.out.write(clear(this.outputText, this.out.columns));\n }\n\n super.render();\n this.outputError = '';\n this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.red ? color.red(this.rendered) : this.rendered].join(` `);\n\n if (this.error) {\n this.outputError += this.errorMsg.split(`\\n`).reduce((a, l, i) => a + `\\n${i ? ' ' : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n }\n\n this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore + cursor.move(this.cursorOffset, 0));\n }\n\n}\n\nmodule.exports = TextPrompt;", "'use strict';\n\nconst color = require('kleur');\n\nconst Prompt = require('./prompt');\n\nconst _require = require('../util'),\n style = _require.style,\n clear = _require.clear,\n figures = _require.figures,\n wrap = _require.wrap,\n entriesToDisplay = _require.entriesToDisplay;\n\nconst _require2 = require('sisteransi'),\n cursor = _require2.cursor;\n/**\n * SelectPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Array} opts.choices Array of choice objects\n * @param {String} [opts.hint] Hint to display\n * @param {Number} [opts.initial] Index of default value\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {Number} [opts.optionsPerPage=10] Max options to display at once\n */\n\n\nclass SelectPrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.msg = opts.message;\n this.hint = opts.hint || '- Use arrow-keys. Return to submit.';\n this.warn = opts.warn || '- This option is disabled';\n this.cursor = opts.initial || 0;\n this.choices = opts.choices.map((ch, idx) => {\n if (typeof ch === 'string') ch = {\n title: ch,\n value: idx\n };\n return {\n title: ch && (ch.title || ch.value || ch),\n value: ch && (ch.value === undefined ? idx : ch.value),\n description: ch && ch.description,\n selected: ch && ch.selected,\n disabled: ch && ch.disabled\n };\n });\n this.optionsPerPage = opts.optionsPerPage || 10;\n this.value = (this.choices[this.cursor] || {}).value;\n this.clear = clear('', this.out.columns);\n this.render();\n }\n\n moveCursor(n) {\n this.cursor = n;\n this.value = this.choices[n].value;\n this.fire();\n }\n\n reset() {\n this.moveCursor(0);\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n if (!this.selection.disabled) {\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n } else this.bell();\n }\n\n first() {\n this.moveCursor(0);\n this.render();\n }\n\n last() {\n this.moveCursor(this.choices.length - 1);\n this.render();\n }\n\n up() {\n if (this.cursor === 0) {\n this.moveCursor(this.choices.length - 1);\n } else {\n this.moveCursor(this.cursor - 1);\n }\n\n this.render();\n }\n\n down() {\n if (this.cursor === this.choices.length - 1) {\n this.moveCursor(0);\n } else {\n this.moveCursor(this.cursor + 1);\n }\n\n this.render();\n }\n\n next() {\n this.moveCursor((this.cursor + 1) % this.choices.length);\n this.render();\n }\n\n _(c, key) {\n if (c === ' ') return this.submit();\n }\n\n get selection() {\n return this.choices[this.cursor];\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n\n let _entriesToDisplay = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage),\n startIndex = _entriesToDisplay.startIndex,\n endIndex = _entriesToDisplay.endIndex; // Print prompt\n\n\n this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.done ? this.selection.title : this.selection.disabled ? color.yellow(this.warn) : color.gray(this.hint)].join(' '); // Print choices\n\n if (!this.done) {\n this.outputText += '\\n';\n\n for (let i = startIndex; i < endIndex; i++) {\n let title,\n prefix,\n desc = '',\n v = this.choices[i]; // Determine whether to display \"more choices\" indicators\n\n if (i === startIndex && startIndex > 0) {\n prefix = figures.arrowUp;\n } else if (i === endIndex - 1 && endIndex < this.choices.length) {\n prefix = figures.arrowDown;\n } else {\n prefix = ' ';\n }\n\n if (v.disabled) {\n title = this.cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);\n prefix = (this.cursor === i ? color.bold().gray(figures.pointer) + ' ' : ' ') + prefix;\n } else {\n title = this.cursor === i ? color.cyan().underline(v.title) : v.title;\n prefix = (this.cursor === i ? color.cyan(figures.pointer) + ' ' : ' ') + prefix;\n\n if (v.description && this.cursor === i) {\n desc = ` - ${v.description}`;\n\n if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\\r?\\n/).length > 1) {\n desc = '\\n' + wrap(v.description, {\n margin: 3,\n width: this.out.columns\n });\n }\n }\n }\n\n this.outputText += `${prefix} ${title}${color.gray(desc)}\\n`;\n }\n }\n\n this.out.write(this.outputText);\n }\n\n}\n\nmodule.exports = SelectPrompt;", "\"use strict\";\n\nconst color = require('kleur');\n\nconst Prompt = require('./prompt');\n\nconst _require = require('../util'),\n style = _require.style,\n clear = _require.clear;\n\nconst _require2 = require('sisteransi'),\n cursor = _require2.cursor,\n erase = _require2.erase;\n/**\n * TogglePrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Boolean} [opts.initial=false] Default value\n * @param {String} [opts.active='no'] Active label\n * @param {String} [opts.inactive='off'] Inactive label\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\n\n\nclass TogglePrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.msg = opts.message;\n this.value = !!opts.initial;\n this.active = opts.active || 'on';\n this.inactive = opts.inactive || 'off';\n this.initialValue = this.value;\n this.render();\n }\n\n reset() {\n this.value = this.initialValue;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n deactivate() {\n if (this.value === false) return this.bell();\n this.value = false;\n this.render();\n }\n\n activate() {\n if (this.value === true) return this.bell();\n this.value = true;\n this.render();\n }\n\n delete() {\n this.deactivate();\n }\n\n left() {\n this.deactivate();\n }\n\n right() {\n this.activate();\n }\n\n down() {\n this.deactivate();\n }\n\n up() {\n this.activate();\n }\n\n next() {\n this.value = !this.value;\n this.fire();\n this.render();\n }\n\n _(c, key) {\n if (c === ' ') {\n this.value = !this.value;\n } else if (c === '1') {\n this.value = true;\n } else if (c === '0') {\n this.value = false;\n } else return this.bell();\n\n this.render();\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.value ? this.inactive : color.cyan().underline(this.inactive), color.gray('/'), this.value ? color.cyan().underline(this.active) : this.active].join(' ');\n this.out.write(erase.line + cursor.to(0) + this.outputText);\n }\n\n}\n\nmodule.exports = TogglePrompt;", "'use strict';\n\nclass DatePart {\n constructor({\n token,\n date,\n parts,\n locales\n }) {\n this.token = token;\n this.date = date || new Date();\n this.parts = parts || [this];\n this.locales = locales || {};\n }\n\n up() {}\n\n down() {}\n\n next() {\n const currentIdx = this.parts.indexOf(this);\n return this.parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);\n }\n\n setTo(val) {}\n\n prev() {\n let parts = [].concat(this.parts).reverse();\n const currentIdx = parts.indexOf(this);\n return parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);\n }\n\n toString() {\n return String(this.date);\n }\n\n}\n\nmodule.exports = DatePart;", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Meridiem extends DatePart {\n constructor(opts = {}) {\n super(opts);\n }\n\n up() {\n this.date.setHours((this.date.getHours() + 12) % 24);\n }\n\n down() {\n this.up();\n }\n\n toString() {\n let meridiem = this.date.getHours() > 12 ? 'pm' : 'am';\n return /\\A/.test(this.token) ? meridiem.toUpperCase() : meridiem;\n }\n\n}\n\nmodule.exports = Meridiem;", "'use strict';\n\nconst DatePart = require('./datepart');\n\nconst pos = n => {\n n = n % 10;\n return n === 1 ? 'st' : n === 2 ? 'nd' : n === 3 ? 'rd' : 'th';\n};\n\nclass Day extends DatePart {\n constructor(opts = {}) {\n super(opts);\n }\n\n up() {\n this.date.setDate(this.date.getDate() + 1);\n }\n\n down() {\n this.date.setDate(this.date.getDate() - 1);\n }\n\n setTo(val) {\n this.date.setDate(parseInt(val.substr(-2)));\n }\n\n toString() {\n let date = this.date.getDate();\n let day = this.date.getDay();\n return this.token === 'DD' ? String(date).padStart(2, '0') : this.token === 'Do' ? date + pos(date) : this.token === 'd' ? day + 1 : this.token === 'ddd' ? this.locales.weekdaysShort[day] : this.token === 'dddd' ? this.locales.weekdays[day] : date;\n }\n\n}\n\nmodule.exports = Day;", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Hours extends DatePart {\n constructor(opts = {}) {\n super(opts);\n }\n\n up() {\n this.date.setHours(this.date.getHours() + 1);\n }\n\n down() {\n this.date.setHours(this.date.getHours() - 1);\n }\n\n setTo(val) {\n this.date.setHours(parseInt(val.substr(-2)));\n }\n\n toString() {\n let hours = this.date.getHours();\n if (/h/.test(this.token)) hours = hours % 12 || 12;\n return this.token.length > 1 ? String(hours).padStart(2, '0') : hours;\n }\n\n}\n\nmodule.exports = Hours;", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Milliseconds extends DatePart {\n constructor(opts = {}) {\n super(opts);\n }\n\n up() {\n this.date.setMilliseconds(this.date.getMilliseconds() + 1);\n }\n\n down() {\n this.date.setMilliseconds(this.date.getMilliseconds() - 1);\n }\n\n setTo(val) {\n this.date.setMilliseconds(parseInt(val.substr(-this.token.length)));\n }\n\n toString() {\n return String(this.date.getMilliseconds()).padStart(4, '0').substr(0, this.token.length);\n }\n\n}\n\nmodule.exports = Milliseconds;", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Minutes extends DatePart {\n constructor(opts = {}) {\n super(opts);\n }\n\n up() {\n this.date.setMinutes(this.date.getMinutes() + 1);\n }\n\n down() {\n this.date.setMinutes(this.date.getMinutes() - 1);\n }\n\n setTo(val) {\n this.date.setMinutes(parseInt(val.substr(-2)));\n }\n\n toString() {\n let m = this.date.getMinutes();\n return this.token.length > 1 ? String(m).padStart(2, '0') : m;\n }\n\n}\n\nmodule.exports = Minutes;", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Month extends DatePart {\n constructor(opts = {}) {\n super(opts);\n }\n\n up() {\n this.date.setMonth(this.date.getMonth() + 1);\n }\n\n down() {\n this.date.setMonth(this.date.getMonth() - 1);\n }\n\n setTo(val) {\n val = parseInt(val.substr(-2)) - 1;\n this.date.setMonth(val < 0 ? 0 : val);\n }\n\n toString() {\n let month = this.date.getMonth();\n let tl = this.token.length;\n return tl === 2 ? String(month + 1).padStart(2, '0') : tl === 3 ? this.locales.monthsShort[month] : tl === 4 ? this.locales.months[month] : String(month + 1);\n }\n\n}\n\nmodule.exports = Month;", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Seconds extends DatePart {\n constructor(opts = {}) {\n super(opts);\n }\n\n up() {\n this.date.setSeconds(this.date.getSeconds() + 1);\n }\n\n down() {\n this.date.setSeconds(this.date.getSeconds() - 1);\n }\n\n setTo(val) {\n this.date.setSeconds(parseInt(val.substr(-2)));\n }\n\n toString() {\n let s = this.date.getSeconds();\n return this.token.length > 1 ? String(s).padStart(2, '0') : s;\n }\n\n}\n\nmodule.exports = Seconds;", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Year extends DatePart {\n constructor(opts = {}) {\n super(opts);\n }\n\n up() {\n this.date.setFullYear(this.date.getFullYear() + 1);\n }\n\n down() {\n this.date.setFullYear(this.date.getFullYear() - 1);\n }\n\n setTo(val) {\n this.date.setFullYear(val.substr(-4));\n }\n\n toString() {\n let year = String(this.date.getFullYear()).padStart(4, '0');\n return this.token.length === 2 ? year.substr(-2) : year;\n }\n\n}\n\nmodule.exports = Year;", "'use strict';\n\nmodule.exports = {\n DatePart: require('./datepart'),\n Meridiem: require('./meridiem'),\n Day: require('./day'),\n Hours: require('./hours'),\n Milliseconds: require('./milliseconds'),\n Minutes: require('./minutes'),\n Month: require('./month'),\n Seconds: require('./seconds'),\n Year: require('./year')\n};", "'use strict';\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nconst color = require('kleur');\n\nconst Prompt = require('./prompt');\n\nconst _require = require('../util'),\n style = _require.style,\n clear = _require.clear,\n figures = _require.figures;\n\nconst _require2 = require('sisteransi'),\n erase = _require2.erase,\n cursor = _require2.cursor;\n\nconst _require3 = require('../dateparts'),\n DatePart = _require3.DatePart,\n Meridiem = _require3.Meridiem,\n Day = _require3.Day,\n Hours = _require3.Hours,\n Milliseconds = _require3.Milliseconds,\n Minutes = _require3.Minutes,\n Month = _require3.Month,\n Seconds = _require3.Seconds,\n Year = _require3.Year;\n\nconst regex = /\\\\(.)|\"((?:\\\\[\"\\\\]|[^\"])+)\"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;\nconst regexGroups = {\n 1: ({\n token\n }) => token.replace(/\\\\(.)/g, '$1'),\n 2: opts => new Day(opts),\n // Day // TODO\n 3: opts => new Month(opts),\n // Month\n 4: opts => new Year(opts),\n // Year\n 5: opts => new Meridiem(opts),\n // AM/PM // TODO (special)\n 6: opts => new Hours(opts),\n // Hours\n 7: opts => new Minutes(opts),\n // Minutes\n 8: opts => new Seconds(opts),\n // Seconds\n 9: opts => new Milliseconds(opts) // Fractional seconds\n\n};\nconst dfltLocales = {\n months: 'January,February,March,April,May,June,July,August,September,October,November,December'.split(','),\n monthsShort: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),\n weekdays: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),\n weekdaysShort: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(',')\n};\n/**\n * DatePrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Number} [opts.initial] Index of default value\n * @param {String} [opts.mask] The format mask\n * @param {object} [opts.locales] The date locales\n * @param {String} [opts.error] The error message shown on invalid value\n * @param {Function} [opts.validate] Function to validate the submitted value\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\n\nclass DatePrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.msg = opts.message;\n this.cursor = 0;\n this.typed = '';\n this.locales = Object.assign(dfltLocales, opts.locales);\n this._date = opts.initial || new Date();\n this.errorMsg = opts.error || 'Please Enter A Valid Value';\n\n this.validator = opts.validate || (() => true);\n\n this.mask = opts.mask || 'YYYY-MM-DD HH:mm:ss';\n this.clear = clear('', this.out.columns);\n this.render();\n }\n\n get value() {\n return this.date;\n }\n\n get date() {\n return this._date;\n }\n\n set date(date) {\n if (date) this._date.setTime(date.getTime());\n }\n\n set mask(mask) {\n let result;\n this.parts = [];\n\n while (result = regex.exec(mask)) {\n let match = result.shift();\n let idx = result.findIndex(gr => gr != null);\n this.parts.push(idx in regexGroups ? regexGroups[idx]({\n token: result[idx] || match,\n date: this.date,\n parts: this.parts,\n locales: this.locales\n }) : result[idx] || match);\n }\n\n let parts = this.parts.reduce((arr, i) => {\n if (typeof i === 'string' && typeof arr[arr.length - 1] === 'string') arr[arr.length - 1] += i;else arr.push(i);\n return arr;\n }, []);\n this.parts.splice(0);\n this.parts.push(...parts);\n this.reset();\n }\n\n moveCursor(n) {\n this.typed = '';\n this.cursor = n;\n this.fire();\n }\n\n reset() {\n this.moveCursor(this.parts.findIndex(p => p instanceof DatePart));\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.error = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n validate() {\n var _this = this;\n\n return _asyncToGenerator(function* () {\n let valid = yield _this.validator(_this.value);\n\n if (typeof valid === 'string') {\n _this.errorMsg = valid;\n valid = false;\n }\n\n _this.error = !valid;\n })();\n }\n\n submit() {\n var _this2 = this;\n\n return _asyncToGenerator(function* () {\n yield _this2.validate();\n\n if (_this2.error) {\n _this2.color = 'red';\n\n _this2.fire();\n\n _this2.render();\n\n return;\n }\n\n _this2.done = true;\n _this2.aborted = false;\n\n _this2.fire();\n\n _this2.render();\n\n _this2.out.write('\\n');\n\n _this2.close();\n })();\n }\n\n up() {\n this.typed = '';\n this.parts[this.cursor].up();\n this.render();\n }\n\n down() {\n this.typed = '';\n this.parts[this.cursor].down();\n this.render();\n }\n\n left() {\n let prev = this.parts[this.cursor].prev();\n if (prev == null) return this.bell();\n this.moveCursor(this.parts.indexOf(prev));\n this.render();\n }\n\n right() {\n let next = this.parts[this.cursor].next();\n if (next == null) return this.bell();\n this.moveCursor(this.parts.indexOf(next));\n this.render();\n }\n\n next() {\n let next = this.parts[this.cursor].next();\n this.moveCursor(next ? this.parts.indexOf(next) : this.parts.findIndex(part => part instanceof DatePart));\n this.render();\n }\n\n _(c) {\n if (/\\d/.test(c)) {\n this.typed += c;\n this.parts[this.cursor].setTo(this.typed);\n this.render();\n }\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);else this.out.write(clear(this.outputText, this.out.columns));\n super.render(); // Print prompt\n\n this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.parts.reduce((arr, p, idx) => arr.concat(idx === this.cursor && !this.done ? color.cyan().underline(p.toString()) : p), []).join('')].join(' '); // Print error\n\n if (this.error) {\n this.outputText += this.errorMsg.split('\\n').reduce((a, l, i) => a + `\\n${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n }\n\n this.out.write(erase.line + cursor.to(0) + this.outputText);\n }\n\n}\n\nmodule.exports = DatePrompt;", "\"use strict\";\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nconst color = require('kleur');\n\nconst Prompt = require('./prompt');\n\nconst _require = require('sisteransi'),\n cursor = _require.cursor,\n erase = _require.erase;\n\nconst _require2 = require('../util'),\n style = _require2.style,\n figures = _require2.figures,\n clear = _require2.clear,\n lines = _require2.lines;\n\nconst isNumber = /[0-9]/;\n\nconst isDef = any => any !== undefined;\n\nconst round = (number, precision) => {\n let factor = Math.pow(10, precision);\n return Math.round(number * factor) / factor;\n};\n/**\n * NumberPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {String} [opts.style='default'] Render style\n * @param {Number} [opts.initial] Default value\n * @param {Number} [opts.max=+Infinity] Max value\n * @param {Number} [opts.min=-Infinity] Min value\n * @param {Boolean} [opts.float=false] Parse input as floats\n * @param {Number} [opts.round=2] Round floats to x decimals\n * @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n * @param {Function} [opts.validate] Validate function\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {String} [opts.error] The invalid error label\n */\n\n\nclass NumberPrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.transform = style.render(opts.style);\n this.msg = opts.message;\n this.initial = isDef(opts.initial) ? opts.initial : '';\n this.float = !!opts.float;\n this.round = opts.round || 2;\n this.inc = opts.increment || 1;\n this.min = isDef(opts.min) ? opts.min : -Infinity;\n this.max = isDef(opts.max) ? opts.max : Infinity;\n this.errorMsg = opts.error || `Please Enter A Valid Value`;\n\n this.validator = opts.validate || (() => true);\n\n this.color = `cyan`;\n this.value = ``;\n this.typed = ``;\n this.lastHit = 0;\n this.render();\n }\n\n set value(v) {\n if (!v && v !== 0) {\n this.placeholder = true;\n this.rendered = color.gray(this.transform.render(`${this.initial}`));\n this._value = ``;\n } else {\n this.placeholder = false;\n this.rendered = this.transform.render(`${round(v, this.round)}`);\n this._value = round(v, this.round);\n }\n\n this.fire();\n }\n\n get value() {\n return this._value;\n }\n\n parse(x) {\n return this.float ? parseFloat(x) : parseInt(x);\n }\n\n valid(c) {\n return c === `-` || c === `.` && this.float || isNumber.test(c);\n }\n\n reset() {\n this.typed = ``;\n this.value = ``;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n let x = this.value;\n this.value = x !== `` ? x : this.initial;\n this.done = this.aborted = true;\n this.error = false;\n this.fire();\n this.render();\n this.out.write(`\\n`);\n this.close();\n }\n\n validate() {\n var _this = this;\n\n return _asyncToGenerator(function* () {\n let valid = yield _this.validator(_this.value);\n\n if (typeof valid === `string`) {\n _this.errorMsg = valid;\n valid = false;\n }\n\n _this.error = !valid;\n })();\n }\n\n submit() {\n var _this2 = this;\n\n return _asyncToGenerator(function* () {\n yield _this2.validate();\n\n if (_this2.error) {\n _this2.color = `red`;\n\n _this2.fire();\n\n _this2.render();\n\n return;\n }\n\n let x = _this2.value;\n _this2.value = x !== `` ? x : _this2.initial;\n _this2.done = true;\n _this2.aborted = false;\n _this2.error = false;\n\n _this2.fire();\n\n _this2.render();\n\n _this2.out.write(`\\n`);\n\n _this2.close();\n })();\n }\n\n up() {\n this.typed = ``;\n\n if (this.value === '') {\n this.value = this.min - this.inc;\n }\n\n if (this.value >= this.max) return this.bell();\n this.value += this.inc;\n this.color = `cyan`;\n this.fire();\n this.render();\n }\n\n down() {\n this.typed = ``;\n\n if (this.value === '') {\n this.value = this.min + this.inc;\n }\n\n if (this.value <= this.min) return this.bell();\n this.value -= this.inc;\n this.color = `cyan`;\n this.fire();\n this.render();\n }\n\n delete() {\n let val = this.value.toString();\n if (val.length === 0) return this.bell();\n this.value = this.parse(val = val.slice(0, -1)) || ``;\n\n if (this.value !== '' && this.value < this.min) {\n this.value = this.min;\n }\n\n this.color = `cyan`;\n this.fire();\n this.render();\n }\n\n next() {\n this.value = this.initial;\n this.fire();\n this.render();\n }\n\n _(c, key) {\n if (!this.valid(c)) return this.bell();\n const now = Date.now();\n if (now - this.lastHit > 1000) this.typed = ``; // 1s elapsed\n\n this.typed += c;\n this.lastHit = now;\n this.color = `cyan`;\n if (c === `.`) return this.fire();\n this.value = Math.min(this.parse(this.typed), this.max);\n if (this.value > this.max) this.value = this.max;\n if (this.value < this.min) this.value = this.min;\n this.fire();\n this.render();\n }\n\n render() {\n if (this.closed) return;\n\n if (!this.firstRender) {\n if (this.outputError) this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));\n this.out.write(clear(this.outputText, this.out.columns));\n }\n\n super.render();\n this.outputError = ''; // Print prompt\n\n this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), !this.done || !this.done && !this.placeholder ? color[this.color]().underline(this.rendered) : this.rendered].join(` `); // Print error\n\n if (this.error) {\n this.outputError += this.errorMsg.split(`\\n`).reduce((a, l, i) => a + `\\n${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n }\n\n this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore);\n }\n\n}\n\nmodule.exports = NumberPrompt;", "'use strict';\n\nconst color = require('kleur');\n\nconst _require = require('sisteransi'),\n cursor = _require.cursor;\n\nconst Prompt = require('./prompt');\n\nconst _require2 = require('../util'),\n clear = _require2.clear,\n figures = _require2.figures,\n style = _require2.style,\n wrap = _require2.wrap,\n entriesToDisplay = _require2.entriesToDisplay;\n/**\n * MultiselectPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Array} opts.choices Array of choice objects\n * @param {String} [opts.hint] Hint to display\n * @param {String} [opts.warn] Hint shown for disabled choices\n * @param {Number} [opts.max] Max choices\n * @param {Number} [opts.cursor=0] Cursor start position\n * @param {Number} [opts.optionsPerPage=10] Max options to display at once\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\n\n\nclass MultiselectPrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.msg = opts.message;\n this.cursor = opts.cursor || 0;\n this.scrollIndex = opts.cursor || 0;\n this.hint = opts.hint || '';\n this.warn = opts.warn || '- This option is disabled -';\n this.minSelected = opts.min;\n this.showMinError = false;\n this.maxChoices = opts.max;\n this.instructions = opts.instructions;\n this.optionsPerPage = opts.optionsPerPage || 10;\n this.value = opts.choices.map((ch, idx) => {\n if (typeof ch === 'string') ch = {\n title: ch,\n value: idx\n };\n return {\n title: ch && (ch.title || ch.value || ch),\n description: ch && ch.description,\n value: ch && (ch.value === undefined ? idx : ch.value),\n selected: ch && ch.selected,\n disabled: ch && ch.disabled\n };\n });\n this.clear = clear('', this.out.columns);\n\n if (!opts.overrideRender) {\n this.render();\n }\n }\n\n reset() {\n this.value.map(v => !v.selected);\n this.cursor = 0;\n this.fire();\n this.render();\n }\n\n selected() {\n return this.value.filter(v => v.selected);\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n const selected = this.value.filter(e => e.selected);\n\n if (this.minSelected && selected.length < this.minSelected) {\n this.showMinError = true;\n this.render();\n } else {\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n }\n\n first() {\n this.cursor = 0;\n this.render();\n }\n\n last() {\n this.cursor = this.value.length - 1;\n this.render();\n }\n\n next() {\n this.cursor = (this.cursor + 1) % this.value.length;\n this.render();\n }\n\n up() {\n if (this.cursor === 0) {\n this.cursor = this.value.length - 1;\n } else {\n this.cursor--;\n }\n\n this.render();\n }\n\n down() {\n if (this.cursor === this.value.length - 1) {\n this.cursor = 0;\n } else {\n this.cursor++;\n }\n\n this.render();\n }\n\n left() {\n this.value[this.cursor].selected = false;\n this.render();\n }\n\n right() {\n if (this.value.filter(e => e.selected).length >= this.maxChoices) return this.bell();\n this.value[this.cursor].selected = true;\n this.render();\n }\n\n handleSpaceToggle() {\n const v = this.value[this.cursor];\n\n if (v.selected) {\n v.selected = false;\n this.render();\n } else if (v.disabled || this.value.filter(e => e.selected).length >= this.maxChoices) {\n return this.bell();\n } else {\n v.selected = true;\n this.render();\n }\n }\n\n toggleAll() {\n if (this.maxChoices !== undefined || this.value[this.cursor].disabled) {\n return this.bell();\n }\n\n const newSelected = !this.value[this.cursor].selected;\n this.value.filter(v => !v.disabled).forEach(v => v.selected = newSelected);\n this.render();\n }\n\n _(c, key) {\n if (c === ' ') {\n this.handleSpaceToggle();\n } else if (c === 'a') {\n this.toggleAll();\n } else {\n return this.bell();\n }\n }\n\n renderInstructions() {\n if (this.instructions === undefined || this.instructions) {\n if (typeof this.instructions === 'string') {\n return this.instructions;\n }\n\n return '\\nInstructions:\\n' + ` ${figures.arrowUp}/${figures.arrowDown}: Highlight option\\n` + ` ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection\\n` + (this.maxChoices === undefined ? ` a: Toggle all\\n` : '') + ` enter/return: Complete answer`;\n }\n\n return '';\n }\n\n renderOption(cursor, v, i, arrowIndicator) {\n const prefix = (v.selected ? color.green(figures.radioOn) : figures.radioOff) + ' ' + arrowIndicator + ' ';\n let title, desc;\n\n if (v.disabled) {\n title = cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);\n } else {\n title = cursor === i ? color.cyan().underline(v.title) : v.title;\n\n if (cursor === i && v.description) {\n desc = ` - ${v.description}`;\n\n if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\\r?\\n/).length > 1) {\n desc = '\\n' + wrap(v.description, {\n margin: prefix.length,\n width: this.out.columns\n });\n }\n }\n }\n\n return prefix + title + color.gray(desc || '');\n } // shared with autocompleteMultiselect\n\n\n paginateOptions(options) {\n if (options.length === 0) {\n return color.red('No matches for this query.');\n }\n\n let _entriesToDisplay = entriesToDisplay(this.cursor, options.length, this.optionsPerPage),\n startIndex = _entriesToDisplay.startIndex,\n endIndex = _entriesToDisplay.endIndex;\n\n let prefix,\n styledOptions = [];\n\n for (let i = startIndex; i < endIndex; i++) {\n if (i === startIndex && startIndex > 0) {\n prefix = figures.arrowUp;\n } else if (i === endIndex - 1 && endIndex < options.length) {\n prefix = figures.arrowDown;\n } else {\n prefix = ' ';\n }\n\n styledOptions.push(this.renderOption(this.cursor, options[i], i, prefix));\n }\n\n return '\\n' + styledOptions.join('\\n');\n } // shared with autocomleteMultiselect\n\n\n renderOptions(options) {\n if (!this.done) {\n return this.paginateOptions(options);\n }\n\n return '';\n }\n\n renderDoneOrInstructions() {\n if (this.done) {\n return this.value.filter(e => e.selected).map(v => v.title).join(', ');\n }\n\n const output = [color.gray(this.hint), this.renderInstructions()];\n\n if (this.value[this.cursor].disabled) {\n output.push(color.yellow(this.warn));\n }\n\n return output.join(' ');\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n super.render(); // print prompt\n\n let prompt = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(' ');\n\n if (this.showMinError) {\n prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`);\n this.showMinError = false;\n }\n\n prompt += this.renderOptions(this.value);\n this.out.write(this.clear + prompt);\n this.clear = clear(prompt, this.out.columns);\n }\n\n}\n\nmodule.exports = MultiselectPrompt;", "'use strict';\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nconst color = require('kleur');\n\nconst Prompt = require('./prompt');\n\nconst _require = require('sisteransi'),\n erase = _require.erase,\n cursor = _require.cursor;\n\nconst _require2 = require('../util'),\n style = _require2.style,\n clear = _require2.clear,\n figures = _require2.figures,\n wrap = _require2.wrap,\n entriesToDisplay = _require2.entriesToDisplay;\n\nconst getVal = (arr, i) => arr[i] && (arr[i].value || arr[i].title || arr[i]);\n\nconst getTitle = (arr, i) => arr[i] && (arr[i].title || arr[i].value || arr[i]);\n\nconst getIndex = (arr, valOrTitle) => {\n const index = arr.findIndex(el => el.value === valOrTitle || el.title === valOrTitle);\n return index > -1 ? index : undefined;\n};\n/**\n * TextPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Array} opts.choices Array of auto-complete choices objects\n * @param {Function} [opts.suggest] Filter function. Defaults to sort by title\n * @param {Number} [opts.limit=10] Max number of results to show\n * @param {Number} [opts.cursor=0] Cursor start position\n * @param {String} [opts.style='default'] Render style\n * @param {String} [opts.fallback] Fallback message - initial to default value\n * @param {String} [opts.initial] Index of the default value\n * @param {Boolean} [opts.clearFirst] The first ESCAPE keypress will clear the input\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {String} [opts.noMatches] The no matches found label\n */\n\n\nclass AutocompletePrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.msg = opts.message;\n this.suggest = opts.suggest;\n this.choices = opts.choices;\n this.initial = typeof opts.initial === 'number' ? opts.initial : getIndex(opts.choices, opts.initial);\n this.select = this.initial || opts.cursor || 0;\n this.i18n = {\n noMatches: opts.noMatches || 'no matches found'\n };\n this.fallback = opts.fallback || this.initial;\n this.clearFirst = opts.clearFirst || false;\n this.suggestions = [];\n this.input = '';\n this.limit = opts.limit || 10;\n this.cursor = 0;\n this.transform = style.render(opts.style);\n this.scale = this.transform.scale;\n this.render = this.render.bind(this);\n this.complete = this.complete.bind(this);\n this.clear = clear('', this.out.columns);\n this.complete(this.render);\n this.render();\n }\n\n set fallback(fb) {\n this._fb = Number.isSafeInteger(parseInt(fb)) ? parseInt(fb) : fb;\n }\n\n get fallback() {\n let choice;\n if (typeof this._fb === 'number') choice = this.choices[this._fb];else if (typeof this._fb === 'string') choice = {\n title: this._fb\n };\n return choice || this._fb || {\n title: this.i18n.noMatches\n };\n }\n\n moveSelect(i) {\n this.select = i;\n if (this.suggestions.length > 0) this.value = getVal(this.suggestions, i);else this.value = this.fallback.value;\n this.fire();\n }\n\n complete(cb) {\n var _this = this;\n\n return _asyncToGenerator(function* () {\n const p = _this.completing = _this.suggest(_this.input, _this.choices);\n\n const suggestions = yield p;\n if (_this.completing !== p) return;\n _this.suggestions = suggestions.map((s, i, arr) => ({\n title: getTitle(arr, i),\n value: getVal(arr, i),\n description: s.description\n }));\n _this.completing = false;\n const l = Math.max(suggestions.length - 1, 0);\n\n _this.moveSelect(Math.min(l, _this.select));\n\n cb && cb();\n })();\n }\n\n reset() {\n this.input = '';\n this.complete(() => {\n this.moveSelect(this.initial !== void 0 ? this.initial : 0);\n this.render();\n });\n this.render();\n }\n\n exit() {\n if (this.clearFirst && this.input.length > 0) {\n this.reset();\n } else {\n this.done = this.exited = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n }\n\n abort() {\n this.done = this.aborted = true;\n this.exited = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n this.done = true;\n this.aborted = this.exited = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n _(c, key) {\n let s1 = this.input.slice(0, this.cursor);\n let s2 = this.input.slice(this.cursor);\n this.input = `${s1}${c}${s2}`;\n this.cursor = s1.length + 1;\n this.complete(this.render);\n this.render();\n }\n\n delete() {\n if (this.cursor === 0) return this.bell();\n let s1 = this.input.slice(0, this.cursor - 1);\n let s2 = this.input.slice(this.cursor);\n this.input = `${s1}${s2}`;\n this.complete(this.render);\n this.cursor = this.cursor - 1;\n this.render();\n }\n\n deleteForward() {\n if (this.cursor * this.scale >= this.rendered.length) return this.bell();\n let s1 = this.input.slice(0, this.cursor);\n let s2 = this.input.slice(this.cursor + 1);\n this.input = `${s1}${s2}`;\n this.complete(this.render);\n this.render();\n }\n\n first() {\n this.moveSelect(0);\n this.render();\n }\n\n last() {\n this.moveSelect(this.suggestions.length - 1);\n this.render();\n }\n\n up() {\n if (this.select === 0) {\n this.moveSelect(this.suggestions.length - 1);\n } else {\n this.moveSelect(this.select - 1);\n }\n\n this.render();\n }\n\n down() {\n if (this.select === this.suggestions.length - 1) {\n this.moveSelect(0);\n } else {\n this.moveSelect(this.select + 1);\n }\n\n this.render();\n }\n\n next() {\n if (this.select === this.suggestions.length - 1) {\n this.moveSelect(0);\n } else this.moveSelect(this.select + 1);\n\n this.render();\n }\n\n nextPage() {\n this.moveSelect(Math.min(this.select + this.limit, this.suggestions.length - 1));\n this.render();\n }\n\n prevPage() {\n this.moveSelect(Math.max(this.select - this.limit, 0));\n this.render();\n }\n\n left() {\n if (this.cursor <= 0) return this.bell();\n this.cursor = this.cursor - 1;\n this.render();\n }\n\n right() {\n if (this.cursor * this.scale >= this.rendered.length) return this.bell();\n this.cursor = this.cursor + 1;\n this.render();\n }\n\n renderOption(v, hovered, isStart, isEnd) {\n let desc;\n let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : ' ';\n let title = hovered ? color.cyan().underline(v.title) : v.title;\n prefix = (hovered ? color.cyan(figures.pointer) + ' ' : ' ') + prefix;\n\n if (v.description) {\n desc = ` - ${v.description}`;\n\n if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\\r?\\n/).length > 1) {\n desc = '\\n' + wrap(v.description, {\n margin: 3,\n width: this.out.columns\n });\n }\n }\n\n return prefix + ' ' + title + color.gray(desc || '');\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n\n let _entriesToDisplay = entriesToDisplay(this.select, this.choices.length, this.limit),\n startIndex = _entriesToDisplay.startIndex,\n endIndex = _entriesToDisplay.endIndex;\n\n this.outputText = [style.symbol(this.done, this.aborted, this.exited), color.bold(this.msg), style.delimiter(this.completing), this.done && this.suggestions[this.select] ? this.suggestions[this.select].title : this.rendered = this.transform.render(this.input)].join(' ');\n\n if (!this.done) {\n const suggestions = this.suggestions.slice(startIndex, endIndex).map((item, i) => this.renderOption(item, this.select === i + startIndex, i === 0 && startIndex > 0, i + startIndex === endIndex - 1 && endIndex < this.choices.length)).join('\\n');\n this.outputText += `\\n` + (suggestions || color.gray(this.fallback.title));\n }\n\n this.out.write(erase.line + cursor.to(0) + this.outputText);\n }\n\n}\n\nmodule.exports = AutocompletePrompt;", "'use strict';\n\nconst color = require('kleur');\n\nconst _require = require('sisteransi'),\n cursor = _require.cursor;\n\nconst MultiselectPrompt = require('./multiselect');\n\nconst _require2 = require('../util'),\n clear = _require2.clear,\n style = _require2.style,\n figures = _require2.figures;\n/**\n * MultiselectPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Array} opts.choices Array of choice objects\n * @param {String} [opts.hint] Hint to display\n * @param {String} [opts.warn] Hint shown for disabled choices\n * @param {Number} [opts.max] Max choices\n * @param {Number} [opts.cursor=0] Cursor start position\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\n\n\nclass AutocompleteMultiselectPrompt extends MultiselectPrompt {\n constructor(opts = {}) {\n opts.overrideRender = true;\n super(opts);\n this.inputValue = '';\n this.clear = clear('', this.out.columns);\n this.filteredOptions = this.value;\n this.render();\n }\n\n last() {\n this.cursor = this.filteredOptions.length - 1;\n this.render();\n }\n\n next() {\n this.cursor = (this.cursor + 1) % this.filteredOptions.length;\n this.render();\n }\n\n up() {\n if (this.cursor === 0) {\n this.cursor = this.filteredOptions.length - 1;\n } else {\n this.cursor--;\n }\n\n this.render();\n }\n\n down() {\n if (this.cursor === this.filteredOptions.length - 1) {\n this.cursor = 0;\n } else {\n this.cursor++;\n }\n\n this.render();\n }\n\n left() {\n this.filteredOptions[this.cursor].selected = false;\n this.render();\n }\n\n right() {\n if (this.value.filter(e => e.selected).length >= this.maxChoices) return this.bell();\n this.filteredOptions[this.cursor].selected = true;\n this.render();\n }\n\n delete() {\n if (this.inputValue.length) {\n this.inputValue = this.inputValue.substr(0, this.inputValue.length - 1);\n this.updateFilteredOptions();\n }\n }\n\n updateFilteredOptions() {\n const currentHighlight = this.filteredOptions[this.cursor];\n this.filteredOptions = this.value.filter(v => {\n if (this.inputValue) {\n if (typeof v.title === 'string') {\n if (v.title.toLowerCase().includes(this.inputValue.toLowerCase())) {\n return true;\n }\n }\n\n if (typeof v.value === 'string') {\n if (v.value.toLowerCase().includes(this.inputValue.toLowerCase())) {\n return true;\n }\n }\n\n return false;\n }\n\n return true;\n });\n const newHighlightIndex = this.filteredOptions.findIndex(v => v === currentHighlight);\n this.cursor = newHighlightIndex < 0 ? 0 : newHighlightIndex;\n this.render();\n }\n\n handleSpaceToggle() {\n const v = this.filteredOptions[this.cursor];\n\n if (v.selected) {\n v.selected = false;\n this.render();\n } else if (v.disabled || this.value.filter(e => e.selected).length >= this.maxChoices) {\n return this.bell();\n } else {\n v.selected = true;\n this.render();\n }\n }\n\n handleInputChange(c) {\n this.inputValue = this.inputValue + c;\n this.updateFilteredOptions();\n }\n\n _(c, key) {\n if (c === ' ') {\n this.handleSpaceToggle();\n } else {\n this.handleInputChange(c);\n }\n }\n\n renderInstructions() {\n if (this.instructions === undefined || this.instructions) {\n if (typeof this.instructions === 'string') {\n return this.instructions;\n }\n\n return `\nInstructions:\n ${figures.arrowUp}/${figures.arrowDown}: Highlight option\n ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`;\n }\n\n return '';\n }\n\n renderCurrentInput() {\n return `\nFiltered results for: ${this.inputValue ? this.inputValue : color.gray('Enter something to filter')}\\n`;\n }\n\n renderOption(cursor, v, i) {\n let title;\n if (v.disabled) title = cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);else title = cursor === i ? color.cyan().underline(v.title) : v.title;\n return (v.selected ? color.green(figures.radioOn) : figures.radioOff) + ' ' + title;\n }\n\n renderDoneOrInstructions() {\n if (this.done) {\n return this.value.filter(e => e.selected).map(v => v.title).join(', ');\n }\n\n const output = [color.gray(this.hint), this.renderInstructions(), this.renderCurrentInput()];\n\n if (this.filteredOptions.length && this.filteredOptions[this.cursor].disabled) {\n output.push(color.yellow(this.warn));\n }\n\n return output.join(' ');\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n super.render(); // print prompt\n\n let prompt = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(' ');\n\n if (this.showMinError) {\n prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`);\n this.showMinError = false;\n }\n\n prompt += this.renderOptions(this.filteredOptions);\n this.out.write(this.clear + prompt);\n this.clear = clear(prompt, this.out.columns);\n }\n\n}\n\nmodule.exports = AutocompleteMultiselectPrompt;", "\"use strict\";\n\nconst color = require('kleur');\n\nconst Prompt = require('./prompt');\n\nconst _require = require('../util'),\n style = _require.style,\n clear = _require.clear;\n\nconst _require2 = require('sisteransi'),\n erase = _require2.erase,\n cursor = _require2.cursor;\n/**\n * ConfirmPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Boolean} [opts.initial] Default value (true/false)\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {String} [opts.yes] The \"Yes\" label\n * @param {String} [opts.yesOption] The \"Yes\" option when choosing between yes/no\n * @param {String} [opts.no] The \"No\" label\n * @param {String} [opts.noOption] The \"No\" option when choosing between yes/no\n */\n\n\nclass ConfirmPrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.msg = opts.message;\n this.value = opts.initial;\n this.initialValue = !!opts.initial;\n this.yesMsg = opts.yes || 'yes';\n this.yesOption = opts.yesOption || '(Y/n)';\n this.noMsg = opts.no || 'no';\n this.noOption = opts.noOption || '(y/N)';\n this.render();\n }\n\n reset() {\n this.value = this.initialValue;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n this.value = this.value || false;\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n _(c, key) {\n if (c.toLowerCase() === 'y') {\n this.value = true;\n return this.submit();\n }\n\n if (c.toLowerCase() === 'n') {\n this.value = false;\n return this.submit();\n }\n\n return this.bell();\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.done ? this.value ? this.yesMsg : this.noMsg : color.gray(this.initialValue ? this.yesOption : this.noOption)].join(' ');\n this.out.write(erase.line + cursor.to(0) + this.outputText);\n }\n\n}\n\nmodule.exports = ConfirmPrompt;", "'use strict';\n\nmodule.exports = {\n TextPrompt: require('./text'),\n SelectPrompt: require('./select'),\n TogglePrompt: require('./toggle'),\n DatePrompt: require('./date'),\n NumberPrompt: require('./number'),\n MultiselectPrompt: require('./multiselect'),\n AutocompletePrompt: require('./autocomplete'),\n AutocompleteMultiselectPrompt: require('./autocompleteMultiselect'),\n ConfirmPrompt: require('./confirm')\n};", "'use strict';\n\nconst $ = exports;\n\nconst el = require('./elements');\n\nconst noop = v => v;\n\nfunction toPrompt(type, args, opts = {}) {\n return new Promise((res, rej) => {\n const p = new el[type](args);\n const onAbort = opts.onAbort || noop;\n const onSubmit = opts.onSubmit || noop;\n const onExit = opts.onExit || noop;\n p.on('state', args.onState || noop);\n p.on('submit', x => res(onSubmit(x)));\n p.on('exit', x => res(onExit(x)));\n p.on('abort', x => rej(onAbort(x)));\n });\n}\n/**\n * Text prompt\n * @param {string} args.message Prompt message to display\n * @param {string} [args.initial] Default string value\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {function} [args.onState] On state change callback\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.text = args => toPrompt('TextPrompt', args);\n/**\n * Password prompt with masked input\n * @param {string} args.message Prompt message to display\n * @param {string} [args.initial] Default string value\n * @param {function} [args.onState] On state change callback\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.password = args => {\n args.style = 'password';\n return $.text(args);\n};\n/**\n * Prompt where input is invisible, like sudo\n * @param {string} args.message Prompt message to display\n * @param {string} [args.initial] Default string value\n * @param {function} [args.onState] On state change callback\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.invisible = args => {\n args.style = 'invisible';\n return $.text(args);\n};\n/**\n * Number prompt\n * @param {string} args.message Prompt message to display\n * @param {number} args.initial Default number value\n * @param {function} [args.onState] On state change callback\n * @param {number} [args.max] Max value\n * @param {number} [args.min] Min value\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {Boolean} [opts.float=false] Parse input as floats\n * @param {Number} [opts.round=2] Round floats to x decimals\n * @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.number = args => toPrompt('NumberPrompt', args);\n/**\n * Date prompt\n * @param {string} args.message Prompt message to display\n * @param {number} args.initial Default number value\n * @param {function} [args.onState] On state change callback\n * @param {number} [args.max] Max value\n * @param {number} [args.min] Min value\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {Boolean} [opts.float=false] Parse input as floats\n * @param {Number} [opts.round=2] Round floats to x decimals\n * @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.date = args => toPrompt('DatePrompt', args);\n/**\n * Classic yes/no prompt\n * @param {string} args.message Prompt message to display\n * @param {boolean} [args.initial=false] Default value\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.confirm = args => toPrompt('ConfirmPrompt', args);\n/**\n * List prompt, split intput string by `seperator`\n * @param {string} args.message Prompt message to display\n * @param {string} [args.initial] Default string value\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {string} [args.separator] String separator\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input, in form of an `Array`\n */\n\n\n$.list = args => {\n const sep = args.separator || ',';\n return toPrompt('TextPrompt', args, {\n onSubmit: str => str.split(sep).map(s => s.trim())\n });\n};\n/**\n * Toggle/switch prompt\n * @param {string} args.message Prompt message to display\n * @param {boolean} [args.initial=false] Default value\n * @param {string} [args.active=\"on\"] Text for `active` state\n * @param {string} [args.inactive=\"off\"] Text for `inactive` state\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.toggle = args => toPrompt('TogglePrompt', args);\n/**\n * Interactive select prompt\n * @param {string} args.message Prompt message to display\n * @param {Array} args.choices Array of choices objects `[{ title, value }, ...]`\n * @param {number} [args.initial] Index of default value\n * @param {String} [args.hint] Hint to display\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.select = args => toPrompt('SelectPrompt', args);\n/**\n * Interactive multi-select / autocompleteMultiselect prompt\n * @param {string} args.message Prompt message to display\n * @param {Array} args.choices Array of choices objects `[{ title, value, [selected] }, ...]`\n * @param {number} [args.max] Max select\n * @param {string} [args.hint] Hint to display user\n * @param {Number} [args.cursor=0] Cursor start position\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.multiselect = args => {\n args.choices = [].concat(args.choices || []);\n\n const toSelected = items => items.filter(item => item.selected).map(item => item.value);\n\n return toPrompt('MultiselectPrompt', args, {\n onAbort: toSelected,\n onSubmit: toSelected\n });\n};\n\n$.autocompleteMultiselect = args => {\n args.choices = [].concat(args.choices || []);\n\n const toSelected = items => items.filter(item => item.selected).map(item => item.value);\n\n return toPrompt('AutocompleteMultiselectPrompt', args, {\n onAbort: toSelected,\n onSubmit: toSelected\n });\n};\n\nconst byTitle = (input, choices) => Promise.resolve(choices.filter(item => item.title.slice(0, input.length).toLowerCase() === input.toLowerCase()));\n/**\n * Interactive auto-complete prompt\n * @param {string} args.message Prompt message to display\n * @param {Array} args.choices Array of auto-complete choices objects `[{ title, value }, ...]`\n * @param {Function} [args.suggest] Function to filter results based on user input. Defaults to sort by `title`\n * @param {number} [args.limit=10] Max number of results to show\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {String} [args.initial] Index of the default value\n * @param {boolean} [opts.clearFirst] The first ESCAPE keypress will clear the input\n * @param {String} [args.fallback] Fallback message - defaults to initial value\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n\n\n$.autocomplete = args => {\n args.suggest = args.suggest || byTitle;\n args.choices = [].concat(args.choices || []);\n return toPrompt('AutocompletePrompt', args);\n};", "'use strict';\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nconst prompts = require('./prompts');\n\nconst passOn = ['suggest', 'format', 'onState', 'validate', 'onRender', 'type'];\n\nconst noop = () => {};\n/**\n * Prompt for a series of questions\n * @param {Array|Object} questions Single question object or Array of question objects\n * @param {Function} [onSubmit] Callback function called on prompt submit\n * @param {Function} [onCancel] Callback function called on cancel/abort\n * @returns {Object} Object with values from user input\n */\n\n\nfunction prompt() {\n return _prompt.apply(this, arguments);\n}\n\nfunction _prompt() {\n _prompt = _asyncToGenerator(function* (questions = [], {\n onSubmit = noop,\n onCancel = noop\n } = {}) {\n const answers = {};\n const override = prompt._override || {};\n questions = [].concat(questions);\n let answer, question, quit, name, type, lastPrompt;\n\n const getFormattedAnswer = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (question, answer, skipValidation = false) {\n if (!skipValidation && question.validate && question.validate(answer) !== true) {\n return;\n }\n\n return question.format ? yield question.format(answer, answers) : answer;\n });\n\n return function getFormattedAnswer(_x, _x2) {\n return _ref.apply(this, arguments);\n };\n }();\n\n var _iterator = _createForOfIteratorHelper(questions),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n question = _step.value;\n var _question = question;\n name = _question.name;\n type = _question.type;\n\n // evaluate type first and skip if type is a falsy value\n if (typeof type === 'function') {\n type = yield type(answer, _objectSpread({}, answers), question);\n question['type'] = type;\n }\n\n if (!type) continue; // if property is a function, invoke it unless it's a special function\n\n for (let key in question) {\n if (passOn.includes(key)) continue;\n let value = question[key];\n question[key] = typeof value === 'function' ? yield value(answer, _objectSpread({}, answers), lastPrompt) : value;\n }\n\n lastPrompt = question;\n\n if (typeof question.message !== 'string') {\n throw new Error('prompt message is required');\n } // update vars in case they changed\n\n\n var _question2 = question;\n name = _question2.name;\n type = _question2.type;\n\n if (prompts[type] === void 0) {\n throw new Error(`prompt type (${type}) is not defined`);\n }\n\n if (override[question.name] !== undefined) {\n answer = yield getFormattedAnswer(question, override[question.name]);\n\n if (answer !== undefined) {\n answers[name] = answer;\n continue;\n }\n }\n\n try {\n // Get the injected answer if there is one or prompt the user\n answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : yield prompts[type](question);\n answers[name] = answer = yield getFormattedAnswer(question, answer, true);\n quit = yield onSubmit(question, answer, answers);\n } catch (err) {\n quit = !(yield onCancel(question, answers));\n }\n\n if (quit) return answers;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return answers;\n });\n return _prompt.apply(this, arguments);\n}\n\nfunction getInjectedAnswer(injected, deafultValue) {\n const answer = injected.shift();\n\n if (answer instanceof Error) {\n throw answer;\n }\n\n return answer === undefined ? deafultValue : answer;\n}\n\nfunction inject(answers) {\n prompt._injected = (prompt._injected || []).concat(answers);\n}\n\nfunction override(answers) {\n prompt._override = Object.assign({}, answers);\n}\n\nmodule.exports = Object.assign(prompt, {\n prompt,\n prompts,\n inject,\n override\n});", "'use strict';\n\nmodule.exports = (key, isSelect) => {\n if (key.meta && key.name !== 'escape') return;\n \n if (key.ctrl) {\n if (key.name === 'a') return 'first';\n if (key.name === 'c') return 'abort';\n if (key.name === 'd') return 'abort';\n if (key.name === 'e') return 'last';\n if (key.name === 'g') return 'reset';\n }\n \n if (isSelect) {\n if (key.name === 'j') return 'down';\n if (key.name === 'k') return 'up';\n }\n\n if (key.name === 'return') return 'submit';\n if (key.name === 'enter') return 'submit'; // ctrl + J\n if (key.name === 'backspace') return 'delete';\n if (key.name === 'delete') return 'deleteForward';\n if (key.name === 'abort') return 'abort';\n if (key.name === 'escape') return 'exit';\n if (key.name === 'tab') return 'next';\n if (key.name === 'pagedown') return 'nextPage';\n if (key.name === 'pageup') return 'prevPage';\n // TODO create home() in prompt types (e.g. TextPrompt)\n if (key.name === 'home') return 'home';\n // TODO create end() in prompt types (e.g. TextPrompt)\n if (key.name === 'end') return 'end';\n\n if (key.name === 'up') return 'up';\n if (key.name === 'down') return 'down';\n if (key.name === 'right') return 'right';\n if (key.name === 'left') return 'left';\n\n return false;\n};\n", "'use strict';\n\nmodule.exports = str => {\n const pattern = [\n '[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)',\n '(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PRZcf-ntqry=><~]))'\n ].join('|');\n\n const RGX = new RegExp(pattern, 'g');\n return typeof str === 'string' ? str.replace(RGX, '') : str;\n};\n", "'use strict';\n\nconst strip = require('./strip');\nconst { erase, cursor } = require('sisteransi');\n\nconst width = str => [...strip(str)].length;\n\n/**\n * @param {string} prompt\n * @param {number} perLine\n */\nmodule.exports = function(prompt, perLine) {\n if (!perLine) return erase.line + cursor.to(0);\n\n let rows = 0;\n const lines = prompt.split(/\\r?\\n/);\n for (let line of lines) {\n rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / perLine);\n }\n\n return erase.lines(rows);\n};\n", "'use strict';\t\n\n const main = {\n arrowUp: '\u2191',\n arrowDown: '\u2193',\n arrowLeft: '\u2190',\n arrowRight: '\u2192',\n radioOn: '\u25C9',\n radioOff: '\u25EF',\n tick: '\u2714',\t\n cross: '\u2716',\t\n ellipsis: '\u2026',\t\n pointerSmall: '\u203A',\t\n line: '\u2500',\t\n pointer: '\u276F'\t\n};\t\nconst win = {\n arrowUp: main.arrowUp,\n arrowDown: main.arrowDown,\n arrowLeft: main.arrowLeft,\n arrowRight: main.arrowRight,\n radioOn: '(*)',\n radioOff: '( )',\t\n tick: '\u221A',\t\n cross: '\u00D7',\t\n ellipsis: '...',\t\n pointerSmall: '\u00BB',\t\n line: '\u2500',\t\n pointer: '>'\t\n};\t\nconst figures = process.platform === 'win32' ? win : main;\t\n\n module.exports = figures;\n", "'use strict';\n\nconst c = require('kleur');\nconst figures = require('./figures');\n\n// rendering user input.\nconst styles = Object.freeze({\n password: { scale: 1, render: input => '*'.repeat(input.length) },\n emoji: { scale: 2, render: input => '\uD83D\uDE03'.repeat(input.length) },\n invisible: { scale: 0, render: input => '' },\n default: { scale: 1, render: input => `${input}` }\n});\nconst render = type => styles[type] || styles.default;\n\n// icon to signalize a prompt.\nconst symbols = Object.freeze({\n aborted: c.red(figures.cross),\n done: c.green(figures.tick),\n exited: c.yellow(figures.cross),\n default: c.cyan('?')\n});\n\nconst symbol = (done, aborted, exited) =>\n aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default;\n\n// between the question and the user's input.\nconst delimiter = completing =>\n c.gray(completing ? figures.ellipsis : figures.pointerSmall);\n\nconst item = (expandable, expanded) =>\n c.gray(expandable ? (expanded ? figures.pointerSmall : '+') : figures.line);\n\nmodule.exports = {\n styles,\n render,\n symbols,\n symbol,\n delimiter,\n item\n};\n", "'use strict';\n\nconst strip = require('./strip');\n\n/**\n * @param {string} msg\n * @param {number} perLine\n */\nmodule.exports = function (msg, perLine) {\n let lines = String(strip(msg) || '').split(/\\r?\\n/);\n\n if (!perLine) return lines.length;\n return lines.map(l => Math.ceil(l.length / perLine))\n .reduce((a, b) => a + b);\n};\n", "'use strict';\n\n/**\n * @param {string} msg The message to wrap\n * @param {object} opts\n * @param {number|string} [opts.margin] Left margin\n * @param {number} opts.width Maximum characters per line including the margin\n */\nmodule.exports = (msg, opts = {}) => {\n const tab = Number.isSafeInteger(parseInt(opts.margin))\n ? new Array(parseInt(opts.margin)).fill(' ').join('')\n : (opts.margin || '');\n\n const width = opts.width;\n\n return (msg || '').split(/\\r?\\n/g)\n .map(line => line\n .split(/\\s+/g)\n .reduce((arr, w) => {\n if (w.length + tab.length >= width || arr[arr.length - 1].length + w.length + 1 < width)\n arr[arr.length - 1] += ` ${w}`;\n else arr.push(`${tab}${w}`);\n return arr;\n }, [ tab ])\n .join('\\n'))\n .join('\\n');\n};\n", "'use strict';\n\n/**\n * Determine what entries should be displayed on the screen, based on the\n * currently selected index and the maximum visible. Used in list-based\n * prompts like `select` and `multiselect`.\n *\n * @param {number} cursor the currently selected entry\n * @param {number} total the total entries available to display\n * @param {number} [maxVisible] the number of entries that can be displayed\n */\nmodule.exports = (cursor, total, maxVisible) => {\n maxVisible = maxVisible || total;\n\n let startIndex = Math.min(total- maxVisible, cursor - Math.floor(maxVisible / 2));\n if (startIndex < 0) startIndex = 0;\n\n let endIndex = Math.min(startIndex + maxVisible, total);\n\n return { startIndex, endIndex };\n};\n", "'use strict';\n\nmodule.exports = {\n action: require('./action'),\n clear: require('./clear'),\n style: require('./style'),\n strip: require('./strip'),\n figures: require('./figures'),\n lines: require('./lines'),\n wrap: require('./wrap'),\n entriesToDisplay: require('./entriesToDisplay')\n};\n", "'use strict';\n\nconst readline = require('readline');\nconst { action } = require('../util');\nconst EventEmitter = require('events');\nconst { beep, cursor } = require('sisteransi');\nconst color = require('kleur');\n\n/**\n * Base prompt skeleton\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\nclass Prompt extends EventEmitter {\n constructor(opts={}) {\n super();\n\n this.firstRender = true;\n this.in = opts.stdin || process.stdin;\n this.out = opts.stdout || process.stdout;\n this.onRender = (opts.onRender || (() => void 0)).bind(this);\n const rl = readline.createInterface({ input:this.in, escapeCodeTimeout:50 });\n readline.emitKeypressEvents(this.in, rl);\n\n if (this.in.isTTY) this.in.setRawMode(true);\n const isSelect = [ 'SelectPrompt', 'MultiselectPrompt' ].indexOf(this.constructor.name) > -1;\n const keypress = (str, key) => {\n let a = action(key, isSelect);\n if (a === false) {\n this._ && this._(str, key);\n } else if (typeof this[a] === 'function') {\n this[a](key);\n } else {\n this.bell();\n }\n };\n\n this.close = () => {\n this.out.write(cursor.show);\n this.in.removeListener('keypress', keypress);\n if (this.in.isTTY) this.in.setRawMode(false);\n rl.close();\n this.emit(this.aborted ? 'abort' : this.exited ? 'exit' : 'submit', this.value);\n this.closed = true;\n };\n\n this.in.on('keypress', keypress);\n }\n\n fire() {\n this.emit('state', {\n value: this.value,\n aborted: !!this.aborted,\n exited: !!this.exited\n });\n }\n\n bell() {\n this.out.write(beep);\n }\n\n render() {\n this.onRender(color);\n if (this.firstRender) this.firstRender = false;\n }\n}\n\nmodule.exports = Prompt;\n", "const color = require('kleur');\nconst Prompt = require('./prompt');\nconst { erase, cursor } = require('sisteransi');\nconst { style, clear, lines, figures } = require('../util');\n\n/**\n * TextPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {String} [opts.style='default'] Render style\n * @param {String} [opts.initial] Default value\n * @param {Function} [opts.validate] Validate function\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {String} [opts.error] The invalid error label\n */\nclass TextPrompt extends Prompt {\n constructor(opts={}) {\n super(opts);\n this.transform = style.render(opts.style);\n this.scale = this.transform.scale;\n this.msg = opts.message;\n this.initial = opts.initial || ``;\n this.validator = opts.validate || (() => true);\n this.value = ``;\n this.errorMsg = opts.error || `Please Enter A Valid Value`;\n this.cursor = Number(!!this.initial);\n this.cursorOffset = 0;\n this.clear = clear(``, this.out.columns);\n this.render();\n }\n\n set value(v) {\n if (!v && this.initial) {\n this.placeholder = true;\n this.rendered = color.gray(this.transform.render(this.initial));\n } else {\n this.placeholder = false;\n this.rendered = this.transform.render(v);\n }\n this._value = v;\n this.fire();\n }\n\n get value() {\n return this._value;\n }\n\n reset() {\n this.value = ``;\n this.cursor = Number(!!this.initial);\n this.cursorOffset = 0;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.value = this.value || this.initial;\n this.done = this.aborted = true;\n this.error = false;\n this.red = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n async validate() {\n let valid = await this.validator(this.value);\n if (typeof valid === `string`) {\n this.errorMsg = valid;\n valid = false;\n }\n this.error = !valid;\n }\n\n async submit() {\n this.value = this.value || this.initial;\n this.cursorOffset = 0;\n this.cursor = this.rendered.length;\n await this.validate();\n if (this.error) {\n this.red = true;\n this.fire();\n this.render();\n return;\n }\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n next() {\n if (!this.placeholder) return this.bell();\n this.value = this.initial;\n this.cursor = this.rendered.length;\n this.fire();\n this.render();\n }\n\n moveCursor(n) {\n if (this.placeholder) return;\n this.cursor = this.cursor+n;\n this.cursorOffset += n;\n }\n\n _(c, key) {\n let s1 = this.value.slice(0, this.cursor);\n let s2 = this.value.slice(this.cursor);\n this.value = `${s1}${c}${s2}`;\n this.red = false;\n this.cursor = this.placeholder ? 0 : s1.length+1;\n this.render();\n }\n\n delete() {\n if (this.isCursorAtStart()) return this.bell();\n let s1 = this.value.slice(0, this.cursor-1);\n let s2 = this.value.slice(this.cursor);\n this.value = `${s1}${s2}`;\n this.red = false;\n if (this.isCursorAtStart()) {\n this.cursorOffset = 0\n } else {\n this.cursorOffset++;\n this.moveCursor(-1);\n }\n this.render();\n }\n\n deleteForward() {\n if(this.cursor*this.scale >= this.rendered.length || this.placeholder) return this.bell();\n let s1 = this.value.slice(0, this.cursor);\n let s2 = this.value.slice(this.cursor+1);\n this.value = `${s1}${s2}`;\n this.red = false;\n if (this.isCursorAtEnd()) {\n this.cursorOffset = 0;\n } else {\n this.cursorOffset++;\n }\n this.render();\n }\n\n first() {\n this.cursor = 0;\n this.render();\n }\n\n last() {\n this.cursor = this.value.length;\n this.render();\n }\n\n left() {\n if (this.cursor <= 0 || this.placeholder) return this.bell();\n this.moveCursor(-1);\n this.render();\n }\n\n right() {\n if (this.cursor*this.scale >= this.rendered.length || this.placeholder) return this.bell();\n this.moveCursor(1);\n this.render();\n }\n\n isCursorAtStart() {\n return this.cursor === 0 || (this.placeholder && this.cursor === 1);\n }\n\n isCursorAtEnd() {\n return this.cursor === this.rendered.length || (this.placeholder && this.cursor === this.rendered.length + 1)\n }\n\n render() {\n if (this.closed) return;\n if (!this.firstRender) {\n if (this.outputError)\n this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));\n this.out.write(clear(this.outputText, this.out.columns));\n }\n super.render();\n this.outputError = '';\n\n this.outputText = [\n style.symbol(this.done, this.aborted),\n color.bold(this.msg),\n style.delimiter(this.done),\n this.red ? color.red(this.rendered) : this.rendered\n ].join(` `);\n\n if (this.error) {\n this.outputError += this.errorMsg.split(`\\n`)\n .reduce((a, l, i) => a + `\\n${i ? ' ' : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n }\n\n this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore + cursor.move(this.cursorOffset, 0));\n }\n}\n\nmodule.exports = TextPrompt;", "'use strict';\n\nconst color = require('kleur');\nconst Prompt = require('./prompt');\nconst { style, clear, figures, wrap, entriesToDisplay } = require('../util');\nconst { cursor } = require('sisteransi');\n\n/**\n * SelectPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Array} opts.choices Array of choice objects\n * @param {String} [opts.hint] Hint to display\n * @param {Number} [opts.initial] Index of default value\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {Number} [opts.optionsPerPage=10] Max options to display at once\n */\nclass SelectPrompt extends Prompt {\n constructor(opts={}) {\n super(opts);\n this.msg = opts.message;\n this.hint = opts.hint || '- Use arrow-keys. Return to submit.';\n this.warn = opts.warn || '- This option is disabled';\n this.cursor = opts.initial || 0;\n this.choices = opts.choices.map((ch, idx) => {\n if (typeof ch === 'string')\n ch = {title: ch, value: idx};\n return {\n title: ch && (ch.title || ch.value || ch),\n value: ch && (ch.value === undefined ? idx : ch.value),\n description: ch && ch.description,\n selected: ch && ch.selected,\n disabled: ch && ch.disabled\n };\n });\n this.optionsPerPage = opts.optionsPerPage || 10;\n this.value = (this.choices[this.cursor] || {}).value;\n this.clear = clear('', this.out.columns);\n this.render();\n }\n\n moveCursor(n) {\n this.cursor = n;\n this.value = this.choices[n].value;\n this.fire();\n }\n\n reset() {\n this.moveCursor(0);\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n if (!this.selection.disabled) {\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n } else\n this.bell();\n }\n\n first() {\n this.moveCursor(0);\n this.render();\n }\n\n last() {\n this.moveCursor(this.choices.length - 1);\n this.render();\n }\n\n up() {\n if (this.cursor === 0) {\n this.moveCursor(this.choices.length - 1);\n } else {\n this.moveCursor(this.cursor - 1);\n }\n this.render();\n }\n\n down() {\n if (this.cursor === this.choices.length - 1) {\n this.moveCursor(0);\n } else {\n this.moveCursor(this.cursor + 1);\n }\n this.render();\n }\n\n next() {\n this.moveCursor((this.cursor + 1) % this.choices.length);\n this.render();\n }\n\n _(c, key) {\n if (c === ' ') return this.submit();\n }\n\n get selection() {\n return this.choices[this.cursor];\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n\n let { startIndex, endIndex } = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage);\n\n // Print prompt\n this.outputText = [\n style.symbol(this.done, this.aborted),\n color.bold(this.msg),\n style.delimiter(false),\n this.done ? this.selection.title : this.selection.disabled\n ? color.yellow(this.warn) : color.gray(this.hint)\n ].join(' ');\n\n // Print choices\n if (!this.done) {\n this.outputText += '\\n';\n for (let i = startIndex; i < endIndex; i++) {\n let title, prefix, desc = '', v = this.choices[i];\n\n // Determine whether to display \"more choices\" indicators\n if (i === startIndex && startIndex > 0) {\n prefix = figures.arrowUp;\n } else if (i === endIndex - 1 && endIndex < this.choices.length) {\n prefix = figures.arrowDown;\n } else {\n prefix = ' ';\n }\n\n if (v.disabled) {\n title = this.cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);\n prefix = (this.cursor === i ? color.bold().gray(figures.pointer) + ' ' : ' ') + prefix;\n } else {\n title = this.cursor === i ? color.cyan().underline(v.title) : v.title;\n prefix = (this.cursor === i ? color.cyan(figures.pointer) + ' ' : ' ') + prefix;\n if (v.description && this.cursor === i) {\n desc = ` - ${v.description}`;\n if (prefix.length + title.length + desc.length >= this.out.columns\n || v.description.split(/\\r?\\n/).length > 1) {\n desc = '\\n' + wrap(v.description, { margin: 3, width: this.out.columns });\n }\n }\n }\n\n this.outputText += `${prefix} ${title}${color.gray(desc)}\\n`;\n }\n }\n\n this.out.write(this.outputText);\n }\n}\n\nmodule.exports = SelectPrompt;\n", "const color = require('kleur');\nconst Prompt = require('./prompt');\nconst { style, clear } = require('../util');\nconst { cursor, erase } = require('sisteransi');\n\n/**\n * TogglePrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Boolean} [opts.initial=false] Default value\n * @param {String} [opts.active='no'] Active label\n * @param {String} [opts.inactive='off'] Inactive label\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\nclass TogglePrompt extends Prompt {\n constructor(opts={}) {\n super(opts);\n this.msg = opts.message;\n this.value = !!opts.initial;\n this.active = opts.active || 'on';\n this.inactive = opts.inactive || 'off';\n this.initialValue = this.value;\n this.render();\n }\n\n reset() {\n this.value = this.initialValue;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n deactivate() {\n if (this.value === false) return this.bell();\n this.value = false;\n this.render();\n }\n\n activate() {\n if (this.value === true) return this.bell();\n this.value = true;\n this.render();\n }\n\n delete() {\n this.deactivate();\n }\n left() {\n this.deactivate();\n }\n right() {\n this.activate();\n }\n down() {\n this.deactivate();\n }\n up() {\n this.activate();\n }\n\n next() {\n this.value = !this.value;\n this.fire();\n this.render();\n }\n\n _(c, key) {\n if (c === ' ') {\n this.value = !this.value;\n } else if (c === '1') {\n this.value = true;\n } else if (c === '0') {\n this.value = false;\n } else return this.bell();\n this.render();\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n\n this.outputText = [\n style.symbol(this.done, this.aborted),\n color.bold(this.msg),\n style.delimiter(this.done),\n this.value ? this.inactive : color.cyan().underline(this.inactive),\n color.gray('/'),\n this.value ? color.cyan().underline(this.active) : this.active\n ].join(' ');\n\n this.out.write(erase.line + cursor.to(0) + this.outputText);\n }\n}\n\nmodule.exports = TogglePrompt;\n", "'use strict';\n\nclass DatePart {\n constructor({token, date, parts, locales}) {\n this.token = token;\n this.date = date || new Date();\n this.parts = parts || [this];\n this.locales = locales || {};\n }\n\n up() {}\n\n down() {}\n\n next() {\n const currentIdx = this.parts.indexOf(this);\n return this.parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);\n }\n\n setTo(val) {}\n\n prev() {\n let parts = [].concat(this.parts).reverse();\n const currentIdx = parts.indexOf(this);\n return parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);\n }\n\n toString() {\n return String(this.date);\n }\n}\n\nmodule.exports = DatePart;\n\n\n", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Meridiem extends DatePart {\n constructor(opts={}) {\n super(opts);\n }\n\n up() {\n this.date.setHours((this.date.getHours() + 12) % 24);\n }\n\n down() {\n this.up();\n }\n\n toString() {\n let meridiem = this.date.getHours() > 12 ? 'pm' : 'am';\n return /\\A/.test(this.token) ? meridiem.toUpperCase() : meridiem;\n }\n}\n\nmodule.exports = Meridiem;\n", "'use strict';\n\nconst DatePart = require('./datepart');\n\nconst pos = n => {\n n = n % 10;\n return n === 1 ? 'st'\n : n === 2 ? 'nd'\n : n === 3 ? 'rd'\n : 'th';\n}\n\nclass Day extends DatePart {\n constructor(opts={}) {\n super(opts);\n }\n\n up() {\n this.date.setDate(this.date.getDate() + 1);\n }\n\n down() {\n this.date.setDate(this.date.getDate() - 1);\n }\n\n setTo(val) {\n this.date.setDate(parseInt(val.substr(-2)));\n }\n\n toString() {\n let date = this.date.getDate();\n let day = this.date.getDay();\n return this.token === 'DD' ? String(date).padStart(2, '0')\n : this.token === 'Do' ? date + pos(date)\n : this.token === 'd' ? day + 1\n : this.token === 'ddd' ? this.locales.weekdaysShort[day]\n : this.token === 'dddd' ? this.locales.weekdays[day]\n : date;\n }\n}\n\nmodule.exports = Day;\n", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Hours extends DatePart {\n constructor(opts={}) {\n super(opts);\n }\n\n up() {\n this.date.setHours(this.date.getHours() + 1);\n }\n\n down() {\n this.date.setHours(this.date.getHours() - 1);\n }\n\n setTo(val) {\n this.date.setHours(parseInt(val.substr(-2)));\n }\n\n toString() {\n let hours = this.date.getHours();\n if (/h/.test(this.token))\n hours = (hours % 12) || 12;\n return this.token.length > 1 ? String(hours).padStart(2, '0') : hours;\n }\n}\n\nmodule.exports = Hours;\n", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Milliseconds extends DatePart {\n constructor(opts={}) {\n super(opts);\n }\n\n up() {\n this.date.setMilliseconds(this.date.getMilliseconds() + 1);\n }\n\n down() {\n this.date.setMilliseconds(this.date.getMilliseconds() - 1);\n }\n\n setTo(val) {\n this.date.setMilliseconds(parseInt(val.substr(-(this.token.length))));\n }\n\n toString() {\n return String(this.date.getMilliseconds()).padStart(4, '0')\n .substr(0, this.token.length);\n }\n}\n\nmodule.exports = Milliseconds;\n", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Minutes extends DatePart {\n constructor(opts={}) {\n super(opts);\n }\n\n up() {\n this.date.setMinutes(this.date.getMinutes() + 1);\n }\n\n down() {\n this.date.setMinutes(this.date.getMinutes() - 1);\n }\n\n setTo(val) {\n this.date.setMinutes(parseInt(val.substr(-2)));\n }\n\n toString() {\n let m = this.date.getMinutes();\n return this.token.length > 1 ? String(m).padStart(2, '0') : m;\n }\n}\n\nmodule.exports = Minutes;\n", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Month extends DatePart {\n constructor(opts={}) {\n super(opts);\n }\n\n up() {\n this.date.setMonth(this.date.getMonth() + 1);\n }\n\n down() {\n this.date.setMonth(this.date.getMonth() - 1);\n }\n\n setTo(val) {\n val = parseInt(val.substr(-2)) - 1;\n this.date.setMonth(val < 0 ? 0 : val);\n }\n\n toString() {\n let month = this.date.getMonth();\n let tl = this.token.length;\n return tl === 2 ? String(month + 1).padStart(2, '0')\n : tl === 3 ? this.locales.monthsShort[month]\n : tl === 4 ? this.locales.months[month]\n : String(month + 1);\n }\n}\n\nmodule.exports = Month;\n", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Seconds extends DatePart {\n constructor(opts={}) {\n super(opts);\n }\n\n up() {\n this.date.setSeconds(this.date.getSeconds() + 1);\n }\n\n down() {\n this.date.setSeconds(this.date.getSeconds() - 1);\n }\n\n setTo(val) {\n this.date.setSeconds(parseInt(val.substr(-2)));\n }\n\n toString() {\n let s = this.date.getSeconds();\n return this.token.length > 1 ? String(s).padStart(2, '0') : s;\n }\n}\n\nmodule.exports = Seconds;\n", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Year extends DatePart {\n constructor(opts={}) {\n super(opts);\n }\n\n up() {\n this.date.setFullYear(this.date.getFullYear() + 1);\n }\n\n down() {\n this.date.setFullYear(this.date.getFullYear() - 1);\n }\n\n setTo(val) {\n this.date.setFullYear(val.substr(-4));\n }\n\n toString() {\n let year = String(this.date.getFullYear()).padStart(4, '0');\n return this.token.length === 2 ? year.substr(-2) : year;\n }\n}\n\nmodule.exports = Year;\n", "'use strict';\n\nmodule.exports = {\n DatePart: require('./datepart'),\n Meridiem: require('./meridiem'),\n Day: require('./day'),\n Hours: require('./hours'),\n Milliseconds: require('./milliseconds'),\n Minutes: require('./minutes'),\n Month: require('./month'),\n Seconds: require('./seconds'),\n Year: require('./year'),\n}\n", "'use strict';\n\nconst color = require('kleur');\nconst Prompt = require('./prompt');\nconst { style, clear, figures } = require('../util');\nconst { erase, cursor } = require('sisteransi');\nconst { DatePart, Meridiem, Day, Hours, Milliseconds, Minutes, Month, Seconds, Year } = require('../dateparts');\n\nconst regex = /\\\\(.)|\"((?:\\\\[\"\\\\]|[^\"])+)\"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;\nconst regexGroups = {\n 1: ({token}) => token.replace(/\\\\(.)/g, '$1'),\n 2: (opts) => new Day(opts), // Day // TODO\n 3: (opts) => new Month(opts), // Month\n 4: (opts) => new Year(opts), // Year\n 5: (opts) => new Meridiem(opts), // AM/PM // TODO (special)\n 6: (opts) => new Hours(opts), // Hours\n 7: (opts) => new Minutes(opts), // Minutes\n 8: (opts) => new Seconds(opts), // Seconds\n 9: (opts) => new Milliseconds(opts), // Fractional seconds\n}\n\nconst dfltLocales = {\n months: 'January,February,March,April,May,June,July,August,September,October,November,December'.split(','),\n monthsShort: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),\n weekdays: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),\n weekdaysShort: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(',')\n}\n\n\n/**\n * DatePrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Number} [opts.initial] Index of default value\n * @param {String} [opts.mask] The format mask\n * @param {object} [opts.locales] The date locales\n * @param {String} [opts.error] The error message shown on invalid value\n * @param {Function} [opts.validate] Function to validate the submitted value\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\nclass DatePrompt extends Prompt {\n constructor(opts={}) {\n super(opts);\n this.msg = opts.message;\n this.cursor = 0;\n this.typed = '';\n this.locales = Object.assign(dfltLocales, opts.locales);\n this._date = opts.initial || new Date();\n this.errorMsg = opts.error || 'Please Enter A Valid Value';\n this.validator = opts.validate || (() => true);\n this.mask = opts.mask || 'YYYY-MM-DD HH:mm:ss';\n this.clear = clear('', this.out.columns);\n this.render();\n }\n\n get value() {\n return this.date\n }\n\n get date() {\n return this._date;\n }\n\n set date(date) {\n if (date) this._date.setTime(date.getTime());\n }\n\n set mask(mask) {\n let result;\n this.parts = [];\n while(result = regex.exec(mask)) {\n let match = result.shift();\n let idx = result.findIndex(gr => gr != null);\n this.parts.push(idx in regexGroups\n ? regexGroups[idx]({ token: result[idx] || match, date: this.date, parts: this.parts, locales: this.locales })\n : result[idx] || match);\n }\n\n let parts = this.parts.reduce((arr, i) => {\n if (typeof i === 'string' && typeof arr[arr.length - 1] === 'string')\n arr[arr.length - 1] += i;\n else arr.push(i);\n return arr;\n }, []);\n\n this.parts.splice(0);\n this.parts.push(...parts);\n this.reset();\n }\n\n moveCursor(n) {\n this.typed = '';\n this.cursor = n;\n this.fire();\n }\n\n reset() {\n this.moveCursor(this.parts.findIndex(p => p instanceof DatePart));\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.error = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n async validate() {\n let valid = await this.validator(this.value);\n if (typeof valid === 'string') {\n this.errorMsg = valid;\n valid = false;\n }\n this.error = !valid;\n }\n\n async submit() {\n await this.validate();\n if (this.error) {\n this.color = 'red';\n this.fire();\n this.render();\n return;\n }\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n up() {\n this.typed = '';\n this.parts[this.cursor].up();\n this.render();\n }\n\n down() {\n this.typed = '';\n this.parts[this.cursor].down();\n this.render();\n }\n\n left() {\n let prev = this.parts[this.cursor].prev();\n if (prev == null) return this.bell();\n this.moveCursor(this.parts.indexOf(prev));\n this.render();\n }\n\n right() {\n let next = this.parts[this.cursor].next();\n if (next == null) return this.bell();\n this.moveCursor(this.parts.indexOf(next));\n this.render();\n }\n\n next() {\n let next = this.parts[this.cursor].next();\n this.moveCursor(next\n ? this.parts.indexOf(next)\n : this.parts.findIndex((part) => part instanceof DatePart));\n this.render();\n }\n\n _(c) {\n if (/\\d/.test(c)) {\n this.typed += c;\n this.parts[this.cursor].setTo(this.typed);\n this.render();\n }\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n\n // Print prompt\n this.outputText = [\n style.symbol(this.done, this.aborted),\n color.bold(this.msg),\n style.delimiter(false),\n this.parts.reduce((arr, p, idx) => arr.concat(idx === this.cursor && !this.done ? color.cyan().underline(p.toString()) : p), [])\n .join('')\n ].join(' ');\n\n // Print error\n if (this.error) {\n this.outputText += this.errorMsg.split('\\n').reduce(\n (a, l, i) => a + `\\n${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n }\n\n this.out.write(erase.line + cursor.to(0) + this.outputText);\n }\n}\n\nmodule.exports = DatePrompt;\n", "const color = require('kleur');\nconst Prompt = require('./prompt');\nconst { cursor, erase } = require('sisteransi');\nconst { style, figures, clear, lines } = require('../util');\n\nconst isNumber = /[0-9]/;\nconst isDef = any => any !== undefined;\nconst round = (number, precision) => {\n let factor = Math.pow(10, precision);\n return Math.round(number * factor) / factor;\n}\n\n/**\n * NumberPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {String} [opts.style='default'] Render style\n * @param {Number} [opts.initial] Default value\n * @param {Number} [opts.max=+Infinity] Max value\n * @param {Number} [opts.min=-Infinity] Min value\n * @param {Boolean} [opts.float=false] Parse input as floats\n * @param {Number} [opts.round=2] Round floats to x decimals\n * @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n * @param {Function} [opts.validate] Validate function\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {String} [opts.error] The invalid error label\n */\nclass NumberPrompt extends Prompt {\n constructor(opts={}) {\n super(opts);\n this.transform = style.render(opts.style);\n this.msg = opts.message;\n this.initial = isDef(opts.initial) ? opts.initial : '';\n this.float = !!opts.float;\n this.round = opts.round || 2;\n this.inc = opts.increment || 1;\n this.min = isDef(opts.min) ? opts.min : -Infinity;\n this.max = isDef(opts.max) ? opts.max : Infinity;\n this.errorMsg = opts.error || `Please Enter A Valid Value`;\n this.validator = opts.validate || (() => true);\n this.color = `cyan`;\n this.value = ``;\n this.typed = ``;\n this.lastHit = 0;\n this.render();\n }\n\n set value(v) {\n if (!v && v !== 0) {\n this.placeholder = true;\n this.rendered = color.gray(this.transform.render(`${this.initial}`));\n this._value = ``;\n } else {\n this.placeholder = false;\n this.rendered = this.transform.render(`${round(v, this.round)}`);\n this._value = round(v, this.round);\n }\n this.fire();\n }\n\n get value() {\n return this._value;\n }\n\n parse(x) {\n return this.float ? parseFloat(x) : parseInt(x);\n }\n\n valid(c) {\n return c === `-` || c === `.` && this.float || isNumber.test(c)\n }\n\n reset() {\n this.typed = ``;\n this.value = ``;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n let x = this.value;\n this.value = x !== `` ? x : this.initial;\n this.done = this.aborted = true;\n this.error = false;\n this.fire();\n this.render();\n this.out.write(`\\n`);\n this.close();\n }\n\n async validate() {\n let valid = await this.validator(this.value);\n if (typeof valid === `string`) {\n this.errorMsg = valid;\n valid = false;\n }\n this.error = !valid;\n }\n\n async submit() {\n await this.validate();\n if (this.error) {\n this.color = `red`;\n this.fire();\n this.render();\n return;\n }\n let x = this.value;\n this.value = x !== `` ? x : this.initial;\n this.done = true;\n this.aborted = false;\n this.error = false;\n this.fire();\n this.render();\n this.out.write(`\\n`);\n this.close();\n }\n\n up() {\n this.typed = ``;\n if(this.value === '') {\n this.value = this.min - this.inc;\n }\n if (this.value >= this.max) return this.bell();\n this.value += this.inc;\n this.color = `cyan`;\n this.fire();\n this.render();\n }\n\n down() {\n this.typed = ``;\n if(this.value === '') {\n this.value = this.min + this.inc;\n }\n if (this.value <= this.min) return this.bell();\n this.value -= this.inc;\n this.color = `cyan`;\n this.fire();\n this.render();\n }\n\n delete() {\n let val = this.value.toString();\n if (val.length === 0) return this.bell();\n this.value = this.parse((val = val.slice(0, -1))) || ``;\n if (this.value !== '' && this.value < this.min) {\n this.value = this.min;\n }\n this.color = `cyan`;\n this.fire();\n this.render();\n }\n\n next() {\n this.value = this.initial;\n this.fire();\n this.render();\n }\n\n _(c, key) {\n if (!this.valid(c)) return this.bell();\n\n const now = Date.now();\n if (now - this.lastHit > 1000) this.typed = ``; // 1s elapsed\n this.typed += c;\n this.lastHit = now;\n this.color = `cyan`;\n\n if (c === `.`) return this.fire();\n\n this.value = Math.min(this.parse(this.typed), this.max);\n if (this.value > this.max) this.value = this.max;\n if (this.value < this.min) this.value = this.min;\n this.fire();\n this.render();\n }\n\n render() {\n if (this.closed) return;\n if (!this.firstRender) {\n if (this.outputError)\n this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));\n this.out.write(clear(this.outputText, this.out.columns));\n }\n super.render();\n this.outputError = '';\n\n // Print prompt\n this.outputText = [\n style.symbol(this.done, this.aborted),\n color.bold(this.msg),\n style.delimiter(this.done),\n !this.done || (!this.done && !this.placeholder)\n ? color[this.color]().underline(this.rendered) : this.rendered\n ].join(` `);\n\n // Print error\n if (this.error) {\n this.outputError += this.errorMsg.split(`\\n`)\n .reduce((a, l, i) => a + `\\n${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n }\n\n this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore);\n }\n}\n\nmodule.exports = NumberPrompt;\n", "'use strict';\n\nconst color = require('kleur');\nconst { cursor } = require('sisteransi');\nconst Prompt = require('./prompt');\nconst { clear, figures, style, wrap, entriesToDisplay } = require('../util');\n\n/**\n * MultiselectPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Array} opts.choices Array of choice objects\n * @param {String} [opts.hint] Hint to display\n * @param {String} [opts.warn] Hint shown for disabled choices\n * @param {Number} [opts.max] Max choices\n * @param {Number} [opts.cursor=0] Cursor start position\n * @param {Number} [opts.optionsPerPage=10] Max options to display at once\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\nclass MultiselectPrompt extends Prompt {\n constructor(opts={}) {\n super(opts);\n this.msg = opts.message;\n this.cursor = opts.cursor || 0;\n this.scrollIndex = opts.cursor || 0;\n this.hint = opts.hint || '';\n this.warn = opts.warn || '- This option is disabled -';\n this.minSelected = opts.min;\n this.showMinError = false;\n this.maxChoices = opts.max;\n this.instructions = opts.instructions;\n this.optionsPerPage = opts.optionsPerPage || 10;\n this.value = opts.choices.map((ch, idx) => {\n if (typeof ch === 'string')\n ch = {title: ch, value: idx};\n return {\n title: ch && (ch.title || ch.value || ch),\n description: ch && ch.description,\n value: ch && (ch.value === undefined ? idx : ch.value),\n selected: ch && ch.selected,\n disabled: ch && ch.disabled\n };\n });\n this.clear = clear('', this.out.columns);\n if (!opts.overrideRender) {\n this.render();\n }\n }\n\n reset() {\n this.value.map(v => !v.selected);\n this.cursor = 0;\n this.fire();\n this.render();\n }\n\n selected() {\n return this.value.filter(v => v.selected);\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n const selected = this.value\n .filter(e => e.selected);\n if (this.minSelected && selected.length < this.minSelected) {\n this.showMinError = true;\n this.render();\n } else {\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n }\n\n first() {\n this.cursor = 0;\n this.render();\n }\n\n last() {\n this.cursor = this.value.length - 1;\n this.render();\n }\n next() {\n this.cursor = (this.cursor + 1) % this.value.length;\n this.render();\n }\n\n up() {\n if (this.cursor === 0) {\n this.cursor = this.value.length - 1;\n } else {\n this.cursor--;\n }\n this.render();\n }\n\n down() {\n if (this.cursor === this.value.length - 1) {\n this.cursor = 0;\n } else {\n this.cursor++;\n }\n this.render();\n }\n\n left() {\n this.value[this.cursor].selected = false;\n this.render();\n }\n\n right() {\n if (this.value.filter(e => e.selected).length >= this.maxChoices) return this.bell();\n this.value[this.cursor].selected = true;\n this.render();\n }\n\n handleSpaceToggle() {\n const v = this.value[this.cursor];\n\n if (v.selected) {\n v.selected = false;\n this.render();\n } else if (v.disabled || this.value.filter(e => e.selected).length >= this.maxChoices) {\n return this.bell();\n } else {\n v.selected = true;\n this.render();\n }\n }\n\n toggleAll() {\n if (this.maxChoices !== undefined || this.value[this.cursor].disabled) {\n return this.bell();\n }\n\n const newSelected = !this.value[this.cursor].selected;\n this.value.filter(v => !v.disabled).forEach(v => v.selected = newSelected);\n this.render();\n }\n\n _(c, key) {\n if (c === ' ') {\n this.handleSpaceToggle();\n } else if (c === 'a') {\n this.toggleAll();\n } else {\n return this.bell();\n }\n }\n\n renderInstructions() {\n if (this.instructions === undefined || this.instructions) {\n if (typeof this.instructions === 'string') {\n return this.instructions;\n }\n return '\\nInstructions:\\n'\n + ` ${figures.arrowUp}/${figures.arrowDown}: Highlight option\\n`\n + ` ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection\\n`\n + (this.maxChoices === undefined ? ` a: Toggle all\\n` : '')\n + ` enter/return: Complete answer`;\n }\n return '';\n }\n\n renderOption(cursor, v, i, arrowIndicator) {\n const prefix = (v.selected ? color.green(figures.radioOn) : figures.radioOff) + ' ' + arrowIndicator + ' ';\n let title, desc;\n\n if (v.disabled) {\n title = cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);\n } else {\n title = cursor === i ? color.cyan().underline(v.title) : v.title;\n if (cursor === i && v.description) {\n desc = ` - ${v.description}`;\n if (prefix.length + title.length + desc.length >= this.out.columns\n || v.description.split(/\\r?\\n/).length > 1) {\n desc = '\\n' + wrap(v.description, { margin: prefix.length, width: this.out.columns });\n }\n }\n }\n\n return prefix + title + color.gray(desc || '');\n }\n\n // shared with autocompleteMultiselect\n paginateOptions(options) {\n if (options.length === 0) {\n return color.red('No matches for this query.');\n }\n\n let { startIndex, endIndex } = entriesToDisplay(this.cursor, options.length, this.optionsPerPage);\n let prefix, styledOptions = [];\n\n for (let i = startIndex; i < endIndex; i++) {\n if (i === startIndex && startIndex > 0) {\n prefix = figures.arrowUp;\n } else if (i === endIndex - 1 && endIndex < options.length) {\n prefix = figures.arrowDown;\n } else {\n prefix = ' ';\n }\n styledOptions.push(this.renderOption(this.cursor, options[i], i, prefix));\n }\n\n return '\\n' + styledOptions.join('\\n');\n }\n\n // shared with autocomleteMultiselect\n renderOptions(options) {\n if (!this.done) {\n return this.paginateOptions(options);\n }\n return '';\n }\n\n renderDoneOrInstructions() {\n if (this.done) {\n return this.value\n .filter(e => e.selected)\n .map(v => v.title)\n .join(', ');\n }\n\n const output = [color.gray(this.hint), this.renderInstructions()];\n\n if (this.value[this.cursor].disabled) {\n output.push(color.yellow(this.warn));\n }\n return output.join(' ');\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n super.render();\n\n // print prompt\n let prompt = [\n style.symbol(this.done, this.aborted),\n color.bold(this.msg),\n style.delimiter(false),\n this.renderDoneOrInstructions()\n ].join(' ');\n if (this.showMinError) {\n prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`);\n this.showMinError = false;\n }\n prompt += this.renderOptions(this.value);\n\n this.out.write(this.clear + prompt);\n this.clear = clear(prompt, this.out.columns);\n }\n}\n\nmodule.exports = MultiselectPrompt;\n", "'use strict';\n\nconst color = require('kleur');\nconst Prompt = require('./prompt');\nconst { erase, cursor } = require('sisteransi');\nconst { style, clear, figures, wrap, entriesToDisplay } = require('../util');\n\nconst getVal = (arr, i) => arr[i] && (arr[i].value || arr[i].title || arr[i]);\nconst getTitle = (arr, i) => arr[i] && (arr[i].title || arr[i].value || arr[i]);\nconst getIndex = (arr, valOrTitle) => {\n const index = arr.findIndex(el => el.value === valOrTitle || el.title === valOrTitle);\n return index > -1 ? index : undefined;\n};\n\n/**\n * TextPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Array} opts.choices Array of auto-complete choices objects\n * @param {Function} [opts.suggest] Filter function. Defaults to sort by title\n * @param {Number} [opts.limit=10] Max number of results to show\n * @param {Number} [opts.cursor=0] Cursor start position\n * @param {String} [opts.style='default'] Render style\n * @param {String} [opts.fallback] Fallback message - initial to default value\n * @param {String} [opts.initial] Index of the default value\n * @param {Boolean} [opts.clearFirst] The first ESCAPE keypress will clear the input\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {String} [opts.noMatches] The no matches found label\n */\nclass AutocompletePrompt extends Prompt {\n constructor(opts={}) {\n super(opts);\n this.msg = opts.message;\n this.suggest = opts.suggest;\n this.choices = opts.choices;\n this.initial = typeof opts.initial === 'number'\n ? opts.initial\n : getIndex(opts.choices, opts.initial);\n this.select = this.initial || opts.cursor || 0;\n this.i18n = { noMatches: opts.noMatches || 'no matches found' };\n this.fallback = opts.fallback || this.initial;\n this.clearFirst = opts.clearFirst || false;\n this.suggestions = [];\n this.input = '';\n this.limit = opts.limit || 10;\n this.cursor = 0;\n this.transform = style.render(opts.style);\n this.scale = this.transform.scale;\n this.render = this.render.bind(this);\n this.complete = this.complete.bind(this);\n this.clear = clear('', this.out.columns);\n this.complete(this.render);\n this.render();\n }\n\n set fallback(fb) {\n this._fb = Number.isSafeInteger(parseInt(fb)) ? parseInt(fb) : fb;\n }\n\n get fallback() {\n let choice;\n if (typeof this._fb === 'number')\n choice = this.choices[this._fb];\n else if (typeof this._fb === 'string')\n choice = { title: this._fb };\n return choice || this._fb || { title: this.i18n.noMatches };\n }\n\n moveSelect(i) {\n this.select = i;\n if (this.suggestions.length > 0)\n this.value = getVal(this.suggestions, i);\n else this.value = this.fallback.value;\n this.fire();\n }\n\n async complete(cb) {\n const p = (this.completing = this.suggest(this.input, this.choices));\n const suggestions = await p;\n\n if (this.completing !== p) return;\n this.suggestions = suggestions\n .map((s, i, arr) => ({ title: getTitle(arr, i), value: getVal(arr, i), description: s.description }));\n this.completing = false;\n const l = Math.max(suggestions.length - 1, 0);\n this.moveSelect(Math.min(l, this.select));\n\n cb && cb();\n }\n\n reset() {\n this.input = '';\n this.complete(() => {\n this.moveSelect(this.initial !== void 0 ? this.initial : 0);\n this.render();\n });\n this.render();\n }\n\n exit() {\n if (this.clearFirst && this.input.length > 0) {\n this.reset();\n } else {\n this.done = this.exited = true; \n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n }\n\n abort() {\n this.done = this.aborted = true;\n this.exited = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n this.done = true;\n this.aborted = this.exited = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n _(c, key) {\n let s1 = this.input.slice(0, this.cursor);\n let s2 = this.input.slice(this.cursor);\n this.input = `${s1}${c}${s2}`;\n this.cursor = s1.length+1;\n this.complete(this.render);\n this.render();\n }\n\n delete() {\n if (this.cursor === 0) return this.bell();\n let s1 = this.input.slice(0, this.cursor-1);\n let s2 = this.input.slice(this.cursor);\n this.input = `${s1}${s2}`;\n this.complete(this.render);\n this.cursor = this.cursor-1;\n this.render();\n }\n\n deleteForward() {\n if(this.cursor*this.scale >= this.rendered.length) return this.bell();\n let s1 = this.input.slice(0, this.cursor);\n let s2 = this.input.slice(this.cursor+1);\n this.input = `${s1}${s2}`;\n this.complete(this.render);\n this.render();\n }\n\n first() {\n this.moveSelect(0);\n this.render();\n }\n\n last() {\n this.moveSelect(this.suggestions.length - 1);\n this.render();\n }\n\n up() {\n if (this.select === 0) {\n this.moveSelect(this.suggestions.length - 1);\n } else {\n this.moveSelect(this.select - 1);\n }\n this.render();\n }\n\n down() {\n if (this.select === this.suggestions.length - 1) {\n this.moveSelect(0);\n } else {\n this.moveSelect(this.select + 1);\n }\n this.render();\n }\n\n next() {\n if (this.select === this.suggestions.length - 1) {\n this.moveSelect(0);\n } else this.moveSelect(this.select + 1);\n this.render();\n }\n\n nextPage() {\n this.moveSelect(Math.min(this.select + this.limit, this.suggestions.length - 1));\n this.render();\n }\n\n prevPage() {\n this.moveSelect(Math.max(this.select - this.limit, 0));\n this.render();\n }\n\n left() {\n if (this.cursor <= 0) return this.bell();\n this.cursor = this.cursor-1;\n this.render();\n }\n\n right() {\n if (this.cursor*this.scale >= this.rendered.length) return this.bell();\n this.cursor = this.cursor+1;\n this.render();\n }\n\n renderOption(v, hovered, isStart, isEnd) {\n let desc;\n let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : ' ';\n let title = hovered ? color.cyan().underline(v.title) : v.title;\n prefix = (hovered ? color.cyan(figures.pointer) + ' ' : ' ') + prefix;\n if (v.description) {\n desc = ` - ${v.description}`;\n if (prefix.length + title.length + desc.length >= this.out.columns\n || v.description.split(/\\r?\\n/).length > 1) {\n desc = '\\n' + wrap(v.description, { margin: 3, width: this.out.columns })\n }\n }\n return prefix + ' ' + title + color.gray(desc || '');\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n\n let { startIndex, endIndex } = entriesToDisplay(this.select, this.choices.length, this.limit);\n\n this.outputText = [\n style.symbol(this.done, this.aborted, this.exited),\n color.bold(this.msg),\n style.delimiter(this.completing),\n this.done && this.suggestions[this.select]\n ? this.suggestions[this.select].title\n : this.rendered = this.transform.render(this.input)\n ].join(' ');\n\n if (!this.done) {\n const suggestions = this.suggestions\n .slice(startIndex, endIndex)\n .map((item, i) => this.renderOption(item,\n this.select === i + startIndex,\n i === 0 && startIndex > 0,\n i + startIndex === endIndex - 1 && endIndex < this.choices.length))\n .join('\\n');\n this.outputText += `\\n` + (suggestions || color.gray(this.fallback.title));\n }\n\n this.out.write(erase.line + cursor.to(0) + this.outputText);\n }\n}\n\nmodule.exports = AutocompletePrompt;\n", "'use strict';\n\nconst color = require('kleur');\nconst { cursor } = require('sisteransi');\nconst MultiselectPrompt = require('./multiselect');\nconst { clear, style, figures } = require('../util');\n/**\n * MultiselectPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Array} opts.choices Array of choice objects\n * @param {String} [opts.hint] Hint to display\n * @param {String} [opts.warn] Hint shown for disabled choices\n * @param {Number} [opts.max] Max choices\n * @param {Number} [opts.cursor=0] Cursor start position\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\nclass AutocompleteMultiselectPrompt extends MultiselectPrompt {\n constructor(opts={}) {\n opts.overrideRender = true;\n super(opts);\n this.inputValue = '';\n this.clear = clear('', this.out.columns);\n this.filteredOptions = this.value;\n this.render();\n }\n\n last() {\n this.cursor = this.filteredOptions.length - 1;\n this.render();\n }\n next() {\n this.cursor = (this.cursor + 1) % this.filteredOptions.length;\n this.render();\n }\n\n up() {\n if (this.cursor === 0) {\n this.cursor = this.filteredOptions.length - 1;\n } else {\n this.cursor--;\n }\n this.render();\n }\n\n down() {\n if (this.cursor === this.filteredOptions.length - 1) {\n this.cursor = 0;\n } else {\n this.cursor++;\n }\n this.render();\n }\n\n left() {\n this.filteredOptions[this.cursor].selected = false;\n this.render();\n }\n\n right() {\n if (this.value.filter(e => e.selected).length >= this.maxChoices) return this.bell();\n this.filteredOptions[this.cursor].selected = true;\n this.render();\n }\n\n delete() {\n if (this.inputValue.length) {\n this.inputValue = this.inputValue.substr(0, this.inputValue.length - 1);\n this.updateFilteredOptions();\n }\n }\n\n updateFilteredOptions() {\n const currentHighlight = this.filteredOptions[this.cursor];\n this.filteredOptions = this.value\n .filter(v => {\n if (this.inputValue) {\n if (typeof v.title === 'string') {\n if (v.title.toLowerCase().includes(this.inputValue.toLowerCase())) {\n return true;\n }\n }\n if (typeof v.value === 'string') {\n if (v.value.toLowerCase().includes(this.inputValue.toLowerCase())) {\n return true;\n }\n }\n return false;\n }\n return true;\n });\n const newHighlightIndex = this.filteredOptions.findIndex(v => v === currentHighlight)\n this.cursor = newHighlightIndex < 0 ? 0 : newHighlightIndex;\n this.render();\n }\n\n handleSpaceToggle() {\n const v = this.filteredOptions[this.cursor];\n\n if (v.selected) {\n v.selected = false;\n this.render();\n } else if (v.disabled || this.value.filter(e => e.selected).length >= this.maxChoices) {\n return this.bell();\n } else {\n v.selected = true;\n this.render();\n }\n }\n\n handleInputChange(c) {\n this.inputValue = this.inputValue + c;\n this.updateFilteredOptions();\n }\n\n _(c, key) {\n if (c === ' ') {\n this.handleSpaceToggle();\n } else {\n this.handleInputChange(c);\n }\n }\n\n renderInstructions() {\n if (this.instructions === undefined || this.instructions) {\n if (typeof this.instructions === 'string') {\n return this.instructions;\n }\n return `\nInstructions:\n ${figures.arrowUp}/${figures.arrowDown}: Highlight option\n ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`;\n }\n return '';\n }\n\n renderCurrentInput() {\n return `\nFiltered results for: ${this.inputValue ? this.inputValue : color.gray('Enter something to filter')}\\n`;\n }\n\n renderOption(cursor, v, i) {\n let title;\n if (v.disabled) title = cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);\n else title = cursor === i ? color.cyan().underline(v.title) : v.title;\n return (v.selected ? color.green(figures.radioOn) : figures.radioOff) + ' ' + title\n }\n\n renderDoneOrInstructions() {\n if (this.done) {\n return this.value\n .filter(e => e.selected)\n .map(v => v.title)\n .join(', ');\n }\n\n const output = [color.gray(this.hint), this.renderInstructions(), this.renderCurrentInput()];\n\n if (this.filteredOptions.length && this.filteredOptions[this.cursor].disabled) {\n output.push(color.yellow(this.warn));\n }\n return output.join(' ');\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n super.render();\n\n // print prompt\n\n let prompt = [\n style.symbol(this.done, this.aborted),\n color.bold(this.msg),\n style.delimiter(false),\n this.renderDoneOrInstructions()\n ].join(' ');\n\n if (this.showMinError) {\n prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`);\n this.showMinError = false;\n }\n prompt += this.renderOptions(this.filteredOptions);\n\n this.out.write(this.clear + prompt);\n this.clear = clear(prompt, this.out.columns);\n }\n}\n\nmodule.exports = AutocompleteMultiselectPrompt;\n", "const color = require('kleur');\nconst Prompt = require('./prompt');\nconst { style, clear } = require('../util');\nconst { erase, cursor } = require('sisteransi');\n\n/**\n * ConfirmPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Boolean} [opts.initial] Default value (true/false)\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {String} [opts.yes] The \"Yes\" label\n * @param {String} [opts.yesOption] The \"Yes\" option when choosing between yes/no\n * @param {String} [opts.no] The \"No\" label\n * @param {String} [opts.noOption] The \"No\" option when choosing between yes/no\n */\nclass ConfirmPrompt extends Prompt {\n constructor(opts={}) {\n super(opts);\n this.msg = opts.message;\n this.value = opts.initial;\n this.initialValue = !!opts.initial;\n this.yesMsg = opts.yes || 'yes';\n this.yesOption = opts.yesOption || '(Y/n)';\n this.noMsg = opts.no || 'no';\n this.noOption = opts.noOption || '(y/N)';\n this.render();\n }\n\n reset() {\n this.value = this.initialValue;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n this.value = this.value || false;\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n _(c, key) {\n if (c.toLowerCase() === 'y') {\n this.value = true;\n return this.submit();\n }\n if (c.toLowerCase() === 'n') {\n this.value = false;\n return this.submit();\n }\n return this.bell();\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);\n else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n\n this.outputText = [\n style.symbol(this.done, this.aborted),\n color.bold(this.msg),\n style.delimiter(this.done),\n this.done ? (this.value ? this.yesMsg : this.noMsg)\n : color.gray(this.initialValue ? this.yesOption : this.noOption)\n ].join(' ');\n\n this.out.write(erase.line + cursor.to(0) + this.outputText);\n }\n}\n\nmodule.exports = ConfirmPrompt;\n", "'use strict';\n\nmodule.exports = {\n TextPrompt: require('./text'),\n SelectPrompt: require('./select'),\n TogglePrompt: require('./toggle'),\n DatePrompt: require('./date'),\n NumberPrompt: require('./number'),\n MultiselectPrompt: require('./multiselect'),\n AutocompletePrompt: require('./autocomplete'),\n AutocompleteMultiselectPrompt: require('./autocompleteMultiselect'),\n ConfirmPrompt: require('./confirm')\n};\n", "'use strict';\nconst $ = exports;\nconst el = require('./elements');\nconst noop = v => v;\n\nfunction toPrompt(type, args, opts={}) {\n return new Promise((res, rej) => {\n const p = new el[type](args);\n const onAbort = opts.onAbort || noop;\n const onSubmit = opts.onSubmit || noop;\n const onExit = opts.onExit || noop;\n p.on('state', args.onState || noop);\n p.on('submit', x => res(onSubmit(x)));\n p.on('exit', x => res(onExit(x)));\n p.on('abort', x => rej(onAbort(x)));\n });\n}\n\n/**\n * Text prompt\n * @param {string} args.message Prompt message to display\n * @param {string} [args.initial] Default string value\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {function} [args.onState] On state change callback\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.text = args => toPrompt('TextPrompt', args);\n\n/**\n * Password prompt with masked input\n * @param {string} args.message Prompt message to display\n * @param {string} [args.initial] Default string value\n * @param {function} [args.onState] On state change callback\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.password = args => {\n args.style = 'password';\n return $.text(args);\n};\n\n/**\n * Prompt where input is invisible, like sudo\n * @param {string} args.message Prompt message to display\n * @param {string} [args.initial] Default string value\n * @param {function} [args.onState] On state change callback\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.invisible = args => {\n args.style = 'invisible';\n return $.text(args);\n};\n\n/**\n * Number prompt\n * @param {string} args.message Prompt message to display\n * @param {number} args.initial Default number value\n * @param {function} [args.onState] On state change callback\n * @param {number} [args.max] Max value\n * @param {number} [args.min] Min value\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {Boolean} [opts.float=false] Parse input as floats\n * @param {Number} [opts.round=2] Round floats to x decimals\n * @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.number = args => toPrompt('NumberPrompt', args);\n\n/**\n * Date prompt\n * @param {string} args.message Prompt message to display\n * @param {number} args.initial Default number value\n * @param {function} [args.onState] On state change callback\n * @param {number} [args.max] Max value\n * @param {number} [args.min] Min value\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {Boolean} [opts.float=false] Parse input as floats\n * @param {Number} [opts.round=2] Round floats to x decimals\n * @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n * @param {function} [args.validate] Function to validate user input\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.date = args => toPrompt('DatePrompt', args);\n\n/**\n * Classic yes/no prompt\n * @param {string} args.message Prompt message to display\n * @param {boolean} [args.initial=false] Default value\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.confirm = args => toPrompt('ConfirmPrompt', args);\n\n/**\n * List prompt, split intput string by `seperator`\n * @param {string} args.message Prompt message to display\n * @param {string} [args.initial] Default string value\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {string} [args.separator] String separator\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input, in form of an `Array`\n */\n$.list = args => {\n const sep = args.separator || ',';\n return toPrompt('TextPrompt', args, {\n onSubmit: str => str.split(sep).map(s => s.trim())\n });\n};\n\n/**\n * Toggle/switch prompt\n * @param {string} args.message Prompt message to display\n * @param {boolean} [args.initial=false] Default value\n * @param {string} [args.active=\"on\"] Text for `active` state\n * @param {string} [args.inactive=\"off\"] Text for `inactive` state\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.toggle = args => toPrompt('TogglePrompt', args);\n\n/**\n * Interactive select prompt\n * @param {string} args.message Prompt message to display\n * @param {Array} args.choices Array of choices objects `[{ title, value }, ...]`\n * @param {number} [args.initial] Index of default value\n * @param {String} [args.hint] Hint to display\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.select = args => toPrompt('SelectPrompt', args);\n\n/**\n * Interactive multi-select / autocompleteMultiselect prompt\n * @param {string} args.message Prompt message to display\n * @param {Array} args.choices Array of choices objects `[{ title, value, [selected] }, ...]`\n * @param {number} [args.max] Max select\n * @param {string} [args.hint] Hint to display user\n * @param {Number} [args.cursor=0] Cursor start position\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.multiselect = args => {\n args.choices = [].concat(args.choices || []);\n const toSelected = items => items.filter(item => item.selected).map(item => item.value);\n return toPrompt('MultiselectPrompt', args, {\n onAbort: toSelected,\n onSubmit: toSelected\n });\n};\n\n$.autocompleteMultiselect = args => {\n args.choices = [].concat(args.choices || []);\n const toSelected = items => items.filter(item => item.selected).map(item => item.value);\n return toPrompt('AutocompleteMultiselectPrompt', args, {\n onAbort: toSelected,\n onSubmit: toSelected\n });\n};\n\nconst byTitle = (input, choices) => Promise.resolve(\n choices.filter(item => item.title.slice(0, input.length).toLowerCase() === input.toLowerCase())\n);\n\n/**\n * Interactive auto-complete prompt\n * @param {string} args.message Prompt message to display\n * @param {Array} args.choices Array of auto-complete choices objects `[{ title, value }, ...]`\n * @param {Function} [args.suggest] Function to filter results based on user input. Defaults to sort by `title`\n * @param {number} [args.limit=10] Max number of results to show\n * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n * @param {String} [args.initial] Index of the default value\n * @param {boolean} [opts.clearFirst] The first ESCAPE keypress will clear the input\n * @param {String} [args.fallback] Fallback message - defaults to initial value\n * @param {function} [args.onState] On state change callback\n * @param {Stream} [args.stdin] The Readable stream to listen to\n * @param {Stream} [args.stdout] The Writable stream to write readline data to\n * @returns {Promise} Promise with user input\n */\n$.autocomplete = args => {\n args.suggest = args.suggest || byTitle;\n args.choices = [].concat(args.choices || []);\n return toPrompt('AutocompletePrompt', args);\n};\n", "'use strict';\n\nconst prompts = require('./prompts');\n\nconst passOn = ['suggest', 'format', 'onState', 'validate', 'onRender', 'type'];\nconst noop = () => {};\n\n/**\n * Prompt for a series of questions\n * @param {Array|Object} questions Single question object or Array of question objects\n * @param {Function} [onSubmit] Callback function called on prompt submit\n * @param {Function} [onCancel] Callback function called on cancel/abort\n * @returns {Object} Object with values from user input\n */\nasync function prompt(questions=[], { onSubmit=noop, onCancel=noop }={}) {\n const answers = {};\n const override = prompt._override || {};\n questions = [].concat(questions);\n let answer, question, quit, name, type, lastPrompt;\n\n const getFormattedAnswer = async (question, answer, skipValidation = false) => {\n if (!skipValidation && question.validate && question.validate(answer) !== true) {\n return;\n }\n return question.format ? await question.format(answer, answers) : answer\n };\n\n for (question of questions) {\n ({ name, type } = question);\n\n // evaluate type first and skip if type is a falsy value\n if (typeof type === 'function') {\n type = await type(answer, { ...answers }, question)\n question['type'] = type\n }\n if (!type) continue;\n\n // if property is a function, invoke it unless it's a special function\n for (let key in question) {\n if (passOn.includes(key)) continue;\n let value = question[key];\n question[key] = typeof value === 'function' ? await value(answer, { ...answers }, lastPrompt) : value;\n }\n\n lastPrompt = question;\n\n if (typeof question.message !== 'string') {\n throw new Error('prompt message is required');\n }\n\n // update vars in case they changed\n ({ name, type } = question);\n\n if (prompts[type] === void 0) {\n throw new Error(`prompt type (${type}) is not defined`);\n }\n\n if (override[question.name] !== undefined) {\n answer = await getFormattedAnswer(question, override[question.name]);\n if (answer !== undefined) {\n answers[name] = answer;\n continue;\n }\n }\n\n try {\n // Get the injected answer if there is one or prompt the user\n answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : await prompts[type](question);\n answers[name] = answer = await getFormattedAnswer(question, answer, true);\n quit = await onSubmit(question, answer, answers);\n } catch (err) {\n quit = !(await onCancel(question, answers));\n }\n\n if (quit) return answers;\n }\n\n return answers;\n}\n\nfunction getInjectedAnswer(injected, deafultValue) {\n const answer = injected.shift();\n if (answer instanceof Error) {\n throw answer;\n }\n\n return (answer === undefined) ? deafultValue : answer;\n}\n\nfunction inject(answers) {\n prompt._injected = (prompt._injected || []).concat(answers);\n}\n\nfunction override(answers) {\n prompt._override = Object.assign({}, answers);\n}\n\nmodule.exports = Object.assign(prompt, { prompt, prompts, inject, override });\n", "function isNodeLT(tar) {\n tar = (Array.isArray(tar) ? tar : tar.split('.')).map(Number);\n let i=0, src=process.versions.node.split('.').map(Number);\n for (; i < tar.length; i++) {\n if (src[i] > tar[i]) return false;\n if (tar[i] > src[i]) return true;\n }\n return false;\n}\n\nmodule.exports =\n isNodeLT('8.6.0')\n ? require('./dist/index.js')\n : require('./lib/index.js');\n", "/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "'use strict';\n\nmodule.exports = (flag, argv = process.argv) => {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n};\n", "'use strict';\nconst os = require('os');\nconst tty = require('tty');\nconst hasFlag = require('has-flag');\n\nconst {env} = process;\n\nlet flagForceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false') ||\n\thasFlag('color=never')) {\n\tflagForceColor = 0;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif ('FORCE_COLOR' in env) {\n\t\tif (env.FORCE_COLOR === 'true') {\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (env.FORCE_COLOR === 'false') {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m') ||\n\t\t\thasFlag('color=full') ||\n\t\t\thasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream, options = {}) {\n\tconst level = supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options\n\t});\n\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: getSupportLevel({isTTY: tty.isatty(1)}),\n\tstderr: getSupportLevel({isTTY: tty.isatty(2)})\n};\n", "/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.format(...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n", "/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n", "/**\n * Compare a list of case insensitive aliases for a given environment value\n *\n * @param {string} env value to be test\n * @param {string[]} aliases aliases to be compared to\n * @return {boolean}\n */\nmodule.exports = function compareAliases(env, ...aliases) {\n return aliases.some((alias) => alias.toLowerCase() === env.toLowerCase())\n}\n", "const Development = {\n dev: 'dev',\n development: 'development',\n}\n\nconst Production = {\n prod: 'prod',\n production: 'production',\n}\n\nmodule.exports = {\n Production,\n Development,\n}\n", "const compare = require('./compare-aliases')\nconst modes = require('./modes.enum')\n\n/**\n * Given an env value, checks whether NODE_ENV correspond to that value\n *\n * Inspector has two modes of operation, with a given argument or not. Given a\n * argument, the value is compared to a known environment values (dev, prod,...)\n * then a exact insensitive case match is made with the value. If there's no\n * given value, then compare the raw value of NODE_ENV is returned\n *\n * @example <caption>with NODE_ENV=\"dev\"</caption>\n * \t inspector() // \"dev\"\n * \t inspector(\"test\") // false\n * \t inspector(\"development\") // true\n * \t inspector(\"staging\", \"production\") // false\n * \t inspector(\"dev\") // true\n *\n * @param {string[] | undefined} [envs] environment to be tested\n * @return {boolean | string}\n */\nfunction inspector(...envs) {\n const nodeEnv = process.env.NODE_ENV ?? 'development'\n\n if (envs.length === 0) {\n return nodeEnv\n }\n\n return envs.reduce((prev, env) => {\n if (isKnownMode(env, nodeEnv)) {\n return true\n }\n\n return prev || compare(env, nodeEnv)\n }, false)\n}\n\n/**\n * Compare for a known env mode\n * @param {string} env\n * @param {string} nodeEnv\n * @return {boolean}\n */\nfunction isKnownMode(env, nodeEnv) {\n for (const mode of Object.values(modes)) {\n if (compareKnownMode(env, nodeEnv, Object.values(mode))) {\n return true\n }\n }\n\n return false\n}\n\n/**\n *\n * @param {string} env\n * @param {string} nodeEnv\n * @param {string[]} possibleValues\n * @return {boolean}\n */\nfunction compareKnownMode(env, nodeEnv, possibleValues) {\n return compare(env, ...possibleValues) && compare(nodeEnv, ...possibleValues)\n}\n\nmodule.exports = inspector\n", "module.exports = {\n env: require('./inspector'),\n}\n", "'use strict'\n\nexports.fromCallback = function (fn) {\n return Object.defineProperty(function (...args) {\n if (typeof args[args.length - 1] === 'function') fn.apply(this, args)\n else {\n return new Promise((resolve, reject) => {\n fn.call(\n this,\n ...args,\n (err, res) => (err != null) ? reject(err) : resolve(res)\n )\n })\n }\n }, 'name', { value: fn.name })\n}\n\nexports.fromPromise = function (fn) {\n return Object.defineProperty(function (...args) {\n const cb = args[args.length - 1]\n if (typeof cb !== 'function') return fn.apply(this, args)\n else fn.apply(this, args.slice(0, -1)).then(r => cb(null, r), cb)\n }, 'name', { value: fn.name })\n}\n", "var constants = require('constants')\n\nvar origCwd = process.cwd\nvar cwd = null\n\nvar platform = process.env.GRACEFUL_FS_PLATFORM || process.platform\n\nprocess.cwd = function() {\n if (!cwd)\n cwd = origCwd.call(process)\n return cwd\n}\ntry {\n process.cwd()\n} catch (er) {}\n\n// This check is needed until node.js 12 is required\nif (typeof process.chdir === 'function') {\n var chdir = process.chdir\n process.chdir = function (d) {\n cwd = null\n chdir.call(process, d)\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)\n}\n\nmodule.exports = patch\n\nfunction patch (fs) {\n // (re-)implement some things that are known busted or missing.\n\n // lchmod, broken prior to 0.6.2\n // back-port the fix here.\n if (constants.hasOwnProperty('O_SYMLINK') &&\n process.version.match(/^v0\\.6\\.[0-2]|^v0\\.5\\./)) {\n patchLchmod(fs)\n }\n\n // lutimes implementation, or no-op\n if (!fs.lutimes) {\n patchLutimes(fs)\n }\n\n // https://github.com/isaacs/node-graceful-fs/issues/4\n // Chown should not fail on einval or eperm if non-root.\n // It should not fail on enosys ever, as this just indicates\n // that a fs doesn't support the intended operation.\n\n fs.chown = chownFix(fs.chown)\n fs.fchown = chownFix(fs.fchown)\n fs.lchown = chownFix(fs.lchown)\n\n fs.chmod = chmodFix(fs.chmod)\n fs.fchmod = chmodFix(fs.fchmod)\n fs.lchmod = chmodFix(fs.lchmod)\n\n fs.chownSync = chownFixSync(fs.chownSync)\n fs.fchownSync = chownFixSync(fs.fchownSync)\n fs.lchownSync = chownFixSync(fs.lchownSync)\n\n fs.chmodSync = chmodFixSync(fs.chmodSync)\n fs.fchmodSync = chmodFixSync(fs.fchmodSync)\n fs.lchmodSync = chmodFixSync(fs.lchmodSync)\n\n fs.stat = statFix(fs.stat)\n fs.fstat = statFix(fs.fstat)\n fs.lstat = statFix(fs.lstat)\n\n fs.statSync = statFixSync(fs.statSync)\n fs.fstatSync = statFixSync(fs.fstatSync)\n fs.lstatSync = statFixSync(fs.lstatSync)\n\n // if lchmod/lchown do not exist, then make them no-ops\n if (fs.chmod && !fs.lchmod) {\n fs.lchmod = function (path, mode, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchmodSync = function () {}\n }\n if (fs.chown && !fs.lchown) {\n fs.lchown = function (path, uid, gid, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchownSync = function () {}\n }\n\n // on Windows, A/V software can lock the directory, causing this\n // to fail with an EACCES or EPERM if the directory contains newly\n // created files. Try again on failure, for up to 60 seconds.\n\n // Set the timeout this long because some Windows Anti-Virus, such as Parity\n // bit9, may lock files for up to a minute, causing npm package install\n // failures. Also, take care to yield the scheduler. Windows scheduling gives\n // CPU to a busy looping process, which can cause the program causing the lock\n // contention to be starved of CPU by node, so the contention doesn't resolve.\n if (platform === \"win32\") {\n fs.rename = typeof fs.rename !== 'function' ? fs.rename\n : (function (fs$rename) {\n function rename (from, to, cb) {\n var start = Date.now()\n var backoff = 0;\n fs$rename(from, to, function CB (er) {\n if (er\n && (er.code === \"EACCES\" || er.code === \"EPERM\")\n && Date.now() - start < 60000) {\n setTimeout(function() {\n fs.stat(to, function (stater, st) {\n if (stater && stater.code === \"ENOENT\")\n fs$rename(from, to, CB);\n else\n cb(er)\n })\n }, backoff)\n if (backoff < 100)\n backoff += 10;\n return;\n }\n if (cb) cb(er)\n })\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)\n return rename\n })(fs.rename)\n }\n\n // if read() returns EAGAIN, then just try it again.\n fs.read = typeof fs.read !== 'function' ? fs.read\n : (function (fs$read) {\n function read (fd, buffer, offset, length, position, callback_) {\n var callback\n if (callback_ && typeof callback_ === 'function') {\n var eagCounter = 0\n callback = function (er, _, __) {\n if (er && er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n callback_.apply(this, arguments)\n }\n }\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n\n // This ensures `util.promisify` works as it does for native `fs.read`.\n if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)\n return read\n })(fs.read)\n\n fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync\n : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {\n var eagCounter = 0\n while (true) {\n try {\n return fs$readSync.call(fs, fd, buffer, offset, length, position)\n } catch (er) {\n if (er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n continue\n }\n throw er\n }\n }\n }})(fs.readSync)\n\n function patchLchmod (fs) {\n fs.lchmod = function (path, mode, callback) {\n fs.open( path\n , constants.O_WRONLY | constants.O_SYMLINK\n , mode\n , function (err, fd) {\n if (err) {\n if (callback) callback(err)\n return\n }\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n fs.fchmod(fd, mode, function (err) {\n fs.close(fd, function(err2) {\n if (callback) callback(err || err2)\n })\n })\n })\n }\n\n fs.lchmodSync = function (path, mode) {\n var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)\n\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n var threw = true\n var ret\n try {\n ret = fs.fchmodSync(fd, mode)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n }\n\n function patchLutimes (fs) {\n if (constants.hasOwnProperty(\"O_SYMLINK\") && fs.futimes) {\n fs.lutimes = function (path, at, mt, cb) {\n fs.open(path, constants.O_SYMLINK, function (er, fd) {\n if (er) {\n if (cb) cb(er)\n return\n }\n fs.futimes(fd, at, mt, function (er) {\n fs.close(fd, function (er2) {\n if (cb) cb(er || er2)\n })\n })\n })\n }\n\n fs.lutimesSync = function (path, at, mt) {\n var fd = fs.openSync(path, constants.O_SYMLINK)\n var ret\n var threw = true\n try {\n ret = fs.futimesSync(fd, at, mt)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n\n } else if (fs.futimes) {\n fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }\n fs.lutimesSync = function () {}\n }\n }\n\n function chmodFix (orig) {\n if (!orig) return orig\n return function (target, mode, cb) {\n return orig.call(fs, target, mode, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chmodFixSync (orig) {\n if (!orig) return orig\n return function (target, mode) {\n try {\n return orig.call(fs, target, mode)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n\n function chownFix (orig) {\n if (!orig) return orig\n return function (target, uid, gid, cb) {\n return orig.call(fs, target, uid, gid, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chownFixSync (orig) {\n if (!orig) return orig\n return function (target, uid, gid) {\n try {\n return orig.call(fs, target, uid, gid)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n function statFix (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n function callback (er, stats) {\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n if (cb) cb.apply(this, arguments)\n }\n return options ? orig.call(fs, target, options, callback)\n : orig.call(fs, target, callback)\n }\n }\n\n function statFixSync (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options) {\n var stats = options ? orig.call(fs, target, options)\n : orig.call(fs, target)\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n return stats;\n }\n }\n\n // ENOSYS means that the fs doesn't support the op. Just ignore\n // that, because it doesn't matter.\n //\n // if there's no getuid, or if getuid() is something other\n // than 0, and the error is EINVAL or EPERM, then just ignore\n // it.\n //\n // This specific case is a silent failure in cp, install, tar,\n // and most other unix tools that manage permissions.\n //\n // When running as root, or if other types of errors are\n // encountered, then it's strict.\n function chownErOk (er) {\n if (!er)\n return true\n\n if (er.code === \"ENOSYS\")\n return true\n\n var nonroot = !process.getuid || process.getuid() !== 0\n if (nonroot) {\n if (er.code === \"EINVAL\" || er.code === \"EPERM\")\n return true\n }\n\n return false\n }\n}\n", "var Stream = require('stream').Stream\n\nmodule.exports = legacy\n\nfunction legacy (fs) {\n return {\n ReadStream: ReadStream,\n WriteStream: WriteStream\n }\n\n function ReadStream (path, options) {\n if (!(this instanceof ReadStream)) return new ReadStream(path, options);\n\n Stream.call(this);\n\n var self = this;\n\n this.path = path;\n this.fd = null;\n this.readable = true;\n this.paused = false;\n\n this.flags = 'r';\n this.mode = 438; /*=0666*/\n this.bufferSize = 64 * 1024;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.encoding) this.setEncoding(this.encoding);\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.end === undefined) {\n this.end = Infinity;\n } else if ('number' !== typeof this.end) {\n throw TypeError('end must be a Number');\n }\n\n if (this.start > this.end) {\n throw new Error('start must be <= end');\n }\n\n this.pos = this.start;\n }\n\n if (this.fd !== null) {\n process.nextTick(function() {\n self._read();\n });\n return;\n }\n\n fs.open(this.path, this.flags, this.mode, function (err, fd) {\n if (err) {\n self.emit('error', err);\n self.readable = false;\n return;\n }\n\n self.fd = fd;\n self.emit('open', fd);\n self._read();\n })\n }\n\n function WriteStream (path, options) {\n if (!(this instanceof WriteStream)) return new WriteStream(path, options);\n\n Stream.call(this);\n\n this.path = path;\n this.fd = null;\n this.writable = true;\n\n this.flags = 'w';\n this.encoding = 'binary';\n this.mode = 438; /*=0666*/\n this.bytesWritten = 0;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.start < 0) {\n throw new Error('start must be >= zero');\n }\n\n this.pos = this.start;\n }\n\n this.busy = false;\n this._queue = [];\n\n if (this.fd === null) {\n this._open = fs.open;\n this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);\n this.flush();\n }\n }\n}\n", "'use strict'\n\nmodule.exports = clone\n\nvar getPrototypeOf = Object.getPrototypeOf || function (obj) {\n return obj.__proto__\n}\n\nfunction clone (obj) {\n if (obj === null || typeof obj !== 'object')\n return obj\n\n if (obj instanceof Object)\n var copy = { __proto__: getPrototypeOf(obj) }\n else\n var copy = Object.create(null)\n\n Object.getOwnPropertyNames(obj).forEach(function (key) {\n Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))\n })\n\n return copy\n}\n", "var fs = require('fs')\nvar polyfills = require('./polyfills.js')\nvar legacy = require('./legacy-streams.js')\nvar clone = require('./clone.js')\n\nvar util = require('util')\n\n/* istanbul ignore next - node 0.x polyfill */\nvar gracefulQueue\nvar previousSymbol\n\n/* istanbul ignore else - node 0.x polyfill */\nif (typeof Symbol === 'function' && typeof Symbol.for === 'function') {\n gracefulQueue = Symbol.for('graceful-fs.queue')\n // This is used in testing by future versions\n previousSymbol = Symbol.for('graceful-fs.previous')\n} else {\n gracefulQueue = '___graceful-fs.queue'\n previousSymbol = '___graceful-fs.previous'\n}\n\nfunction noop () {}\n\nfunction publishQueue(context, queue) {\n Object.defineProperty(context, gracefulQueue, {\n get: function() {\n return queue\n }\n })\n}\n\nvar debug = noop\nif (util.debuglog)\n debug = util.debuglog('gfs4')\nelse if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || ''))\n debug = function() {\n var m = util.format.apply(util, arguments)\n m = 'GFS4: ' + m.split(/\\n/).join('\\nGFS4: ')\n console.error(m)\n }\n\n// Once time initialization\nif (!fs[gracefulQueue]) {\n // This queue can be shared by multiple loaded instances\n var queue = global[gracefulQueue] || []\n publishQueue(fs, queue)\n\n // Patch fs.close/closeSync to shared queue version, because we need\n // to retry() whenever a close happens *anywhere* in the program.\n // This is essential when multiple graceful-fs instances are\n // in play at the same time.\n fs.close = (function (fs$close) {\n function close (fd, cb) {\n return fs$close.call(fs, fd, function (err) {\n // This function uses the graceful-fs shared queue\n if (!err) {\n resetQueue()\n }\n\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n })\n }\n\n Object.defineProperty(close, previousSymbol, {\n value: fs$close\n })\n return close\n })(fs.close)\n\n fs.closeSync = (function (fs$closeSync) {\n function closeSync (fd) {\n // This function uses the graceful-fs shared queue\n fs$closeSync.apply(fs, arguments)\n resetQueue()\n }\n\n Object.defineProperty(closeSync, previousSymbol, {\n value: fs$closeSync\n })\n return closeSync\n })(fs.closeSync)\n\n if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || '')) {\n process.on('exit', function() {\n debug(fs[gracefulQueue])\n require('assert').equal(fs[gracefulQueue].length, 0)\n })\n }\n}\n\nif (!global[gracefulQueue]) {\n publishQueue(global, fs[gracefulQueue]);\n}\n\nmodule.exports = patch(clone(fs))\nif (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {\n module.exports = patch(fs)\n fs.__patched = true;\n}\n\nfunction patch (fs) {\n // Everything that references the open() function needs to be in here\n polyfills(fs)\n fs.gracefulify = patch\n\n fs.createReadStream = createReadStream\n fs.createWriteStream = createWriteStream\n var fs$readFile = fs.readFile\n fs.readFile = readFile\n function readFile (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$readFile(path, options, cb)\n\n function go$readFile (path, options, cb, startTime) {\n return fs$readFile(path, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$writeFile = fs.writeFile\n fs.writeFile = writeFile\n function writeFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$writeFile(path, data, options, cb)\n\n function go$writeFile (path, data, options, cb, startTime) {\n return fs$writeFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$appendFile = fs.appendFile\n if (fs$appendFile)\n fs.appendFile = appendFile\n function appendFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$appendFile(path, data, options, cb)\n\n function go$appendFile (path, data, options, cb, startTime) {\n return fs$appendFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$copyFile = fs.copyFile\n if (fs$copyFile)\n fs.copyFile = copyFile\n function copyFile (src, dest, flags, cb) {\n if (typeof flags === 'function') {\n cb = flags\n flags = 0\n }\n return go$copyFile(src, dest, flags, cb)\n\n function go$copyFile (src, dest, flags, cb, startTime) {\n return fs$copyFile(src, dest, flags, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$readdir = fs.readdir\n fs.readdir = readdir\n var noReaddirOptionVersions = /^v[0-5]\\./\n function readdir (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n var go$readdir = noReaddirOptionVersions.test(process.version)\n ? function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n : function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, options, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n\n return go$readdir(path, options, cb)\n\n function fs$readdirCallback (path, options, cb, startTime) {\n return function (err, files) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([\n go$readdir,\n [path, options, cb],\n err,\n startTime || Date.now(),\n Date.now()\n ])\n else {\n if (files && files.sort)\n files.sort()\n\n if (typeof cb === 'function')\n cb.call(this, err, files)\n }\n }\n }\n }\n\n if (process.version.substr(0, 4) === 'v0.8') {\n var legStreams = legacy(fs)\n ReadStream = legStreams.ReadStream\n WriteStream = legStreams.WriteStream\n }\n\n var fs$ReadStream = fs.ReadStream\n if (fs$ReadStream) {\n ReadStream.prototype = Object.create(fs$ReadStream.prototype)\n ReadStream.prototype.open = ReadStream$open\n }\n\n var fs$WriteStream = fs.WriteStream\n if (fs$WriteStream) {\n WriteStream.prototype = Object.create(fs$WriteStream.prototype)\n WriteStream.prototype.open = WriteStream$open\n }\n\n Object.defineProperty(fs, 'ReadStream', {\n get: function () {\n return ReadStream\n },\n set: function (val) {\n ReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n Object.defineProperty(fs, 'WriteStream', {\n get: function () {\n return WriteStream\n },\n set: function (val) {\n WriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n // legacy names\n var FileReadStream = ReadStream\n Object.defineProperty(fs, 'FileReadStream', {\n get: function () {\n return FileReadStream\n },\n set: function (val) {\n FileReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n var FileWriteStream = WriteStream\n Object.defineProperty(fs, 'FileWriteStream', {\n get: function () {\n return FileWriteStream\n },\n set: function (val) {\n FileWriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n function ReadStream (path, options) {\n if (this instanceof ReadStream)\n return fs$ReadStream.apply(this, arguments), this\n else\n return ReadStream.apply(Object.create(ReadStream.prototype), arguments)\n }\n\n function ReadStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n if (that.autoClose)\n that.destroy()\n\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n that.read()\n }\n })\n }\n\n function WriteStream (path, options) {\n if (this instanceof WriteStream)\n return fs$WriteStream.apply(this, arguments), this\n else\n return WriteStream.apply(Object.create(WriteStream.prototype), arguments)\n }\n\n function WriteStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n that.destroy()\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n }\n })\n }\n\n function createReadStream (path, options) {\n return new fs.ReadStream(path, options)\n }\n\n function createWriteStream (path, options) {\n return new fs.WriteStream(path, options)\n }\n\n var fs$open = fs.open\n fs.open = open\n function open (path, flags, mode, cb) {\n if (typeof mode === 'function')\n cb = mode, mode = null\n\n return go$open(path, flags, mode, cb)\n\n function go$open (path, flags, mode, cb, startTime) {\n return fs$open(path, flags, mode, function (err, fd) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n return fs\n}\n\nfunction enqueue (elem) {\n debug('ENQUEUE', elem[0].name, elem[1])\n fs[gracefulQueue].push(elem)\n retry()\n}\n\n// keep track of the timeout between retry() calls\nvar retryTimer\n\n// reset the startTime and lastTime to now\n// this resets the start of the 60 second overall timeout as well as the\n// delay between attempts so that we'll retry these jobs sooner\nfunction resetQueue () {\n var now = Date.now()\n for (var i = 0; i < fs[gracefulQueue].length; ++i) {\n // entries that are only a length of 2 are from an older version, don't\n // bother modifying those since they'll be retried anyway.\n if (fs[gracefulQueue][i].length > 2) {\n fs[gracefulQueue][i][3] = now // startTime\n fs[gracefulQueue][i][4] = now // lastTime\n }\n }\n // call retry to make sure we're actively processing the queue\n retry()\n}\n\nfunction retry () {\n // clear the timer and remove it to help prevent unintended concurrency\n clearTimeout(retryTimer)\n retryTimer = undefined\n\n if (fs[gracefulQueue].length === 0)\n return\n\n var elem = fs[gracefulQueue].shift()\n var fn = elem[0]\n var args = elem[1]\n // these items may be unset if they were added by an older graceful-fs\n var err = elem[2]\n var startTime = elem[3]\n var lastTime = elem[4]\n\n // if we don't have a startTime we have no way of knowing if we've waited\n // long enough, so go ahead and retry this item now\n if (startTime === undefined) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args)\n } else if (Date.now() - startTime >= 60000) {\n // it's been more than 60 seconds total, bail now\n debug('TIMEOUT', fn.name, args)\n var cb = args.pop()\n if (typeof cb === 'function')\n cb.call(null, err)\n } else {\n // the amount of time between the last attempt and right now\n var sinceAttempt = Date.now() - lastTime\n // the amount of time between when we first tried, and when we last tried\n // rounded up to at least 1\n var sinceStart = Math.max(lastTime - startTime, 1)\n // backoff. wait longer than the total time we've been retrying, but only\n // up to a maximum of 100ms\n var desiredDelay = Math.min(sinceStart * 1.2, 100)\n // it's been long enough since the last retry, do it again\n if (sinceAttempt >= desiredDelay) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args.concat([startTime]))\n } else {\n // if we can't do this job yet, push it to the end of the queue\n // and let the next iteration check again\n fs[gracefulQueue].push(elem)\n }\n }\n\n // schedule our next run if one isn't already scheduled\n if (retryTimer === undefined) {\n retryTimer = setTimeout(retry, 0)\n }\n}\n", "'use strict'\n// This is adapted from https://github.com/normalize/mz\n// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\n\nconst api = [\n 'access',\n 'appendFile',\n 'chmod',\n 'chown',\n 'close',\n 'copyFile',\n 'fchmod',\n 'fchown',\n 'fdatasync',\n 'fstat',\n 'fsync',\n 'ftruncate',\n 'futimes',\n 'lchmod',\n 'lchown',\n 'link',\n 'lstat',\n 'mkdir',\n 'mkdtemp',\n 'open',\n 'opendir',\n 'readdir',\n 'readFile',\n 'readlink',\n 'realpath',\n 'rename',\n 'rm',\n 'rmdir',\n 'stat',\n 'symlink',\n 'truncate',\n 'unlink',\n 'utimes',\n 'writeFile'\n].filter(key => {\n // Some commands are not available on some systems. Ex:\n // fs.opendir was added in Node.js v12.12.0\n // fs.rm was added in Node.js v14.14.0\n // fs.lchown is not available on at least some Linux\n return typeof fs[key] === 'function'\n})\n\n// Export cloned fs:\nObject.assign(exports, fs)\n\n// Universalify async methods:\napi.forEach(method => {\n exports[method] = u(fs[method])\n})\n\n// We differ from mz/fs in that we still ship the old, broken, fs.exists()\n// since we are a drop-in replacement for the native module\nexports.exists = function (filename, callback) {\n if (typeof callback === 'function') {\n return fs.exists(filename, callback)\n }\n return new Promise(resolve => {\n return fs.exists(filename, resolve)\n })\n}\n\n// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args\n\nexports.read = function (fd, buffer, offset, length, position, callback) {\n if (typeof callback === 'function') {\n return fs.read(fd, buffer, offset, length, position, callback)\n }\n return new Promise((resolve, reject) => {\n fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {\n if (err) return reject(err)\n resolve({ bytesRead, buffer })\n })\n })\n}\n\n// Function signature can be\n// fs.write(fd, buffer[, offset[, length[, position]]], callback)\n// OR\n// fs.write(fd, string[, position[, encoding]], callback)\n// We need to handle both cases, so we use ...args\nexports.write = function (fd, buffer, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.write(fd, buffer, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => {\n if (err) return reject(err)\n resolve({ bytesWritten, buffer })\n })\n })\n}\n\n// fs.writev only available in Node v12.9.0+\nif (typeof fs.writev === 'function') {\n // Function signature is\n // s.writev(fd, buffers[, position], callback)\n // We need to handle the optional arg, so we use ...args\n exports.writev = function (fd, buffers, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.writev(fd, buffers, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {\n if (err) return reject(err)\n resolve({ bytesWritten, buffers })\n })\n })\n }\n}\n\n// fs.realpath.native sometimes not available if fs is monkey-patched\nif (typeof fs.realpath.native === 'function') {\n exports.realpath.native = u(fs.realpath.native)\n} else {\n process.emitWarning(\n 'fs.realpath.native is not a function. Is fs being monkey-patched?',\n 'Warning', 'fs-extra-WARN0003'\n )\n}\n", "// Adapted from https://github.com/sindresorhus/make-dir\n// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)\n// 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:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// 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.\n'use strict'\nconst path = require('path')\n\n// https://github.com/nodejs/node/issues/8987\n// https://github.com/libuv/libuv/pull/1088\nmodule.exports.checkPath = function checkPath (pth) {\n if (process.platform === 'win32') {\n const pathHasInvalidWinCharacters = /[<>:\"|?*]/.test(pth.replace(path.parse(pth).root, ''))\n\n if (pathHasInvalidWinCharacters) {\n const error = new Error(`Path contains invalid characters: ${pth}`)\n error.code = 'EINVAL'\n throw error\n }\n }\n}\n", "'use strict'\nconst fs = require('../fs')\nconst { checkPath } = require('./utils')\n\nconst getMode = options => {\n const defaults = { mode: 0o777 }\n if (typeof options === 'number') return options\n return ({ ...defaults, ...options }).mode\n}\n\nmodule.exports.makeDir = async (dir, options) => {\n checkPath(dir)\n\n return fs.mkdir(dir, {\n mode: getMode(options),\n recursive: true\n })\n}\n\nmodule.exports.makeDirSync = (dir, options) => {\n checkPath(dir)\n\n return fs.mkdirSync(dir, {\n mode: getMode(options),\n recursive: true\n })\n}\n", "'use strict'\nconst u = require('universalify').fromPromise\nconst { makeDir: _makeDir, makeDirSync } = require('./make-dir')\nconst makeDir = u(_makeDir)\n\nmodule.exports = {\n mkdirs: makeDir,\n mkdirsSync: makeDirSync,\n // alias\n mkdirp: makeDir,\n mkdirpSync: makeDirSync,\n ensureDir: makeDir,\n ensureDirSync: makeDirSync\n}\n", "'use strict'\nconst u = require('universalify').fromPromise\nconst fs = require('../fs')\n\nfunction pathExists (path) {\n return fs.access(path).then(() => true).catch(() => false)\n}\n\nmodule.exports = {\n pathExists: u(pathExists),\n pathExistsSync: fs.existsSync\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\n\nfunction utimesMillis (path, atime, mtime, callback) {\n // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)\n fs.open(path, 'r+', (err, fd) => {\n if (err) return callback(err)\n fs.futimes(fd, atime, mtime, futimesErr => {\n fs.close(fd, closeErr => {\n if (callback) callback(futimesErr || closeErr)\n })\n })\n })\n}\n\nfunction utimesMillisSync (path, atime, mtime) {\n const fd = fs.openSync(path, 'r+')\n fs.futimesSync(fd, atime, mtime)\n return fs.closeSync(fd)\n}\n\nmodule.exports = {\n utimesMillis,\n utimesMillisSync\n}\n", "'use strict'\n\nconst fs = require('../fs')\nconst path = require('path')\nconst util = require('util')\n\nfunction getStats (src, dest, opts) {\n const statFunc = opts.dereference\n ? (file) => fs.stat(file, { bigint: true })\n : (file) => fs.lstat(file, { bigint: true })\n return Promise.all([\n statFunc(src),\n statFunc(dest).catch(err => {\n if (err.code === 'ENOENT') return null\n throw err\n })\n ]).then(([srcStat, destStat]) => ({ srcStat, destStat }))\n}\n\nfunction getStatsSync (src, dest, opts) {\n let destStat\n const statFunc = opts.dereference\n ? (file) => fs.statSync(file, { bigint: true })\n : (file) => fs.lstatSync(file, { bigint: true })\n const srcStat = statFunc(src)\n try {\n destStat = statFunc(dest)\n } catch (err) {\n if (err.code === 'ENOENT') return { srcStat, destStat: null }\n throw err\n }\n return { srcStat, destStat }\n}\n\nfunction checkPaths (src, dest, funcName, opts, cb) {\n util.callbackify(getStats)(src, dest, opts, (err, stats) => {\n if (err) return cb(err)\n const { srcStat, destStat } = stats\n\n if (destStat) {\n if (areIdentical(srcStat, destStat)) {\n const srcBaseName = path.basename(src)\n const destBaseName = path.basename(dest)\n if (funcName === 'move' &&\n srcBaseName !== destBaseName &&\n srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {\n return cb(null, { srcStat, destStat, isChangingCase: true })\n }\n return cb(new Error('Source and destination must not be the same.'))\n }\n if (srcStat.isDirectory() && !destStat.isDirectory()) {\n return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`))\n }\n if (!srcStat.isDirectory() && destStat.isDirectory()) {\n return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`))\n }\n }\n\n if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return cb(null, { srcStat, destStat })\n })\n}\n\nfunction checkPathsSync (src, dest, funcName, opts) {\n const { srcStat, destStat } = getStatsSync(src, dest, opts)\n\n if (destStat) {\n if (areIdentical(srcStat, destStat)) {\n const srcBaseName = path.basename(src)\n const destBaseName = path.basename(dest)\n if (funcName === 'move' &&\n srcBaseName !== destBaseName &&\n srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {\n return { srcStat, destStat, isChangingCase: true }\n }\n throw new Error('Source and destination must not be the same.')\n }\n if (srcStat.isDirectory() && !destStat.isDirectory()) {\n throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)\n }\n if (!srcStat.isDirectory() && destStat.isDirectory()) {\n throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)\n }\n }\n\n if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n return { srcStat, destStat }\n}\n\n// recursively check if dest parent is a subdirectory of src.\n// It works for all file types including symlinks since it\n// checks the src and dest inodes. It starts from the deepest\n// parent and stops once it reaches the src parent or the root path.\nfunction checkParentPaths (src, srcStat, dest, funcName, cb) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return cb()\n fs.stat(destParent, { bigint: true }, (err, destStat) => {\n if (err) {\n if (err.code === 'ENOENT') return cb()\n return cb(err)\n }\n if (areIdentical(srcStat, destStat)) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return checkParentPaths(src, srcStat, destParent, funcName, cb)\n })\n}\n\nfunction checkParentPathsSync (src, srcStat, dest, funcName) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return\n let destStat\n try {\n destStat = fs.statSync(destParent, { bigint: true })\n } catch (err) {\n if (err.code === 'ENOENT') return\n throw err\n }\n if (areIdentical(srcStat, destStat)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n return checkParentPathsSync(src, srcStat, destParent, funcName)\n}\n\nfunction areIdentical (srcStat, destStat) {\n return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev\n}\n\n// return true if dest is a subdir of src, otherwise false.\n// It only checks the path strings.\nfunction isSrcSubdir (src, dest) {\n const srcArr = path.resolve(src).split(path.sep).filter(i => i)\n const destArr = path.resolve(dest).split(path.sep).filter(i => i)\n return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true)\n}\n\nfunction errMsg (src, dest, funcName) {\n return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`\n}\n\nmodule.exports = {\n checkPaths,\n checkPathsSync,\n checkParentPaths,\n checkParentPathsSync,\n isSrcSubdir,\n areIdentical\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdirs = require('../mkdirs').mkdirs\nconst pathExists = require('../path-exists').pathExists\nconst utimesMillis = require('../util/utimes').utimesMillis\nconst stat = require('../util/stat')\n\nfunction copy (src, dest, opts, cb) {\n if (typeof opts === 'function' && !cb) {\n cb = opts\n opts = {}\n } else if (typeof opts === 'function') {\n opts = { filter: opts }\n }\n\n cb = cb || function () {}\n opts = opts || {}\n\n opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n // Warn about using preserveTimestamps on 32-bit node\n if (opts.preserveTimestamps && process.arch === 'ia32') {\n process.emitWarning(\n 'Using the preserveTimestamps option in 32-bit node is not recommended;\\n\\n' +\n '\\tsee https://github.com/jprichardson/node-fs-extra/issues/269',\n 'Warning', 'fs-extra-WARN0001'\n )\n }\n\n stat.checkPaths(src, dest, 'copy', opts, (err, stats) => {\n if (err) return cb(err)\n const { srcStat, destStat } = stats\n stat.checkParentPaths(src, srcStat, dest, 'copy', err => {\n if (err) return cb(err)\n if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb)\n return checkParentDir(destStat, src, dest, opts, cb)\n })\n })\n}\n\nfunction checkParentDir (destStat, src, dest, opts, cb) {\n const destParent = path.dirname(dest)\n pathExists(destParent, (err, dirExists) => {\n if (err) return cb(err)\n if (dirExists) return getStats(destStat, src, dest, opts, cb)\n mkdirs(destParent, err => {\n if (err) return cb(err)\n return getStats(destStat, src, dest, opts, cb)\n })\n })\n}\n\nfunction handleFilter (onInclude, destStat, src, dest, opts, cb) {\n Promise.resolve(opts.filter(src, dest)).then(include => {\n if (include) return onInclude(destStat, src, dest, opts, cb)\n return cb()\n }, error => cb(error))\n}\n\nfunction startCopy (destStat, src, dest, opts, cb) {\n if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb)\n return getStats(destStat, src, dest, opts, cb)\n}\n\nfunction getStats (destStat, src, dest, opts, cb) {\n const stat = opts.dereference ? fs.stat : fs.lstat\n stat(src, (err, srcStat) => {\n if (err) return cb(err)\n\n if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb)\n else if (srcStat.isFile() ||\n srcStat.isCharacterDevice() ||\n srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb)\n else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb)\n else if (srcStat.isSocket()) return cb(new Error(`Cannot copy a socket file: ${src}`))\n else if (srcStat.isFIFO()) return cb(new Error(`Cannot copy a FIFO pipe: ${src}`))\n return cb(new Error(`Unknown file: ${src}`))\n })\n}\n\nfunction onFile (srcStat, destStat, src, dest, opts, cb) {\n if (!destStat) return copyFile(srcStat, src, dest, opts, cb)\n return mayCopyFile(srcStat, src, dest, opts, cb)\n}\n\nfunction mayCopyFile (srcStat, src, dest, opts, cb) {\n if (opts.overwrite) {\n fs.unlink(dest, err => {\n if (err) return cb(err)\n return copyFile(srcStat, src, dest, opts, cb)\n })\n } else if (opts.errorOnExist) {\n return cb(new Error(`'${dest}' already exists`))\n } else return cb()\n}\n\nfunction copyFile (srcStat, src, dest, opts, cb) {\n fs.copyFile(src, dest, err => {\n if (err) return cb(err)\n if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb)\n return setDestMode(dest, srcStat.mode, cb)\n })\n}\n\nfunction handleTimestampsAndMode (srcMode, src, dest, cb) {\n // Make sure the file is writable before setting the timestamp\n // otherwise open fails with EPERM when invoked with 'r+'\n // (through utimes call)\n if (fileIsNotWritable(srcMode)) {\n return makeFileWritable(dest, srcMode, err => {\n if (err) return cb(err)\n return setDestTimestampsAndMode(srcMode, src, dest, cb)\n })\n }\n return setDestTimestampsAndMode(srcMode, src, dest, cb)\n}\n\nfunction fileIsNotWritable (srcMode) {\n return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode, cb) {\n return setDestMode(dest, srcMode | 0o200, cb)\n}\n\nfunction setDestTimestampsAndMode (srcMode, src, dest, cb) {\n setDestTimestamps(src, dest, err => {\n if (err) return cb(err)\n return setDestMode(dest, srcMode, cb)\n })\n}\n\nfunction setDestMode (dest, srcMode, cb) {\n return fs.chmod(dest, srcMode, cb)\n}\n\nfunction setDestTimestamps (src, dest, cb) {\n // The initial srcStat.atime cannot be trusted\n // because it is modified by the read(2) system call\n // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n fs.stat(src, (err, updatedSrcStat) => {\n if (err) return cb(err)\n return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb)\n })\n}\n\nfunction onDir (srcStat, destStat, src, dest, opts, cb) {\n if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb)\n return copyDir(src, dest, opts, cb)\n}\n\nfunction mkDirAndCopy (srcMode, src, dest, opts, cb) {\n fs.mkdir(dest, err => {\n if (err) return cb(err)\n copyDir(src, dest, opts, err => {\n if (err) return cb(err)\n return setDestMode(dest, srcMode, cb)\n })\n })\n}\n\nfunction copyDir (src, dest, opts, cb) {\n fs.readdir(src, (err, items) => {\n if (err) return cb(err)\n return copyDirItems(items, src, dest, opts, cb)\n })\n}\n\nfunction copyDirItems (items, src, dest, opts, cb) {\n const item = items.pop()\n if (!item) return cb()\n return copyDirItem(items, item, src, dest, opts, cb)\n}\n\nfunction copyDirItem (items, item, src, dest, opts, cb) {\n const srcItem = path.join(src, item)\n const destItem = path.join(dest, item)\n stat.checkPaths(srcItem, destItem, 'copy', opts, (err, stats) => {\n if (err) return cb(err)\n const { destStat } = stats\n startCopy(destStat, srcItem, destItem, opts, err => {\n if (err) return cb(err)\n return copyDirItems(items, src, dest, opts, cb)\n })\n })\n}\n\nfunction onLink (destStat, src, dest, opts, cb) {\n fs.readlink(src, (err, resolvedSrc) => {\n if (err) return cb(err)\n if (opts.dereference) {\n resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n }\n\n if (!destStat) {\n return fs.symlink(resolvedSrc, dest, cb)\n } else {\n fs.readlink(dest, (err, resolvedDest) => {\n if (err) {\n // dest exists and is a regular file or directory,\n // Windows may throw UNKNOWN error. If dest already exists,\n // fs throws error anyway, so no need to guard against it here.\n if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb)\n return cb(err)\n }\n if (opts.dereference) {\n resolvedDest = path.resolve(process.cwd(), resolvedDest)\n }\n if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`))\n }\n\n // do not copy if src is a subdir of dest since unlinking\n // dest in this case would result in removing src contents\n // and therefore a broken symlink would be created.\n if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`))\n }\n return copyLink(resolvedSrc, dest, cb)\n })\n }\n })\n}\n\nfunction copyLink (resolvedSrc, dest, cb) {\n fs.unlink(dest, err => {\n if (err) return cb(err)\n return fs.symlink(resolvedSrc, dest, cb)\n })\n}\n\nmodule.exports = copy\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdirsSync = require('../mkdirs').mkdirsSync\nconst utimesMillisSync = require('../util/utimes').utimesMillisSync\nconst stat = require('../util/stat')\n\nfunction copySync (src, dest, opts) {\n if (typeof opts === 'function') {\n opts = { filter: opts }\n }\n\n opts = opts || {}\n opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n // Warn about using preserveTimestamps on 32-bit node\n if (opts.preserveTimestamps && process.arch === 'ia32') {\n process.emitWarning(\n 'Using the preserveTimestamps option in 32-bit node is not recommended;\\n\\n' +\n '\\tsee https://github.com/jprichardson/node-fs-extra/issues/269',\n 'Warning', 'fs-extra-WARN0002'\n )\n }\n\n const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)\n stat.checkParentPathsSync(src, srcStat, dest, 'copy')\n return handleFilterAndCopy(destStat, src, dest, opts)\n}\n\nfunction handleFilterAndCopy (destStat, src, dest, opts) {\n if (opts.filter && !opts.filter(src, dest)) return\n const destParent = path.dirname(dest)\n if (!fs.existsSync(destParent)) mkdirsSync(destParent)\n return getStats(destStat, src, dest, opts)\n}\n\nfunction startCopy (destStat, src, dest, opts) {\n if (opts.filter && !opts.filter(src, dest)) return\n return getStats(destStat, src, dest, opts)\n}\n\nfunction getStats (destStat, src, dest, opts) {\n const statSync = opts.dereference ? fs.statSync : fs.lstatSync\n const srcStat = statSync(src)\n\n if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)\n else if (srcStat.isFile() ||\n srcStat.isCharacterDevice() ||\n srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)\n else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)\n else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)\n else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)\n throw new Error(`Unknown file: ${src}`)\n}\n\nfunction onFile (srcStat, destStat, src, dest, opts) {\n if (!destStat) return copyFile(srcStat, src, dest, opts)\n return mayCopyFile(srcStat, src, dest, opts)\n}\n\nfunction mayCopyFile (srcStat, src, dest, opts) {\n if (opts.overwrite) {\n fs.unlinkSync(dest)\n return copyFile(srcStat, src, dest, opts)\n } else if (opts.errorOnExist) {\n throw new Error(`'${dest}' already exists`)\n }\n}\n\nfunction copyFile (srcStat, src, dest, opts) {\n fs.copyFileSync(src, dest)\n if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)\n return setDestMode(dest, srcStat.mode)\n}\n\nfunction handleTimestamps (srcMode, src, dest) {\n // Make sure the file is writable before setting the timestamp\n // otherwise open fails with EPERM when invoked with 'r+'\n // (through utimes call)\n if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)\n return setDestTimestamps(src, dest)\n}\n\nfunction fileIsNotWritable (srcMode) {\n return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode) {\n return setDestMode(dest, srcMode | 0o200)\n}\n\nfunction setDestMode (dest, srcMode) {\n return fs.chmodSync(dest, srcMode)\n}\n\nfunction setDestTimestamps (src, dest) {\n // The initial srcStat.atime cannot be trusted\n // because it is modified by the read(2) system call\n // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n const updatedSrcStat = fs.statSync(src)\n return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)\n}\n\nfunction onDir (srcStat, destStat, src, dest, opts) {\n if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)\n return copyDir(src, dest, opts)\n}\n\nfunction mkDirAndCopy (srcMode, src, dest, opts) {\n fs.mkdirSync(dest)\n copyDir(src, dest, opts)\n return setDestMode(dest, srcMode)\n}\n\nfunction copyDir (src, dest, opts) {\n fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts))\n}\n\nfunction copyDirItem (item, src, dest, opts) {\n const srcItem = path.join(src, item)\n const destItem = path.join(dest, item)\n const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts)\n return startCopy(destStat, srcItem, destItem, opts)\n}\n\nfunction onLink (destStat, src, dest, opts) {\n let resolvedSrc = fs.readlinkSync(src)\n if (opts.dereference) {\n resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n }\n\n if (!destStat) {\n return fs.symlinkSync(resolvedSrc, dest)\n } else {\n let resolvedDest\n try {\n resolvedDest = fs.readlinkSync(dest)\n } catch (err) {\n // dest exists and is a regular file or directory,\n // Windows may throw UNKNOWN error. If dest already exists,\n // fs throws error anyway, so no need to guard against it here.\n if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)\n throw err\n }\n if (opts.dereference) {\n resolvedDest = path.resolve(process.cwd(), resolvedDest)\n }\n if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)\n }\n\n // prevent copy if src is a subdir of dest since unlinking\n // dest in this case would result in removing src contents\n // and therefore a broken symlink would be created.\n if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)\n }\n return copyLink(resolvedSrc, dest)\n }\n}\n\nfunction copyLink (resolvedSrc, dest) {\n fs.unlinkSync(dest)\n return fs.symlinkSync(resolvedSrc, dest)\n}\n\nmodule.exports = copySync\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nmodule.exports = {\n copy: u(require('./copy')),\n copySync: require('./copy-sync')\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst assert = require('assert')\n\nconst isWindows = (process.platform === 'win32')\n\nfunction defaults (options) {\n const methods = [\n 'unlink',\n 'chmod',\n 'stat',\n 'lstat',\n 'rmdir',\n 'readdir'\n ]\n methods.forEach(m => {\n options[m] = options[m] || fs[m]\n m = m + 'Sync'\n options[m] = options[m] || fs[m]\n })\n\n options.maxBusyTries = options.maxBusyTries || 3\n}\n\nfunction rimraf (p, options, cb) {\n let busyTries = 0\n\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n assert(p, 'rimraf: missing path')\n assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')\n assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required')\n assert(options, 'rimraf: invalid options argument provided')\n assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')\n\n defaults(options)\n\n rimraf_(p, options, function CB (er) {\n if (er) {\n if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') &&\n busyTries < options.maxBusyTries) {\n busyTries++\n const time = busyTries * 100\n // try again, with the same exact callback as this one.\n return setTimeout(() => rimraf_(p, options, CB), time)\n }\n\n // already gone\n if (er.code === 'ENOENT') er = null\n }\n\n cb(er)\n })\n}\n\n// Two possible strategies.\n// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR\n// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR\n//\n// Both result in an extra syscall when you guess wrong. However, there\n// are likely far more normal files in the world than directories. This\n// is based on the assumption that a the average number of files per\n// directory is >= 1.\n//\n// If anyone ever complains about this, then I guess the strategy could\n// be made configurable somehow. But until then, YAGNI.\nfunction rimraf_ (p, options, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n // sunos lets the root user unlink directories, which is... weird.\n // so we have to lstat here and make sure it's not a dir.\n options.lstat(p, (er, st) => {\n if (er && er.code === 'ENOENT') {\n return cb(null)\n }\n\n // Windows can EPERM on stat. Life is suffering.\n if (er && er.code === 'EPERM' && isWindows) {\n return fixWinEPERM(p, options, er, cb)\n }\n\n if (st && st.isDirectory()) {\n return rmdir(p, options, er, cb)\n }\n\n options.unlink(p, er => {\n if (er) {\n if (er.code === 'ENOENT') {\n return cb(null)\n }\n if (er.code === 'EPERM') {\n return (isWindows)\n ? fixWinEPERM(p, options, er, cb)\n : rmdir(p, options, er, cb)\n }\n if (er.code === 'EISDIR') {\n return rmdir(p, options, er, cb)\n }\n }\n return cb(er)\n })\n })\n}\n\nfunction fixWinEPERM (p, options, er, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n options.chmod(p, 0o666, er2 => {\n if (er2) {\n cb(er2.code === 'ENOENT' ? null : er)\n } else {\n options.stat(p, (er3, stats) => {\n if (er3) {\n cb(er3.code === 'ENOENT' ? null : er)\n } else if (stats.isDirectory()) {\n rmdir(p, options, er, cb)\n } else {\n options.unlink(p, cb)\n }\n })\n }\n })\n}\n\nfunction fixWinEPERMSync (p, options, er) {\n let stats\n\n assert(p)\n assert(options)\n\n try {\n options.chmodSync(p, 0o666)\n } catch (er2) {\n if (er2.code === 'ENOENT') {\n return\n } else {\n throw er\n }\n }\n\n try {\n stats = options.statSync(p)\n } catch (er3) {\n if (er3.code === 'ENOENT') {\n return\n } else {\n throw er\n }\n }\n\n if (stats.isDirectory()) {\n rmdirSync(p, options, er)\n } else {\n options.unlinkSync(p)\n }\n}\n\nfunction rmdir (p, options, originalEr, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)\n // if we guessed wrong, and it's not a directory, then\n // raise the original error.\n options.rmdir(p, er => {\n if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) {\n rmkids(p, options, cb)\n } else if (er && er.code === 'ENOTDIR') {\n cb(originalEr)\n } else {\n cb(er)\n }\n })\n}\n\nfunction rmkids (p, options, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n options.readdir(p, (er, files) => {\n if (er) return cb(er)\n\n let n = files.length\n let errState\n\n if (n === 0) return options.rmdir(p, cb)\n\n files.forEach(f => {\n rimraf(path.join(p, f), options, er => {\n if (errState) {\n return\n }\n if (er) return cb(errState = er)\n if (--n === 0) {\n options.rmdir(p, cb)\n }\n })\n })\n })\n}\n\n// this looks simpler, and is strictly *faster*, but will\n// tie up the JavaScript thread and fail on excessively\n// deep directory trees.\nfunction rimrafSync (p, options) {\n let st\n\n options = options || {}\n defaults(options)\n\n assert(p, 'rimraf: missing path')\n assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')\n assert(options, 'rimraf: missing options')\n assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')\n\n try {\n st = options.lstatSync(p)\n } catch (er) {\n if (er.code === 'ENOENT') {\n return\n }\n\n // Windows can EPERM on stat. Life is suffering.\n if (er.code === 'EPERM' && isWindows) {\n fixWinEPERMSync(p, options, er)\n }\n }\n\n try {\n // sunos lets the root user unlink directories, which is... weird.\n if (st && st.isDirectory()) {\n rmdirSync(p, options, null)\n } else {\n options.unlinkSync(p)\n }\n } catch (er) {\n if (er.code === 'ENOENT') {\n return\n } else if (er.code === 'EPERM') {\n return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)\n } else if (er.code !== 'EISDIR') {\n throw er\n }\n rmdirSync(p, options, er)\n }\n}\n\nfunction rmdirSync (p, options, originalEr) {\n assert(p)\n assert(options)\n\n try {\n options.rmdirSync(p)\n } catch (er) {\n if (er.code === 'ENOTDIR') {\n throw originalEr\n } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') {\n rmkidsSync(p, options)\n } else if (er.code !== 'ENOENT') {\n throw er\n }\n }\n}\n\nfunction rmkidsSync (p, options) {\n assert(p)\n assert(options)\n options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options))\n\n if (isWindows) {\n // We only end up here once we got ENOTEMPTY at least once, and\n // at this point, we are guaranteed to have removed all the kids.\n // So, we know that it won't be ENOENT or ENOTDIR or anything else.\n // try really hard to delete stuff on windows, because it has a\n // PROFOUNDLY annoying habit of not closing handles promptly when\n // files are deleted, resulting in spurious ENOTEMPTY errors.\n const startTime = Date.now()\n do {\n try {\n const ret = options.rmdirSync(p, options)\n return ret\n } catch {}\n } while (Date.now() - startTime < 500) // give up after 500ms\n } else {\n const ret = options.rmdirSync(p, options)\n return ret\n }\n}\n\nmodule.exports = rimraf\nrimraf.sync = rimrafSync\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst u = require('universalify').fromCallback\nconst rimraf = require('./rimraf')\n\nfunction remove (path, callback) {\n // Node 14.14.0+\n if (fs.rm) return fs.rm(path, { recursive: true, force: true }, callback)\n rimraf(path, callback)\n}\n\nfunction removeSync (path) {\n // Node 14.14.0+\n if (fs.rmSync) return fs.rmSync(path, { recursive: true, force: true })\n rimraf.sync(path)\n}\n\nmodule.exports = {\n remove: u(remove),\n removeSync\n}\n", "'use strict'\n\nconst u = require('universalify').fromPromise\nconst fs = require('../fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst remove = require('../remove')\n\nconst emptyDir = u(async function emptyDir (dir) {\n let items\n try {\n items = await fs.readdir(dir)\n } catch {\n return mkdir.mkdirs(dir)\n }\n\n return Promise.all(items.map(item => remove.remove(path.join(dir, item))))\n})\n\nfunction emptyDirSync (dir) {\n let items\n try {\n items = fs.readdirSync(dir)\n } catch {\n return mkdir.mkdirsSync(dir)\n }\n\n items.forEach(item => {\n item = path.join(dir, item)\n remove.removeSync(item)\n })\n}\n\nmodule.exports = {\n emptyDirSync,\n emptydirSync: emptyDirSync,\n emptyDir,\n emptydir: emptyDir\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst mkdir = require('../mkdirs')\n\nfunction createFile (file, callback) {\n function makeFile () {\n fs.writeFile(file, '', err => {\n if (err) return callback(err)\n callback()\n })\n }\n\n fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err\n if (!err && stats.isFile()) return callback()\n const dir = path.dirname(file)\n fs.stat(dir, (err, stats) => {\n if (err) {\n // if the directory doesn't exist, make it\n if (err.code === 'ENOENT') {\n return mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n makeFile()\n })\n }\n return callback(err)\n }\n\n if (stats.isDirectory()) makeFile()\n else {\n // parent is not a directory\n // This is just to cause an internal ENOTDIR error to be thrown\n fs.readdir(dir, err => {\n if (err) return callback(err)\n })\n }\n })\n })\n}\n\nfunction createFileSync (file) {\n let stats\n try {\n stats = fs.statSync(file)\n } catch {}\n if (stats && stats.isFile()) return\n\n const dir = path.dirname(file)\n try {\n if (!fs.statSync(dir).isDirectory()) {\n // parent is not a directory\n // This is just to cause an internal ENOTDIR error to be thrown\n fs.readdirSync(dir)\n }\n } catch (err) {\n // If the stat call above failed because the directory doesn't exist, create it\n if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir)\n else throw err\n }\n\n fs.writeFileSync(file, '')\n}\n\nmodule.exports = {\n createFile: u(createFile),\n createFileSync\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst mkdir = require('../mkdirs')\nconst pathExists = require('../path-exists').pathExists\nconst { areIdentical } = require('../util/stat')\n\nfunction createLink (srcpath, dstpath, callback) {\n function makeLink (srcpath, dstpath) {\n fs.link(srcpath, dstpath, err => {\n if (err) return callback(err)\n callback(null)\n })\n }\n\n fs.lstat(dstpath, (_, dstStat) => {\n fs.lstat(srcpath, (err, srcStat) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureLink')\n return callback(err)\n }\n if (dstStat && areIdentical(srcStat, dstStat)) return callback(null)\n\n const dir = path.dirname(dstpath)\n pathExists(dir, (err, dirExists) => {\n if (err) return callback(err)\n if (dirExists) return makeLink(srcpath, dstpath)\n mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n makeLink(srcpath, dstpath)\n })\n })\n })\n })\n}\n\nfunction createLinkSync (srcpath, dstpath) {\n let dstStat\n try {\n dstStat = fs.lstatSync(dstpath)\n } catch {}\n\n try {\n const srcStat = fs.lstatSync(srcpath)\n if (dstStat && areIdentical(srcStat, dstStat)) return\n } catch (err) {\n err.message = err.message.replace('lstat', 'ensureLink')\n throw err\n }\n\n const dir = path.dirname(dstpath)\n const dirExists = fs.existsSync(dir)\n if (dirExists) return fs.linkSync(srcpath, dstpath)\n mkdir.mkdirsSync(dir)\n\n return fs.linkSync(srcpath, dstpath)\n}\n\nmodule.exports = {\n createLink: u(createLink),\n createLinkSync\n}\n", "'use strict'\n\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst pathExists = require('../path-exists').pathExists\n\n/**\n * Function that returns two types of paths, one relative to symlink, and one\n * relative to the current working directory. Checks if path is absolute or\n * relative. If the path is relative, this function checks if the path is\n * relative to symlink or relative to current working directory. This is an\n * initiative to find a smarter `srcpath` to supply when building symlinks.\n * This allows you to determine which path to use out of one of three possible\n * types of source paths. The first is an absolute path. This is detected by\n * `path.isAbsolute()`. When an absolute path is provided, it is checked to\n * see if it exists. If it does it's used, if not an error is returned\n * (callback)/ thrown (sync). The other two options for `srcpath` are a\n * relative url. By default Node's `fs.symlink` works by creating a symlink\n * using `dstpath` and expects the `srcpath` to be relative to the newly\n * created symlink. If you provide a `srcpath` that does not exist on the file\n * system it results in a broken symlink. To minimize this, the function\n * checks to see if the 'relative to symlink' source file exists, and if it\n * does it will use it. If it does not, it checks if there's a file that\n * exists that is relative to the current working directory, if does its used.\n * This preserves the expectations of the original fs.symlink spec and adds\n * the ability to pass in `relative to current working direcotry` paths.\n */\n\nfunction symlinkPaths (srcpath, dstpath, callback) {\n if (path.isAbsolute(srcpath)) {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: srcpath\n })\n })\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n return pathExists(relativeToDst, (err, exists) => {\n if (err) return callback(err)\n if (exists) {\n return callback(null, {\n toCwd: relativeToDst,\n toDst: srcpath\n })\n } else {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n })\n })\n }\n })\n }\n}\n\nfunction symlinkPathsSync (srcpath, dstpath) {\n let exists\n if (path.isAbsolute(srcpath)) {\n exists = fs.existsSync(srcpath)\n if (!exists) throw new Error('absolute srcpath does not exist')\n return {\n toCwd: srcpath,\n toDst: srcpath\n }\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n exists = fs.existsSync(relativeToDst)\n if (exists) {\n return {\n toCwd: relativeToDst,\n toDst: srcpath\n }\n } else {\n exists = fs.existsSync(srcpath)\n if (!exists) throw new Error('relative srcpath does not exist')\n return {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n }\n }\n }\n}\n\nmodule.exports = {\n symlinkPaths,\n symlinkPathsSync\n}\n", "'use strict'\n\nconst fs = require('graceful-fs')\n\nfunction symlinkType (srcpath, type, callback) {\n callback = (typeof type === 'function') ? type : callback\n type = (typeof type === 'function') ? false : type\n if (type) return callback(null, type)\n fs.lstat(srcpath, (err, stats) => {\n if (err) return callback(null, 'file')\n type = (stats && stats.isDirectory()) ? 'dir' : 'file'\n callback(null, type)\n })\n}\n\nfunction symlinkTypeSync (srcpath, type) {\n let stats\n\n if (type) return type\n try {\n stats = fs.lstatSync(srcpath)\n } catch {\n return 'file'\n }\n return (stats && stats.isDirectory()) ? 'dir' : 'file'\n}\n\nmodule.exports = {\n symlinkType,\n symlinkTypeSync\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('../fs')\nconst _mkdirs = require('../mkdirs')\nconst mkdirs = _mkdirs.mkdirs\nconst mkdirsSync = _mkdirs.mkdirsSync\n\nconst _symlinkPaths = require('./symlink-paths')\nconst symlinkPaths = _symlinkPaths.symlinkPaths\nconst symlinkPathsSync = _symlinkPaths.symlinkPathsSync\n\nconst _symlinkType = require('./symlink-type')\nconst symlinkType = _symlinkType.symlinkType\nconst symlinkTypeSync = _symlinkType.symlinkTypeSync\n\nconst pathExists = require('../path-exists').pathExists\n\nconst { areIdentical } = require('../util/stat')\n\nfunction createSymlink (srcpath, dstpath, type, callback) {\n callback = (typeof type === 'function') ? type : callback\n type = (typeof type === 'function') ? false : type\n\n fs.lstat(dstpath, (err, stats) => {\n if (!err && stats.isSymbolicLink()) {\n Promise.all([\n fs.stat(srcpath),\n fs.stat(dstpath)\n ]).then(([srcStat, dstStat]) => {\n if (areIdentical(srcStat, dstStat)) return callback(null)\n _createSymlink(srcpath, dstpath, type, callback)\n })\n } else _createSymlink(srcpath, dstpath, type, callback)\n })\n}\n\nfunction _createSymlink (srcpath, dstpath, type, callback) {\n symlinkPaths(srcpath, dstpath, (err, relative) => {\n if (err) return callback(err)\n srcpath = relative.toDst\n symlinkType(relative.toCwd, type, (err, type) => {\n if (err) return callback(err)\n const dir = path.dirname(dstpath)\n pathExists(dir, (err, dirExists) => {\n if (err) return callback(err)\n if (dirExists) return fs.symlink(srcpath, dstpath, type, callback)\n mkdirs(dir, err => {\n if (err) return callback(err)\n fs.symlink(srcpath, dstpath, type, callback)\n })\n })\n })\n })\n}\n\nfunction createSymlinkSync (srcpath, dstpath, type) {\n let stats\n try {\n stats = fs.lstatSync(dstpath)\n } catch {}\n if (stats && stats.isSymbolicLink()) {\n const srcStat = fs.statSync(srcpath)\n const dstStat = fs.statSync(dstpath)\n if (areIdentical(srcStat, dstStat)) return\n }\n\n const relative = symlinkPathsSync(srcpath, dstpath)\n srcpath = relative.toDst\n type = symlinkTypeSync(relative.toCwd, type)\n const dir = path.dirname(dstpath)\n const exists = fs.existsSync(dir)\n if (exists) return fs.symlinkSync(srcpath, dstpath, type)\n mkdirsSync(dir)\n return fs.symlinkSync(srcpath, dstpath, type)\n}\n\nmodule.exports = {\n createSymlink: u(createSymlink),\n createSymlinkSync\n}\n", "'use strict'\n\nconst { createFile, createFileSync } = require('./file')\nconst { createLink, createLinkSync } = require('./link')\nconst { createSymlink, createSymlinkSync } = require('./symlink')\n\nmodule.exports = {\n // file\n createFile,\n createFileSync,\n ensureFile: createFile,\n ensureFileSync: createFileSync,\n // link\n createLink,\n createLinkSync,\n ensureLink: createLink,\n ensureLinkSync: createLinkSync,\n // symlink\n createSymlink,\n createSymlinkSync,\n ensureSymlink: createSymlink,\n ensureSymlinkSync: createSymlinkSync\n}\n", "function stringify (obj, { EOL = '\\n', finalEOL = true, replacer = null, spaces } = {}) {\n const EOF = finalEOL ? EOL : ''\n const str = JSON.stringify(obj, replacer, spaces)\n\n return str.replace(/\\n/g, EOL) + EOF\n}\n\nfunction stripBom (content) {\n // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified\n if (Buffer.isBuffer(content)) content = content.toString('utf8')\n return content.replace(/^\\uFEFF/, '')\n}\n\nmodule.exports = { stringify, stripBom }\n", "let _fs\ntry {\n _fs = require('graceful-fs')\n} catch (_) {\n _fs = require('fs')\n}\nconst universalify = require('universalify')\nconst { stringify, stripBom } = require('./utils')\n\nasync function _readFile (file, options = {}) {\n if (typeof options === 'string') {\n options = { encoding: options }\n }\n\n const fs = options.fs || _fs\n\n const shouldThrow = 'throws' in options ? options.throws : true\n\n let data = await universalify.fromCallback(fs.readFile)(file, options)\n\n data = stripBom(data)\n\n let obj\n try {\n obj = JSON.parse(data, options ? options.reviver : null)\n } catch (err) {\n if (shouldThrow) {\n err.message = `${file}: ${err.message}`\n throw err\n } else {\n return null\n }\n }\n\n return obj\n}\n\nconst readFile = universalify.fromPromise(_readFile)\n\nfunction readFileSync (file, options = {}) {\n if (typeof options === 'string') {\n options = { encoding: options }\n }\n\n const fs = options.fs || _fs\n\n const shouldThrow = 'throws' in options ? options.throws : true\n\n try {\n let content = fs.readFileSync(file, options)\n content = stripBom(content)\n return JSON.parse(content, options.reviver)\n } catch (err) {\n if (shouldThrow) {\n err.message = `${file}: ${err.message}`\n throw err\n } else {\n return null\n }\n }\n}\n\nasync function _writeFile (file, obj, options = {}) {\n const fs = options.fs || _fs\n\n const str = stringify(obj, options)\n\n await universalify.fromCallback(fs.writeFile)(file, str, options)\n}\n\nconst writeFile = universalify.fromPromise(_writeFile)\n\nfunction writeFileSync (file, obj, options = {}) {\n const fs = options.fs || _fs\n\n const str = stringify(obj, options)\n // not sure if fs.writeFileSync returns anything, but just in case\n return fs.writeFileSync(file, str, options)\n}\n\nconst jsonfile = {\n readFile,\n readFileSync,\n writeFile,\n writeFileSync\n}\n\nmodule.exports = jsonfile\n", "'use strict'\n\nconst jsonFile = require('jsonfile')\n\nmodule.exports = {\n // jsonfile exports\n readJson: jsonFile.readFile,\n readJsonSync: jsonFile.readFileSync,\n writeJson: jsonFile.writeFile,\n writeJsonSync: jsonFile.writeFileSync\n}\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst pathExists = require('../path-exists').pathExists\n\nfunction outputFile (file, data, encoding, callback) {\n if (typeof encoding === 'function') {\n callback = encoding\n encoding = 'utf8'\n }\n\n const dir = path.dirname(file)\n pathExists(dir, (err, itDoes) => {\n if (err) return callback(err)\n if (itDoes) return fs.writeFile(file, data, encoding, callback)\n\n mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n\n fs.writeFile(file, data, encoding, callback)\n })\n })\n}\n\nfunction outputFileSync (file, ...args) {\n const dir = path.dirname(file)\n if (fs.existsSync(dir)) {\n return fs.writeFileSync(file, ...args)\n }\n mkdir.mkdirsSync(dir)\n fs.writeFileSync(file, ...args)\n}\n\nmodule.exports = {\n outputFile: u(outputFile),\n outputFileSync\n}\n", "'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFile } = require('../output-file')\n\nasync function outputJson (file, data, options = {}) {\n const str = stringify(data, options)\n\n await outputFile(file, str, options)\n}\n\nmodule.exports = outputJson\n", "'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFileSync } = require('../output-file')\n\nfunction outputJsonSync (file, data, options) {\n const str = stringify(data, options)\n\n outputFileSync(file, str, options)\n}\n\nmodule.exports = outputJsonSync\n", "'use strict'\n\nconst u = require('universalify').fromPromise\nconst jsonFile = require('./jsonfile')\n\njsonFile.outputJson = u(require('./output-json'))\njsonFile.outputJsonSync = require('./output-json-sync')\n// aliases\njsonFile.outputJSON = jsonFile.outputJson\njsonFile.outputJSONSync = jsonFile.outputJsonSync\njsonFile.writeJSON = jsonFile.writeJson\njsonFile.writeJSONSync = jsonFile.writeJsonSync\njsonFile.readJSON = jsonFile.readJson\njsonFile.readJSONSync = jsonFile.readJsonSync\n\nmodule.exports = jsonFile\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst copy = require('../copy').copy\nconst remove = require('../remove').remove\nconst mkdirp = require('../mkdirs').mkdirp\nconst pathExists = require('../path-exists').pathExists\nconst stat = require('../util/stat')\n\nfunction move (src, dest, opts, cb) {\n if (typeof opts === 'function') {\n cb = opts\n opts = {}\n }\n\n opts = opts || {}\n\n const overwrite = opts.overwrite || opts.clobber || false\n\n stat.checkPaths(src, dest, 'move', opts, (err, stats) => {\n if (err) return cb(err)\n const { srcStat, isChangingCase = false } = stats\n stat.checkParentPaths(src, srcStat, dest, 'move', err => {\n if (err) return cb(err)\n if (isParentRoot(dest)) return doRename(src, dest, overwrite, isChangingCase, cb)\n mkdirp(path.dirname(dest), err => {\n if (err) return cb(err)\n return doRename(src, dest, overwrite, isChangingCase, cb)\n })\n })\n })\n}\n\nfunction isParentRoot (dest) {\n const parent = path.dirname(dest)\n const parsedPath = path.parse(parent)\n return parsedPath.root === parent\n}\n\nfunction doRename (src, dest, overwrite, isChangingCase, cb) {\n if (isChangingCase) return rename(src, dest, overwrite, cb)\n if (overwrite) {\n return remove(dest, err => {\n if (err) return cb(err)\n return rename(src, dest, overwrite, cb)\n })\n }\n pathExists(dest, (err, destExists) => {\n if (err) return cb(err)\n if (destExists) return cb(new Error('dest already exists.'))\n return rename(src, dest, overwrite, cb)\n })\n}\n\nfunction rename (src, dest, overwrite, cb) {\n fs.rename(src, dest, err => {\n if (!err) return cb()\n if (err.code !== 'EXDEV') return cb(err)\n return moveAcrossDevice(src, dest, overwrite, cb)\n })\n}\n\nfunction moveAcrossDevice (src, dest, overwrite, cb) {\n const opts = {\n overwrite,\n errorOnExist: true\n }\n copy(src, dest, opts, err => {\n if (err) return cb(err)\n return remove(src, cb)\n })\n}\n\nmodule.exports = move\n", "'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst copySync = require('../copy').copySync\nconst removeSync = require('../remove').removeSync\nconst mkdirpSync = require('../mkdirs').mkdirpSync\nconst stat = require('../util/stat')\n\nfunction moveSync (src, dest, opts) {\n opts = opts || {}\n const overwrite = opts.overwrite || opts.clobber || false\n\n const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, 'move', opts)\n stat.checkParentPathsSync(src, srcStat, dest, 'move')\n if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest))\n return doRename(src, dest, overwrite, isChangingCase)\n}\n\nfunction isParentRoot (dest) {\n const parent = path.dirname(dest)\n const parsedPath = path.parse(parent)\n return parsedPath.root === parent\n}\n\nfunction doRename (src, dest, overwrite, isChangingCase) {\n if (isChangingCase) return rename(src, dest, overwrite)\n if (overwrite) {\n removeSync(dest)\n return rename(src, dest, overwrite)\n }\n if (fs.existsSync(dest)) throw new Error('dest already exists.')\n return rename(src, dest, overwrite)\n}\n\nfunction rename (src, dest, overwrite) {\n try {\n fs.renameSync(src, dest)\n } catch (err) {\n if (err.code !== 'EXDEV') throw err\n return moveAcrossDevice(src, dest, overwrite)\n }\n}\n\nfunction moveAcrossDevice (src, dest, overwrite) {\n const opts = {\n overwrite,\n errorOnExist: true\n }\n copySync(src, dest, opts)\n return removeSync(src)\n}\n\nmodule.exports = moveSync\n", "'use strict'\n\nconst u = require('universalify').fromCallback\nmodule.exports = {\n move: u(require('./move')),\n moveSync: require('./move-sync')\n}\n", "'use strict'\n\nmodule.exports = {\n // Export promiseified graceful-fs:\n ...require('./fs'),\n // Export extra methods:\n ...require('./copy'),\n ...require('./empty'),\n ...require('./ensure'),\n ...require('./json'),\n ...require('./mkdirs'),\n ...require('./move'),\n ...require('./output-file'),\n ...require('./path-exists'),\n ...require('./remove')\n}\n", "const flagSymbol = Symbol('arg flag');\n\nclass ArgError extends Error {\n\tconstructor(msg, code) {\n\t\tsuper(msg);\n\t\tthis.name = 'ArgError';\n\t\tthis.code = code;\n\n\t\tObject.setPrototypeOf(this, ArgError.prototype);\n\t}\n}\n\nfunction arg(\n\topts,\n\t{\n\t\targv = process.argv.slice(2),\n\t\tpermissive = false,\n\t\tstopAtPositional = false\n\t} = {}\n) {\n\tif (!opts) {\n\t\tthrow new ArgError(\n\t\t\t'argument specification object is required',\n\t\t\t'ARG_CONFIG_NO_SPEC'\n\t\t);\n\t}\n\n\tconst result = { _: [] };\n\n\tconst aliases = {};\n\tconst handlers = {};\n\n\tfor (const key of Object.keys(opts)) {\n\t\tif (!key) {\n\t\t\tthrow new ArgError(\n\t\t\t\t'argument key cannot be an empty string',\n\t\t\t\t'ARG_CONFIG_EMPTY_KEY'\n\t\t\t);\n\t\t}\n\n\t\tif (key[0] !== '-') {\n\t\t\tthrow new ArgError(\n\t\t\t\t`argument key must start with '-' but found: '${key}'`,\n\t\t\t\t'ARG_CONFIG_NONOPT_KEY'\n\t\t\t);\n\t\t}\n\n\t\tif (key.length === 1) {\n\t\t\tthrow new ArgError(\n\t\t\t\t`argument key must have a name; singular '-' keys are not allowed: ${key}`,\n\t\t\t\t'ARG_CONFIG_NONAME_KEY'\n\t\t\t);\n\t\t}\n\n\t\tif (typeof opts[key] === 'string') {\n\t\t\taliases[key] = opts[key];\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet type = opts[key];\n\t\tlet isFlag = false;\n\n\t\tif (\n\t\t\tArray.isArray(type) &&\n\t\t\ttype.length === 1 &&\n\t\t\ttypeof type[0] === 'function'\n\t\t) {\n\t\t\tconst [fn] = type;\n\t\t\ttype = (value, name, prev = []) => {\n\t\t\t\tprev.push(fn(value, name, prev[prev.length - 1]));\n\t\t\t\treturn prev;\n\t\t\t};\n\t\t\tisFlag = fn === Boolean || fn[flagSymbol] === true;\n\t\t} else if (typeof type === 'function') {\n\t\t\tisFlag = type === Boolean || type[flagSymbol] === true;\n\t\t} else {\n\t\t\tthrow new ArgError(\n\t\t\t\t`type missing or not a function or valid array type: ${key}`,\n\t\t\t\t'ARG_CONFIG_VAD_TYPE'\n\t\t\t);\n\t\t}\n\n\t\tif (key[1] !== '-' && key.length > 2) {\n\t\t\tthrow new ArgError(\n\t\t\t\t`short argument keys (with a single hyphen) must have only one character: ${key}`,\n\t\t\t\t'ARG_CONFIG_SHORTOPT_TOOLONG'\n\t\t\t);\n\t\t}\n\n\t\thandlers[key] = [type, isFlag];\n\t}\n\n\tfor (let i = 0, len = argv.length; i < len; i++) {\n\t\tconst wholeArg = argv[i];\n\n\t\tif (stopAtPositional && result._.length > 0) {\n\t\t\tresult._ = result._.concat(argv.slice(i));\n\t\t\tbreak;\n\t\t}\n\n\t\tif (wholeArg === '--') {\n\t\t\tresult._ = result._.concat(argv.slice(i + 1));\n\t\t\tbreak;\n\t\t}\n\n\t\tif (wholeArg.length > 1 && wholeArg[0] === '-') {\n\t\t\t/* eslint-disable operator-linebreak */\n\t\t\tconst separatedArguments =\n\t\t\t\twholeArg[1] === '-' || wholeArg.length === 2\n\t\t\t\t\t? [wholeArg]\n\t\t\t\t\t: wholeArg\n\t\t\t\t\t\t\t.slice(1)\n\t\t\t\t\t\t\t.split('')\n\t\t\t\t\t\t\t.map((a) => `-${a}`);\n\t\t\t/* eslint-enable operator-linebreak */\n\n\t\t\tfor (let j = 0; j < separatedArguments.length; j++) {\n\t\t\t\tconst arg = separatedArguments[j];\n\t\t\t\tconst [originalArgName, argStr] =\n\t\t\t\t\targ[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined];\n\n\t\t\t\tlet argName = originalArgName;\n\t\t\t\twhile (argName in aliases) {\n\t\t\t\t\targName = aliases[argName];\n\t\t\t\t}\n\n\t\t\t\tif (!(argName in handlers)) {\n\t\t\t\t\tif (permissive) {\n\t\t\t\t\t\tresult._.push(arg);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new ArgError(\n\t\t\t\t\t\t\t`unknown or unexpected option: ${originalArgName}`,\n\t\t\t\t\t\t\t'ARG_UNKNOWN_OPTION'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst [type, isFlag] = handlers[argName];\n\n\t\t\t\tif (!isFlag && j + 1 < separatedArguments.length) {\n\t\t\t\t\tthrow new ArgError(\n\t\t\t\t\t\t`option requires argument (but was followed by another short argument): ${originalArgName}`,\n\t\t\t\t\t\t'ARG_MISSING_REQUIRED_SHORTARG'\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (isFlag) {\n\t\t\t\t\tresult[argName] = type(true, argName, result[argName]);\n\t\t\t\t} else if (argStr === undefined) {\n\t\t\t\t\tif (\n\t\t\t\t\t\targv.length < i + 2 ||\n\t\t\t\t\t\t(argv[i + 1].length > 1 &&\n\t\t\t\t\t\t\targv[i + 1][0] === '-' &&\n\t\t\t\t\t\t\t!(\n\t\t\t\t\t\t\t\targv[i + 1].match(/^-?\\d*(\\.(?=\\d))?\\d*$/) &&\n\t\t\t\t\t\t\t\t(type === Number ||\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line no-undef\n\t\t\t\t\t\t\t\t\t(typeof BigInt !== 'undefined' && type === BigInt))\n\t\t\t\t\t\t\t))\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst extended =\n\t\t\t\t\t\t\toriginalArgName === argName ? '' : ` (alias for ${argName})`;\n\t\t\t\t\t\tthrow new ArgError(\n\t\t\t\t\t\t\t`option requires argument: ${originalArgName}${extended}`,\n\t\t\t\t\t\t\t'ARG_MISSING_REQUIRED_LONGARG'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tresult[argName] = type(argv[i + 1], argName, result[argName]);\n\t\t\t\t\t++i;\n\t\t\t\t} else {\n\t\t\t\t\tresult[argName] = type(argStr, argName, result[argName]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tresult._.push(wholeArg);\n\t\t}\n\t}\n\n\treturn result;\n}\n\narg.flag = (fn) => {\n\tfn[flagSymbol] = true;\n\treturn fn;\n};\n\n// Utility types\narg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1);\n\n// Expose error class\narg.ArgError = ArgError;\n\nmodule.exports = arg;\n", "#!/usr/bin/env node\r\nimport { Command } from 'commander';\r\nimport baseAction from './commands/base';\r\nconst program = new Command();\r\nprogram.action(baseAction);\r\nprogram.parse(process.argv);\r\n", "/* \u754C\u9762\u547D\u4EE4\u6CE8\u518C\u5728\u8FD9\u91CC */\r\nimport { ItemType } from './get-file'\r\nimport prompts from 'prompts'\r\nimport { wirteMd, getMd } from './wirte-md'\r\nimport { renameFoldPath, renameFilePath } from './rename-path'\r\nimport stringToArgs from '../../script/cli'\r\nimport handle from '../../script/cli/handle'\r\nimport logger from '../shared/logger'\r\nimport { changePath, wirteJsNodes } from './change-path'\r\nimport { markFile, deletMarkAll, witeMarkFile } from './mark-file'\r\nimport { getRouterArrs } from './get-router'\r\nimport path from 'path'\r\nimport { VERSION, PKG_NAME } from '../shared/constant'\r\nimport fs from 'fs'\r\n\r\n// \u4E3A\u4EC0\u4E48\u8981\u52A0process.cwd()\u7684replace \u662F\u4E3A\u4E86\u62B9\u5E73window\u548Clinux\u751F\u6210\u7684\u8DEF\u5F84\u4E0D\u4E00\u6837\u7684\u95EE\u9898\r\nlet rootPath = process.cwd().replace(/\\\\/g, '/')\r\nconst options = stringToArgs(process.argv)\r\nconst { ignores: ignore, includes: include } = handle(options)\r\n\r\n/**\r\n * @desc: //2. \u5F97\u5230md\u6587\u6863,------------>\u4F1A\u5199(\u53EA\u751F\u6210\u4E00\u4E2Amd)\r\n * @author: majun\r\n * @param {string} md\r\n */\r\nfunction getMdAction(md: string) {\r\n console.log('\\x1B[36m%s\\x1B[0m', '*** location: ', `${rootPath}/readme-md.md`)\r\n wirteMd(md, `${rootPath}/readme-md.md`)\r\n}\r\n\r\n/**\r\n * @desc: \u8FD9\u91CC\u505A\u4E00\u4E2A\u524D\u7F6E\u5224\u65AD, \u5982\u679C\u7236\u8DEF\u5F84\u4E0D\u662Fsrc, \u62A5\u9519, \u56E0\u4E3A\u6709changepath@\u7B26\u53F7\u662F\u6307\u5411src\u7684\r\n * @author: majun\r\n */\r\nfunction checkFold() {\r\n const foldPath = path.resolve('./').replace(/\\\\/g, '/')\r\n const foldArrs = foldPath.split('/')\r\n const foldName = foldArrs.pop()\r\n if (foldName !== 'src') {\r\n logger.error('changePath\u9700\u8981\u5728src\u76EE\u5F55\u4E0B\u8FD0\u884C\u547D\u4EE4! ')\r\n process.exit(1)\r\n }\r\n}\r\n\r\n/**\r\n * @desc: //3. \u66F4\u6539\u6240\u6709\u4E3A\u7EDD\u5BF9\u8DEF\u5F84+ \u540E\u7F00\u8865\u5168------------>\u4F1A\u5199(\u4F1A\u64CD\u4F5C\u4EE3\u7801)\r\n * @author: majun\r\n * @param {Array} nodes\r\n */\r\nasync function changePathAction(nodes: ItemType[]) {\r\n checkFold()\r\n await changePath(nodes)\r\n}\r\n\r\n/**\r\n * @desc: //4. \u6253\u6807\u8BB0 ------------> \u4F1A\u5199(\u4F1A\u64CD\u4F5C\u4EE3\u7801) //5. \u5206\u6587\u4EF6 ------------> \u4F1A\u5199(\u4F1A\u53E6\u5916\u751F\u6210\u5305\u6587\u4EF6)\r\n * @author: majun\r\n * @param {Array} nodes\r\n */\r\nasync function markFileAction(nodes: ItemType[]) {\r\n // checkFold()\r\n const routers = getRouterArrs()\r\n fs.writeFileSync(rootPath + '/router-file.js','const router='+ JSON.stringify(routers), { encoding: 'utf8' })\r\n if (routers) {\r\n await markFile(nodes, routers)\r\n wirteJsNodes(JSON.stringify(nodes), rootPath + '/readme-file.js')\r\n }\r\n}\r\n\r\n/**\r\n * @desc: 5,\u5C06\u6253\u6807\u8BB0\u7684\u8FDB\u884Ccopy\r\n * @author: majun\r\n * @param {Array} nodes\r\n */\r\nasync function witeFileAction(nodes: ItemType[]) {\r\n const routers = getRouterArrs()\r\n if (routers) {\r\n await markFile(nodes, routers)\r\n // copy\u6587\u4EF6\u4E00\u5B9A\u662F\u5EFA\u7ACB\u5728\u6253\u6807\u8BB0\u7684\u57FA\u7840\u4E0A\r\n await witeMarkFile(nodes, routers)\r\n }\r\n}\r\n/**\r\n * @desc://6. \u5F97\u5230md\u5BF9\u8C61(\u53EA\u751F\u6210\u4E00\u4E2Amd)\r\n * @author: majun\r\n * @param {Array} nodes\r\n */\r\nasync function wirteJsNodesAction(nodes: ItemType[]) {\r\n // \u8981\u5148\u6539\u8DEF\u5F84\u540E\u7F00,\u5426\u5219\u4F9D\u8D56\u6536\u96C6\u4E0D\u5230\r\n await changePathAction(nodes)\r\n wirteJsNodes(JSON.stringify(nodes), rootPath + '/readme-file.js')\r\n}\r\n\r\n/**\r\n * @desc://7. \u5220\u9664\u6807\u8BB0\r\n * @author: majun\r\n * @param {Array} nodes\r\n */\r\nasync function deletMarkAction(nodes: ItemType[]) {\r\n deletMarkAll(nodes, 'base')\r\n}\r\n\r\n/**\r\n * @desc://8. \u89C4\u8303\u547D\u540D\u6587\u4EF6\u5939kabel-case\r\n * @author: majun\r\n * @param {Array} nodes\r\n */\r\nasync function renameFoldAction(nodes: ItemType[]) {\r\n renameFoldPath(nodes)\r\n}\r\n\r\n/**\r\n * @desc://9. \u89C4\u8303\u547D\u540D\u6587\u4EF6kabel-case\r\n * @author: majun\r\n * @param {Array} nodes\r\n */\r\nasync function renameFileAction(nodes: ItemType[]) {\r\n renameFilePath(nodes)\r\n}\r\n\r\n/**\r\n * @desc: \u6267\u884C\u6240\u6709\u64CD\u4F5C\r\n * @author: majun\r\n * @param {Array} nodes\r\n * @param {string} md\r\n */\r\nexport async function generateAllAction(nodes: ItemType[], md: string) {\r\n checkFold()\r\n const routers = getRouterArrs()\r\n if (routers) {\r\n getMdAction(md)\r\n await changePathAction(nodes)\r\n await markFileAction(nodes)\r\n // copy\u6587\u4EF6\u4E00\u5B9A\u662F\u5EFA\u7ACB\u5728\u6253\u6807\u8BB0\u7684\u57FA\u7840\u4E0A\r\n await witeMarkFile(nodes, routers)\r\n wirteJsNodes(JSON.stringify(nodes), rootPath + '/readme-file.js')\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u6240\u6709\u547D\u540D\u90FD\u5728\u8FD9\u91CC\u6CE8\u518C,\u5E76\u8C03\u7528\u6267\u884C\r\n * @author: majun\r\n */\r\nfunction getActions() {\r\n const actionMap = new Map<string, prompts.Choice & { action: Function }>()\r\n //1. \u8FD9\u91CC\u53EA\u8BFB\u6587\u4EF6, ------------>\u4E0D\u5199\r\n const { md, nodes } = getMd({ ignore, include })\r\n actionMap.set('Generate All', {\r\n title: 'Generate All',\r\n value: 'Generate All',\r\n selected: true,\r\n action: () => generateAllAction(nodes, md)\r\n })\r\n actionMap.set('Generate MD', {\r\n title: 'Generate MD',\r\n value: 'Generate MD',\r\n selected: true,\r\n action: () => getMdAction(md)\r\n })\r\n actionMap.set('Change Path', {\r\n title: 'Change Path',\r\n value: 'Change Path',\r\n action: () => changePathAction(nodes)\r\n })\r\n actionMap.set('Mark File', {\r\n title: 'Mark File',\r\n value: 'Mark File',\r\n action: () => markFileAction(nodes)\r\n })\r\n actionMap.set('Delete Mark', {\r\n title: 'Delete Mark',\r\n value: 'Delete Mark',\r\n action: () => deletMarkAction(nodes)\r\n })\r\n actionMap.set('Classification', {\r\n title: 'Classification',\r\n value: 'Classification',\r\n action: () => witeFileAction(nodes)\r\n })\r\n actionMap.set('RenameFoldKebabCase', {\r\n title: 'RenameFoldKebabCase',\r\n value: 'RenameFoldKebabCase',\r\n action: () => renameFoldAction(nodes)\r\n })\r\n actionMap.set('RenameFielKebabCase', {\r\n title: 'RenameFielKebabCase',\r\n value: 'RenameFielKebabCase',\r\n action: () => renameFileAction(nodes)\r\n })\r\n\r\n actionMap.set('Wirte Json Nodes', {\r\n title: 'Wirte Json Nodes',\r\n value: 'Wirte Json Nodes',\r\n action: () => wirteJsNodes(JSON.stringify(nodes), rootPath + '/readme-file.js')\r\n })\r\n actionMap.set('Wirte Nodes With Import(may change path)', {\r\n title: 'Wirte Nodes With Import(may change path)',\r\n value: 'Wirte Nodes With Import(may change path)',\r\n action: () => wirteJsNodesAction(nodes)\r\n })\r\n return actionMap\r\n}\r\n\r\nexport type BaseCmd = {\r\n init?: boolean\r\n config?: string\r\n}\r\n\r\nexport default async function baseAction(cmd: BaseCmd) {\r\n if (cmd.init) {\r\n logger.info(`${PKG_NAME}:version is :${VERSION}`)\r\n }\r\n selectCommand()\r\n}\r\n\r\n/**\r\n * @desc: \u9009\u62E9\u547D\u4EE4\r\n * @author: majun\r\n */\r\nasync function selectCommand() {\r\n const actions = getActions()\r\n let result: any = {}\r\n try {\r\n result = await prompts(\r\n [\r\n {\r\n name: 'command',\r\n type: 'select',\r\n message: 'Please select a command.',\r\n choices: Array.from(actions.values())\r\n }\r\n ],\r\n {\r\n onCancel: () => {\r\n throw new Error('Operation cancelled.')\r\n }\r\n }\r\n )\r\n } catch (e: any) {\r\n logger.error(e.message)\r\n process.exit(1)\r\n }\r\n actions.get(result.command)!.action()\r\n}\r\n", "/* \u751F\u6210md\u8BF4\u660E\u6587\u6863 */\r\nimport fs from 'fs'\r\nimport path from 'path'\r\nimport { getFileNodes, getNote } from './get-file'\r\nimport { ItemType } from './get-file'\r\nimport logger from '../shared/logger'\r\nimport createDebugger from 'debug'\r\nconst rootPath = process.cwd().replace(/\\\\/g, '/')\r\nconst debug = createDebugger('wirte-md')\r\ndebug.enabled = false\r\ntype secoutType = { rowTotleNumber: number; sizeTotleNumber: number; coutObj: { [key: string]: number } }\r\n/**\r\n * @description:Write the result to JS file \u628A\u7ED3\u679C\u5199\u5165\u5230js\u6587\u4EF6\r\n * @param {data} \u8981\u5199\u7684\u6570\u636E\r\n * @return {fileName} \u8981\u5199\u5165\u6587\u4EF6\u5730\u5740\r\n */\r\nexport function wirteMd(data: string, filePath: string) {\r\n const file = path.resolve(rootPath, filePath)\r\n // \u5F02\u6B65\u5199\u5165\u6570\u636E\u5230\u6587\u4EF6\r\n fs.writeFile(file, data, { encoding: 'utf8' }, () => {\r\n logger.success('Write successful')\r\n })\r\n}\r\n\r\n/**\r\n * @description: Get statistics \u5F97\u5230\u7EDF\u8BA1\r\n * @param {Array} nodes\r\n * @return {*}\r\n */\r\nfunction getCountMd(datas: ItemType[]) {\r\n let rowTotleNumber = 0\r\n let sizeTotleNumber = 0\r\n const coutObj: { [key: string]: number } = {}\r\n function getDeatle(nodes: ItemType[]) {\r\n nodes.forEach((obj: ItemType) => {\r\n if (obj.children) getDeatle(obj.children)\r\n else if (obj.suffix && obj.rowSize && obj.size) {\r\n if (!coutObj.hasOwnProperty(obj.suffix)) coutObj[obj.suffix] = 0\r\n coutObj[obj.suffix]++\r\n rowTotleNumber += obj.rowSize\r\n sizeTotleNumber += obj.size\r\n }\r\n })\r\n }\r\n getDeatle(datas)\r\n return {\r\n rowTotleNumber,\r\n sizeTotleNumber,\r\n coutObj\r\n }\r\n}\r\n\r\n/**\r\n * @description:Thousands format \u5343\u5206\u4F4D\u683C\u5F0F\u5316\r\n * @param {num} To format a number \u8981\u683C\u5F0F\u5316\u6570\u5B57\r\n * @return {string}\r\n */\r\nfunction format(num: number) {\r\n var reg = /\\d{1,3}(?=(\\d{3})+$)/g\r\n return (num + '').replace(reg, '$&,')\r\n}\r\n\r\n/**\r\n * @description: Generate statistics MD \u751F\u6210\u7EDF\u8BA1md\r\n * @param {object} option\r\n * @return {*}\r\n */\r\nfunction setCountMd(obj: secoutType) {\r\n const { rowTotleNumber, sizeTotleNumber, coutObj } = obj\r\n let countMd = ''\r\n let totle = 0\r\n for (const key in coutObj) {\r\n const ele = coutObj[key]\r\n totle += ele\r\n countMd += `The suffix is ${key} has ${ele} files\\n`\r\n }\r\n countMd += `The totle has ${totle} files\\n`\r\n let md = `Total number of file lines: ${format(rowTotleNumber)},\r\nTotal number of codes: ${format(sizeTotleNumber)} \\n`\r\n md = countMd + md\r\n return md\r\n}\r\n/**\r\n * @description: Generate MD \u751F\u6210md\r\n * @param {object} option\r\n * @return {*}\r\n */\r\nexport function getMd(\r\n option?: { ignore: string[] | undefined; include: string[] | undefined } | undefined\r\n) {\r\n logger.success('*** run location: '+process.cwd() + '\\n')\r\n const nodes = getFileNodes(rootPath,option)\r\n const countMdObj = getCountMd(nodes)\r\n const coutMd = setCountMd(countMdObj)\r\n logger.success(coutMd)\r\n const note = getNote(nodes) // \u5F97\u5230\u6240\u6709note\u7684\u6570\u7EC4\r\n const md = note.join('') + '\\n' // \u6570\u7EC4\u8F6C\u5B57\u7B26\u4E32\r\n if (md.length > 0) {\r\n logger.success('*** Automatic generation completed !')\r\n }\r\n return { md: md + coutMd, nodes }\r\n}\r\n", "/* \u83B7\u53D6\u6587\u4EF6\u76F8\u5173\u65B9\u6CD5 */\r\nimport fs from 'fs'\r\nimport path from 'path'\r\nimport createDebugger from 'debug'\r\nimport { changeImport } from './change-path';\r\nconst debug = createDebugger('get-file')\r\ndebug.enabled = false\r\nimport { env } from 'node-environment'\r\nconst isDev = env() === 'development'\r\n/**\r\n * @description:Gets the header comment of the file \u83B7\u53D6\u6587\u4EF6\u7684\u5934\u90E8\u6CE8\u91CA\r\n * @param {*} fullPath\r\n * @return {*}\r\n */\r\nexport function getFile(fullPath: string) {\r\n const str = fs.readFileSync(fullPath, 'utf-8')\r\n const size = str.length\r\n const sarr = str.split(/[\\n]/g)\r\n const rowSize = sarr.length\r\n const imports = getImport(sarr, fullPath)\r\n const f =\r\n sarr[0].indexOf('eslint') === -1 &&\r\n (sarr[0].indexOf('-->') > -1 || sarr[0].indexOf('*/') > -1 || sarr[0].indexOf('//') > -1)\r\n ? sarr[0]\r\n : ''\r\n return {\r\n note: f.replace(/<\\/?[^>]*>|(\\n|\\r)/g, ''), // \u53BB\u6389\u5C3E\u5DF4\u6362\u884C\u7B26\u53F7\r\n size,\r\n rowSize,\r\n imports\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u8FD9\u662F\u521D\u59CB\u5316\u65F6\u5C31\u83B7\u53D6\u6BCF\u4E2A\u6587\u4EF6\u4F9D\u8D56\u7684\u65B9\u6CD5, \u4F46\u8981\u6C42\u5148\u8865\u5168\u540E\u7F00,\u5426\u5219\u4E0D\u7075\r\n * @author: majun\r\n * @param {any} sarr\r\n * @param {string} fullPath\r\n */\r\nexport function getImport(sarr: any[], fullPath: string) {\r\n // \u8FD9\u91CC\u83B7\u53D6\u6BCF\u4E2A\u6587\u4EF6\u7684import\u8DEF\u5F84\r\n const imports: string[] = []\r\n sarr.forEach((ele: string) => {\r\n if (ele.indexOf('from') > -1) {\r\n const { absoluteImport } = changeImport(ele, fullPath)\r\n if (absoluteImport) {\r\n imports.push(absoluteImport)\r\n }\r\n\r\n }\r\n })\r\n return imports\r\n}\r\n\r\nexport type ItemType = {\r\n name: string\r\n copyed?: boolean\r\n isDir: boolean\r\n level: number\r\n note: string\r\n size?: number\r\n suffix?: string\r\n rowSize?: number\r\n fullPath: string\r\n belongTo: string[] // \u6807\u8BB0\u5F52\u5C5E\u8BBE\u7F6E \u5206\u7C7B\u7528\r\n imports: string[] // \u4F9D\u8D56\u6536\u96C6\r\n children?: ItemType[]\r\n}\r\n\r\n/**\r\n * @description:Generate node information for all files \u751F\u6210\u6240\u6709\u6587\u4EF6\u7684node\u4FE1\u606F\r\n * @param {*} dir \u8981\u89E3\u6790\u7684\u8DEF\u5F84\r\n * @param {Array} nodes\r\n * @param {Number} level\r\n * @return {*}\r\n */\r\nexport function getFileNodes(\r\n dir = process.cwd(),\r\n option?: { ignore: string[] | undefined; include: string[] | undefined } | undefined,\r\n nodes: ItemType[] = [],\r\n level = 0\r\n): ItemType[] {\r\n //File filtering -- full name with suffix required \u6587\u4EF6\u8FC7\u6EE4--\u9700\u8981\u5168\u79F0\u5E26\u540E\u7F00\r\n let ignore = [\r\n // 'api',\r\n // 'src',\r\n 'bin',\r\n 'lib',\r\n 'jest.config.js',\r\n 'router',\r\n 'img',\r\n 'styles',\r\n 'node_modules',\r\n 'LICENSE',\r\n '.git',\r\n '.github',\r\n 'dist',\r\n '.husky',\r\n '.vscode',\r\n '.eslintrc.js',\r\n 'readme-file.js',\r\n 'readme-md.js'\r\n ]\r\n //File suffix contains only \u6587\u4EF6\u540E\u7F00\u53EA\u5305\u542B\r\n let include = isDev?['.js', '.vue']:['.js', '.vue', '.ts']\r\n if (option) {\r\n ignore = option.ignore || ignore\r\n include = option.include || include\r\n }\r\n\r\n const files = fs\r\n .readdirSync(dir)\r\n .map((item) => {\r\n let fullPath = path.join(dir, item)\r\n const isDir = fs.lstatSync(fullPath).isDirectory()\r\n return {\r\n name: item,\r\n isDir,\r\n level,\r\n note: '',\r\n imports: new Array(),\r\n belongTo: new Array()\r\n } as ItemType\r\n })\r\n //Sort folders and files, otherwise the generated will not correspond to the opening order of the editor \u5BF9\u6587\u4EF6\u5939\u548C\u6587\u4EF6\u8FDB\u884C\u6392\u5E8F,\u8981\u4E0D\u7136\u751F\u6210\u7684\u548C\u7F16\u8F91\u5668\u6253\u5F00\u7684\u987A\u5E8F\u4E0D\u5BF9\u5E94\r\n .sort((a, b) => {\r\n if (!a.isDir && b.isDir) return 1\r\n if (a.isDir && !b.isDir) return -1\r\n if ((a.isDir && b.isDir) || (!a.isDir && !b.isDir)) return 0\r\n return 0\r\n })\r\n for (let index = 0; index < files.length; index += 1) {\r\n const item = files[index]\r\n //Folder filtering is handled here \u8FD9\u91CC\u5904\u7406\u6587\u4EF6\u5939\u8FC7\u6EE4\r\n const foldFlag = ignore.findIndex((obj: string) => obj === item.name)\r\n if (foldFlag === -1) {\r\n const fullPath = path.join(dir, item.name)\r\n const isDir = fs.lstatSync(fullPath).isDirectory()\r\n if (isDir) {\r\n //recursion \u9012\u5F52\r\n getFileNodes(fullPath, option, (item.children = []), level + 1)\r\n item.fullPath = fullPath.replace(/\\\\/g, '/')\r\n nodes.push(item)\r\n } else {\r\n const i = fullPath.lastIndexOf('.')\r\n const lastName = fullPath.substring(i)\r\n //File filtering is handled here \u8FD9\u91CC\u5904\u7406\u6587\u4EF6\u8FC7\u6EE4\r\n if (include.includes(lastName)) {\r\n const obj = getFile(fullPath)\r\n Object.assign(item, obj)\r\n item.suffix = lastName\r\n item.fullPath = fullPath.replace(/\\\\/g, '/')\r\n nodes.push(item)\r\n }\r\n }\r\n }\r\n }\r\n return nodes\r\n}\r\n\r\n/**\r\n * @description:Recursive file name + note \u9012\u5F52\u5F97\u5230\u6587\u4EF6\u540D+note\r\n * @param {Array} datas\r\n * @param {string} keys\r\n * @return {*}\r\n */\r\nexport function getNote(datas: ItemType[], keys?: string[]) {\r\n const nodes = keys || []\r\n datas.forEach((obj: ItemType, index: Number) => {\r\n const last = index === datas.length - 1\r\n if (obj.children) {\r\n //fold\r\n getNote(obj.children, nodes)\r\n }\r\n const md = setMd(obj, last)\r\n nodes.push(md)\r\n })\r\n return nodes\r\n}\r\n\r\n/**\r\n * @description:One obj generates one line of text \u4E00\u4E2Aobj\u751F\u6210\u4E00\u4E2A\u4E00\u884C\u6587\u5B57\r\n * @param {ItemType} obj\r\n * @param {Boolean} last Is it the last one \u662F\u4E0D\u662F\u6700\u540E\u4E00\u4E2A\r\n * @return {*}\r\n */\r\n function setMd(obj: ItemType, last: Boolean): string {\r\n let filesString = ''\r\n const blank = '\u2502 '.repeat(obj.level) // \u91CD\u590D\u7A7A\u767D\r\n const pre = `${blank}${last ? '\u2514\u2500\u2500' : '\u251C\u2500\u2500'} ${obj.name}`\r\n if (obj.isDir) {\r\n filesString += `${pre}\\n`\r\n } else {\r\n filesString += `${pre} ${obj.note}\\n`\r\n }\r\n return filesString\r\n}\r\n", "/* \u6574\u4E2A\u6587\u4EF6\u4E3B\u8981\u628A\u7EDD\u5BF9\u8DEF\u5F84\u4FEE\u6539\u4E3A\u76F8\u5BF9\u8DEF\u5F84 */\r\nimport { ItemType } from './get-file'\r\nimport fs from 'fs'\r\nimport path from 'path'\r\nimport logger from '../shared/logger'\r\nimport createDebugger from 'debug'\r\nconst debug = createDebugger('change-path')\r\ndebug.enabled = false\r\n/**\r\n * @desc: \u9012\u5F52\u5FAA\u73AF\u6240\u6709\u6587\u4EF6\r\n * @author: majun\r\n * @param {Array} nodes \u6574\u4E2A\u6587\u4EF6\u7684nodes\r\n */\r\nexport async function changePath(nodes: ItemType[]) {\r\n async function getNode(nodes: ItemType[]) {\r\n for (let index = 0; index < nodes.length; index++) {\r\n const ele = nodes[index]\r\n if (ele.children) {\r\n await getNode(ele.children)\r\n } else {\r\n // TODO \u8FD9\u91CC\u5148\u5199\u6B7B\u7EDD\u5BF9\u8F6C\u76F8\u5BF9, \u540E\u9762\u5982\u679C\u60F3\u76F8\u5BF9\u90FD\u8F6C\u7EDD\u5BF9, \u53EF\u4EE5\u6539\u8FD9\u91CC\r\n witeFile(ele, true)\r\n }\r\n }\r\n }\r\n await getNode(nodes)\r\n}\r\n/**\r\n * @desc: \u8FD9\u91CC\u8FD4\u56DE\u6CA1\u6709@ \u7B26\u53F7\u7684\u8DEF\u5F84\r\n * @author: majun\r\n * @param {string} absoluteImport \u4F9D\u8D56\u672C\u8EAB\u540D\u5B57\r\n * @param {string} fullPath \u6587\u4EF6\u672C\u8EAB\u7EDD\u5BF9\u5730\u5740\r\n */\r\nexport function getRelatPath(absoluteImport: string, fullPath: string) {\r\n let relatPath = path.relative(path.dirname(fullPath), absoluteImport) // \u8F6C\u56DE\u76F8\u5BF9\u8DEF\u5F84\r\n relatPath = relatPath.replace(/\\\\/g, '/')\r\n if (relatPath.indexOf('.') !== 0) {\r\n relatPath = './' + relatPath\r\n }\r\n return relatPath\r\n}\r\n\r\n/**\r\n * @desc: \u8865\u540E\u7F00\u7684\u65B9\u6CD5+\u66FF\u6362\u524D\u7F00\r\n * @author: majun\r\n * @param {string} filePath \u6B63\u5219\u5339\u914D\u5230\u7684\u4F9D\u8D56\u8DEF\u5F84\r\n * @param {string} fullPath \u672C\u8EAB\u6587\u4EF6\u540D\u8DEF\u5F84\r\n * @param {string} impName \u6B63\u786E\u7684\u540D\u5B57\r\n */\r\nexport function makeSuffix(filePath: string, fullPath: string) {\r\n let absoluteImport = ''\r\n // \u5982\u679C\u6709@\u7B26\u53F7\u7684\r\n if (filePath.indexOf('@') > -1) {\r\n debug('!!!!!!!!!filePath: ', filePath)\r\n absoluteImport = filePath.replace('@', process.cwd())\r\n } else {\r\n absoluteImport = path.resolve(path.dirname(fullPath), filePath)\r\n }\r\n debug('makeSuffix \u5165\u53C2: absoluteImport', absoluteImport)\r\n const lastName = path.extname(absoluteImport)\r\n debug('lastName', lastName)\r\n // \u5047\u5982\u6CA1\u6709\u540E\u7F00,\u8865\u4E0A\r\n if (!lastName) {\r\n debug('!!!!!!!!!!!\u7F3A\u540E\u7F00\u6587\u4EF6: ', absoluteImport)\r\n // \u83B7\u53D6\u7EDD\u5BF9\u8DEF\u5F84\r\n const suffix = ['.js', '.ts', '.vue', '/index.js', '/index.vue']\r\n for (let j = 0; j < suffix.length; j++) {\r\n const fixStr = suffix[j]\r\n if (fs.existsSync(absoluteImport + fixStr)) {\r\n // \u628A\u6539\u597D\u7684\u66FF\u6362\u56DE\u53BB\r\n debug('\u8865\u5168\u7684\u6587\u4EF6: ', absoluteImport + fixStr)\r\n absoluteImport = absoluteImport + fixStr\r\n break\r\n }\r\n }\r\n }\r\n return absoluteImport.replace(/\\\\/g, '/')\r\n}\r\n\r\n/**\r\n * @desc: \u6839\u636E\u4E00\u884C\u4EE3\u7801\u5339\u914Dimport\u7684\u8BE6\u7EC6\u5185\u5BB9 TODO \u8FD9\u91CC\u8FD8\u5F97\u4F18\u5316\r\n * @author: majun\r\n */\r\nexport function getImportName(ele: string) {\r\n let str=''\r\n // \u6CE8\u91CA\u7684\u4E0D\u8F6C,\u5176\u4ED6\u516C\u5171\u4E5F\u4E0D\u8F6C\r\n const ignore = [\r\n 'xiwicloud',\r\n 'bpmn-js',\r\n 'element-ui',\r\n 'lodash',\r\n 'handsontable',\r\n 'nprogress',\r\n 'quill',\r\n 'qrcodejs2',\r\n 'echarts'\r\n ]\r\n const flag = ignore.some((item) => ele.indexOf(item) > -1)\r\n // const reg = /import.*[\\\"|\\'](.*)[\\'|\\\"]/\r\n const reg = / from [\\\"|\\'](.*)[\\'|\\\"]/\r\n // if (fullPath == 'D:/gitwork/auto-generate-md/unuse/App.vue') {\r\n // debug(!flag, ele.indexOf('/') > -1, \"000000000000000000000000\")\r\n // debug(ele.match(reg), '11111111111111')\r\n // }\r\n // \u8FD9\u91CC\u53EA\u6536\u96C6\u7EC4\u4EF6\u4F9D\u8D56, \u63D2\u4EF6\u4F9D\u8D56\u6392\u9664\u6389\r\n if (!flag && ele.indexOf('/') > -1 && ele.indexOf('//') !== 0) {\r\n const impStr = ele.match(reg);\r\n // \u6CA1\u6709import\u7684\u4E0D\u8F6C\r\n if (impStr && impStr[1]) str = impStr[1];\r\n }\r\n return str\r\n}\r\n\r\n/**\r\n * @desc: \u627E\u5230import\u5E76\u8FD4\u56DE\u5168\u8DEF\u5F84\u548C\u539F\u59CB\u8DEF\u5F84\r\n * @author: majun\r\n * @param {string} ele \u627E\u5230\u7684\u884C\u5F15\u5165\r\n * @param {string} fullPath \u6587\u4EF6\u7684\u5168\u8DEF\u5F84\r\n */\r\nexport function changeImport(ele: string, fullPath: string) {\r\n let obj = {\r\n impName: '',\r\n filePath: '',\r\n absoluteImport:''\r\n }\r\n const impName = getImportName(ele)\r\n if (impName) {\r\n // \u4F9D\u8D56\u7684\u5177\u4F53\u540D\u5B57\r\n obj.filePath = impName\r\n debug('!!!!!!!!!\u5339\u914Dimp: ', impName)\r\n // \u5148\u8865\u540E\u7F00\r\n obj.absoluteImport = makeSuffix(obj.filePath, fullPath)\r\n debug('\u8865\u8FC7\u540E', obj.absoluteImport)\r\n // \u540E\u6539\u76F8\u5BF9\u8DEF\u5F84\r\n obj.impName = getRelatPath(obj.absoluteImport, fullPath)\r\n debug('\u76F8\u5BF9\u8DEF\u5F84: ', obj.impName)\r\n }\r\n return obj\r\n}\r\n/**\r\n * @desc: \u5199\u6587\u4EF6\r\n * @author: majun\r\n\r\n * @param {string} file \u76EE\u6807\u5730\u5740\r\n */\r\nexport function witeFile(node: ItemType, isRelative?: Boolean) {\r\n const { fullPath} = node\r\n try {\r\n let writeFlag = false // \u5982\u679C\u5565\u90FD\u6CA1\u6539, \u4E0D\u66F4\u65B0\u6587\u4EF6\r\n let fileStr = fs.readFileSync(fullPath, 'utf-8')\r\n const sarr = fileStr.split(/[\\n]/g)\r\n for (let index = 0; index < sarr.length; index++) {\r\n const ele = sarr[index]\r\n if (ele.indexOf('from') > -1 && isRelative) {\r\n const obj = changeImport(ele, fullPath)\r\n // if (node.name === '***') {\r\n // debug(obj,\"bbbnnn\")\r\n // }\r\n if (obj.impName) {\r\n sarr[index] = ele.replace(obj.filePath, obj.impName)\r\n debug('node: ', node)\r\n writeFlag = true\r\n }\r\n }\r\n }\r\n if (writeFlag) {\r\n fileStr = sarr.join('\\n')\r\n // \u5F02\u6B65\u5199\u5165\u6570\u636E\u5230\u6587\u4EF6\r\n fs.writeFileSync(fullPath, fileStr, { encoding: 'utf8' })\r\n logger.success(`Write file successful: ${fullPath}`)\r\n }\r\n } catch (error) {\r\n logger.error(`\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25,\u6587\u4EF6\u540D: ${fullPath} `)\r\n }\r\n}\r\n\r\n/**\r\n * @description: Write the result to JS file \u628A\u7ED3\u679C\u5199\u5165\u5230js\u6587\u4EF6\r\n * @param {data} \u8981\u5199\u7684\u6570\u636E\r\n * @return {fileName} \u8981\u5199\u5165\u6587\u4EF6\u5730\u5740\r\n */\r\nexport function wirteJsNodes(data: string, filePath: string) {\r\n const file = path.resolve(process.cwd(), filePath)\r\n const pre = 'export default'\r\n // \u5F02\u6B65\u5199\u5165\u6570\u636E\u5230\u6587\u4EF6\r\n fs.writeFileSync(file, pre + data, { encoding: 'utf8' })\r\n logger.success(`Write file successful: ${filePath}`)\r\n}\r\n", null, "/* \u6253\u4E2A\u6F02\u4EAE\u65E5\u5FD7 */\r\nimport { lightBlue, lightGreen, lightRed, lightYellow } from 'kolorist';\r\n\r\nconst logger = {\r\n info(text: string) {\r\n console.log(lightBlue(`\u2708 - ${text}`));\r\n },\r\n success(text: string) {\r\n console.log(lightGreen(`\u2714 - ${text}`));\r\n },\r\n warn(text: string) {\r\n console.log(lightYellow(`\u25B6 - ${text}`));\r\n },\r\n error(text: string) {\r\n console.log(lightRed(`\u2716 - ${text}`));\r\n }\r\n};\r\n\r\nexport default logger;\r\n", "/* \u7ED9\u8DEF\u7531\u6587\u4EF6\u6253\u6807\u8BB0, \u628A\u6807\u8BB0\u6253\u5230\u6700\u540E,\u56E0\u4E3A\u5934\u90E8\u5DF2\u7ECF\u7ED9\u4E86\u6CE8\u91CA */\r\nimport fs from 'fs-extra'\r\nimport { ItemType } from './get-file'\r\nimport createDebugger from 'debug'\r\nimport path from 'path'\r\nimport logger from '../shared/logger'\r\nimport { getImportName } from './change-path'\r\nconst debug = createDebugger('rename-path')\r\ndebug.enabled = false\r\n\r\n/**\r\n * \u5C06\u5355\u4E2A\u5B57\u7B26\u4E32\u7684\u9996\u5B57\u6BCD\u5C0F\u5199\r\n * @param str \u5B57\u7B26\u4E32\r\n */\r\nfunction fistLetterLower(str: string | String) {\r\n return str.charAt(0).toLowerCase() + str.slice(1)\r\n}\r\n\r\nexport function toKebabCase(str: string) {\r\n const regex = /[A-Z]/g\r\n return fistLetterLower(str).replace(regex, (word: string) => {\r\n return '-' + word.toLowerCase()\r\n })\r\n}\r\n/**\r\n * \u68C0\u6D4B\u9A7C\u5CF0\u6587\u4EF6\u540D\r\n * @param fileName \u6587\u4EF6\u540D\r\n */\r\nexport function checkCamelFile(fileName: string) {\r\n return /([a-z])([A-Z])/.test(fileName) || /([A-Z])/.test(fileName)\r\n}\r\n\r\n/**\r\n * @desc: \u5FAA\u73AFnode, \u6539\u6587\u4EF6\u5939, \u5E76\u628Aimport \u91CC\u9762\u4E0D\u5408\u683C\u7684\u547D\u540D\u6539\u5408\u683C\r\n * @author: majun\r\n */\r\nexport async function renameFoldPath(nodes: ItemType[]) {\r\n async function getNode(cpNodes: ItemType[]) {\r\n for (let index = 0; index < cpNodes.length; index++) {\r\n const ele = cpNodes[index]\r\n await renameFold(ele) // \u4E0B\u9762\u5DF2\u9012\u5F52\r\n if (ele.children) {\r\n // \u9012\u5F52\r\n await getNode(ele.children)\r\n }\r\n }\r\n }\r\n await getNode(nodes)\r\n}\r\n\r\n/**\r\n * @desc: \u5FAA\u73AFnode, \u6539\u6587\u4EF6, \u6539\u4F9D\u8D56, \u601D\u8DEF:\u5FAA\u73AF\u6BCF\u4E2A\u6587\u4EF6, \u5E76\u628Aimport \u91CC\u9762\u4E0D\u5408\u683C\u7684\u547D\u540D\u6539\u5408\u683C\r\n * @author: majun\r\n */\r\nexport async function renameFilePath(nodes: ItemType[]) {\r\n async function getNode(cpNodes: ItemType[]) {\r\n for (let index = 0; index < cpNodes.length; index++) {\r\n const ele = cpNodes[index]\r\n if (ele.children) {\r\n // \u9012\u5F52\r\n await getNode(ele.children)\r\n } else {\r\n // \u91CD\u547D\u540D\u6587\u4EF6\r\n await renameFile(ele)\r\n // \u91CD\u5199\u6587\u4EF6\u7684import\r\n await rewriteFile(ele)\r\n }\r\n }\r\n }\r\n await getNode(nodes)\r\n}\r\n\r\n async function rewriteFile(node: ItemType) {\r\n let writeFlag = false\r\n const str = fs.readFileSync(node.fullPath, 'utf-8')\r\n const sarr = str.split(/[\\n]/g)\r\n for (let index = 0; index < sarr.length; index++) {\r\n const ele = sarr[index]\r\n if (ele.indexOf('from') > -1) {\r\n let impOldName = getImportName(ele)\r\n if (checkCamelFile(impOldName)) {\r\n // \u53D6\u6587\u4EF6\u540D,\u5426\u5219\u8F6Ccase\u4F1A\u51FA\u9519\r\n let name = path.parse(impOldName).name\r\n const newName = toKebabCase(name)\r\n // \u8FD9\u91CC\u66FF\u6362\u6709\u53EF\u80FD\u628A\u5934\u4E5F\u66FF\u6362\u4E86, \u6240\u4EE5\u5207\u4E00\u4E0B\r\n //\u6BD4\u5982 import moduleName from 'moduleName' \u4F1A\u53EA\u66FF\u6362\u524D\u4E00\u4E2A \"import moduleName from 'moduleName'\".split('from')\r\n const str = ele.split('from')\r\n sarr[index] = `${str[0]}from${str[1].replace(name, newName)}`\r\n writeFlag = true\r\n }\r\n }\r\n }\r\n if (writeFlag) {\r\n let fileStr = sarr.join('\\n')\r\n try {\r\n // \u5F02\u6B65\u5199\u5165\u6570\u636E\u5230\u6587\u4EF6\r\n await fs.writeFile(node.fullPath, fileStr, { encoding: 'utf8' })\r\n logger.success(`rewriteFile successful-------: ${node.fullPath}` )\r\n } catch (error) {\r\n logger.error(`\u5199\u5165\u6587\u4EF6\u5931\u8D25,\u5730\u5740\u4E0D\u5B58\u5728: ${node.fullPath}`)\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u91CD\u547D\u540D\u6587\u4EF6\u5939\r\n * @author: majun\r\n * @param {ItemType} node\r\n */\r\nexport async function renameFold(node: ItemType) {\r\n let filename = path.parse(node.fullPath).base\r\n debug('filename111: ', filename)\r\n const filter = ['FMEA', 'DVP'] // \u628A\u8FD9\u6837\u5B50\u7684\u6587\u4EF6\u5939\u8FC7\u6EE4\r\n const falg = filter.some((item) => filename.indexOf(item) > -1)\r\n if (!falg && checkCamelFile(filename)) {\r\n // \u8FD9\u91CC\u53EA\u5904\u7406\u6587\u4EF6\u5939\r\n if (node.isDir) {\r\n const obj = await replaceName(node.fullPath)\r\n // \u8FD9\u91CC\u4E00\u5B9A\u8981\u66F4\u65B0node,\u5426\u5219\u540E\u9762\u627E\u4E0D\u5230\u8DEF\u5F84\r\n changePathFold(node, obj)\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u91CD\u547D\u540D\u540E, \u5B50\u6587\u4EF6\u90FD\u4F1A\u5B58\u5728\u8DEF\u5F84\u7684\u66F4\u6539,\u4E5F\u5C31\u8981\u9012\u5F52\u5904\u7406(\u65E2\u53EF\u4EE5\u5904\u7406\u6587\u4EF6\u5939, \u4E5F\u53EF\u4EE5\u5904\u7406\u6587\u4EF6)\r\n * @author: majun\r\n */\r\nexport function changePathFold(node: ItemType, obj: { newName: string; filename: string }) {\r\n const { newName, filename } = obj\r\n if (node.children) {\r\n for (let index = 0; index < node.children.length; index++) {\r\n const ele = node.children[index]\r\n // \u9012\u5F52\u5904\u7406\r\n changePathFold(ele, obj)\r\n }\r\n }\r\n node.fullPath = node.fullPath.replace(filename, newName)\r\n debug(node.fullPath, newName)\r\n node.name = node.name.replace(filename, newName)\r\n}\r\n/**\r\n * @desc: \u9012\u5F52\u6539\u6240\u6709\u8DEF\u5F84\u540D\u5B57\r\n * @author: majun\r\n * @param {ItemType} node\r\n * @param {object} obj\r\n */\r\nexport function changePathName(node: ItemType, obj: { newName: string; filename: string }) {\r\n const { newName, filename } = obj\r\n if (node.fullPath.indexOf(filename) > -1) {\r\n if (node.imports.length > 0) {\r\n // import\u4E5F\u8981\u53D8\u5316, \u5426\u5219\u4E5F\u4F1A\u627E\u4E0D\u5230\u8DEF\u5F84\r\n const array = node.imports\r\n for (let j = 0; j < array.length; j++) {\r\n const ele = array[j]\r\n debug('import-ele: ', ele)\r\n array[j] = toKebabCase(ele)\r\n debug('\u66F4\u6362import: ', array[j])\r\n }\r\n }\r\n node.fullPath = node.fullPath.replace(filename, newName)\r\n node.name = node.name.replace(filename, newName)\r\n debug('\u66FF\u6362\u540E\u7684 node.fullPath:', node.fullPath)\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u91CD\u547D\u540D\u6587\u4EF6\r\n * @author: majun\r\n * @param {ItemType} node\r\n */\r\nexport async function renameFile(node: ItemType) {\r\n let filename = path.parse(node.fullPath).base\r\n if (checkCamelFile(filename)) {\r\n const suffix = ['.js', '.vue'] // \u8FD9\u91CC\u53EA\u91CD\u547D\u540Djs\u548Cvue\u6587\u4EF6\r\n const lastName = path.extname(node.fullPath)\r\n let flag = suffix.some((item) => lastName === item)\r\n if (flag) {\r\n const obj = await replaceName(node.fullPath)\r\n // \u8FD9\u91CC\u4E00\u5B9A\u8981\u66F4\u65B0node,\u5426\u5219\u540E\u9762\u627E\u4E0D\u5230\u8DEF\u5F84\r\n changePathName(node, obj)\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * \u91CD\u547D\u540D\u6587\u4EF6\u5939 CamelCase || PascalCase => kebab-case\r\n * @param node \u8282\u70B9\r\n */\r\nexport async function replaceName(fullPath: string) {\r\n let filename = path.parse(fullPath).base\r\n const newName = toKebabCase(filename)\r\n debug('newName: ', newName)\r\n debug('filename: ', filename)\r\n const oldPath = fullPath\r\n const newPath = oldPath.replace(filename, newName)\r\n // rename\u4E4B\u524D\u8981\u5224\u65AD\u4E00\u4E0B,\u5047\u5982\u5DF2\u7ECF\u6709\u4E86,\u90A3\u4E48\u76F4\u63A5\u62F7\u8D1D\u8FC7\u53BB,\u5E76\u4E14\u5220\u9664\u539F\u6765\u7684\r\n const lastName = path.extname(newPath)\r\n if (!lastName) {\r\n // \u6587\u4EF6\u5939, \u7279\u6B8A\u5904\u7406,\u8981copy\u6587\u4EF6\r\n if (fs.existsSync(newPath)) {\r\n // debug('newPath: ', newPath)\r\n await fs.copy(fullPath, newPath)\r\n fs.removeSync(fullPath) // \u5220\u9664\u76EE\u5F55\r\n return { newName, filename }\r\n }\r\n }\r\n debug(oldPath, newPath, 'oldPath, newPath')\r\n try {\r\n const flag = fs.existsSync(oldPath)\r\n if (flag) {\r\n console.log(oldPath, '\u6539\u540D\u4E3A: ', newPath ,\"\u6210\u529F\")\r\n await fs.rename(oldPath, newPath)\r\n } else {\r\n logger.error(`\u6587\u4EF6${oldPath}\u4E0D\u5B58\u5728\u91CD\u547D\u540D\u5E72\u561B?`)\r\n }\r\n logger.info(filename + ' is reneme done')\r\n return { newName, filename }\r\n } catch (error) {\r\n throw error\r\n }\r\n}\r\n", "import arg from 'arg'\r\nconst stringToArgs = (rawArgs: string[]) => {\r\n const args = arg(\r\n {\r\n '--ignore': String,\r\n '--include': String,\r\n '--version': Boolean,\r\n '--help': Boolean,\r\n '-h': '--help',\r\n '-i': '--ignore',\r\n '-in': '--include',\r\n '-v': '--version'\r\n },\r\n {\r\n argv: rawArgs.slice(2)\r\n }\r\n )\r\n return {\r\n help: args['--help'],\r\n ignore: args['--ignore'],\r\n include: args['--include'],\r\n version: args['--version']\r\n }\r\n}\r\n\r\nexport default stringToArgs\r\n", "const st = `Usage: agmd--include str--ignore str\r\n\r\n Options:\r\n --include string / -i string.......... include file extension\r\n --ignore string / -in string........... ignore file or fold\r\n --version / -v ........... seach vesion\r\n Str deafult:\r\n --ignore img,styles,node_modules,LICENSE,.git,.github,dist,.husky,.vscode,readme-file.js,readme-md.js\r\n --include .js,.vue,.ts\r\n\r\n Note:\r\n There should be no space between strings in a configuration\r\n\r\n Examples:\r\n $ agmd --ignore lib,node_modules,dist --include .js,.ts,.vue`\r\n\r\nfunction help() {\r\n console.log(st)\r\n process.exit(0)\r\n}\r\nexport default help\r\n", "import help from '../help'\r\nimport pkg from '../../package.json'\r\ninterface parseType {\r\n version?: Boolean | undefined\r\n includes?: string[]\r\n ignores?: string[]\r\n help: Boolean | undefined\r\n ignore: string | undefined\r\n include: string | undefined\r\n}\r\nfunction handle(settings: parseType) {\r\n if (settings.help) {\r\n help()\r\n }\r\n if (settings.version) {\r\n console.log(`agmd version is: ` + '\\x1B[36m%s\\x1B[0m', pkg.version)\r\n process.exit(0)\r\n }\r\n if (settings.ignore) {\r\n settings.ignores = settings.ignore.split(' ')\r\n }\r\n if (settings.include) {\r\n settings.includes = settings.include.split(' ')\r\n }\r\n return settings\r\n}\r\n\r\nexport default handle\r\n", "/* \u7ED9\u8DEF\u7531\u6587\u4EF6\u6253\u6807\u8BB0, \u628A\u6807\u8BB0\u6253\u5230\u6700\u540E,\u56E0\u4E3A\u5934\u90E8\u5DF2\u7ECF\u7ED9\u4E86\u6CE8\u91CA */\r\nimport fs from 'fs'\r\nimport { ItemType } from './get-file'\r\nimport { markWriteFile } from './mark-write-file'\r\nimport createDebugger from 'debug'\r\nimport logger from '../shared/logger'\r\nconst debug = createDebugger('mark-file')\r\nconst rootPath = process.cwd().replace(/\\\\/g, '/')\r\ndebug.enabled = false\r\ntype classifyType = Array<{\r\n name: string\r\n router: Array<{\r\n path: string\r\n // \u8DEF\u7531\u5FC5\u987B\u90FD\u662F\u7EDD\u5BF9\u8DEF\u5F84\r\n component: string\r\n }>\r\n}>\r\n/**\r\n * @desc: \u6807\u8BB0\u6587\u4EF6\u4E3B\u7A0B\u5E8F\r\n * @author: majun\r\n * @param {ItemType} nodes\r\n * @param {string} rootPath\r\n */\r\nexport async function markFile(nodes: ItemType[], routers: classifyType) {\r\n for (let i = 0; i < routers.length; i++) {\r\n const ele = routers[i]\r\n for (let j = 0; j < ele.router.length; j++) {\r\n const obj = ele.router[j]\r\n const pathN = obj.component\r\n logger.info(`\u51C6\u5907\u5904\u7406${obj.path}`)\r\n // \u8DEF\u5F84\u8F6C\u7EDD\u5BF9\u8DEF\u5F84\r\n let absolutePath = pathN.replace('@', rootPath)\r\n // \u9012\u5F52\u6253\u4E0A\u5B50\u96C6\u6240\u6709\r\n await setNodeMark(nodes, ele.name, absolutePath)\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u6807\u8BB0\u6587\u4EF6\u4E3B\u7A0B\u5E8F\r\n * @author: majun\r\n * @param {ItemType} nodes\r\n * @param {string} rootPath\r\n */\r\nexport async function witeMarkFile(nodes: ItemType[], routers: classifyType) {\r\n for (let index = 0; index < routers.length; index++) {\r\n const ele = routers[index]\r\n // \u8FD9\u91CC\u5FAA\u73AF\u6253\u6807\u8BB0\u7684\u8DEF\u7531\r\n for (let index = 0; index < ele.router.length; index++) {\r\n const obj = ele.router[index]\r\n const pathN = obj.component\r\n // \u8DEF\u5F84\u8F6C\u7EDD\u5BF9\u8DEF\u5F84\r\n let absolutePath = pathN.replace('@', rootPath)\r\n // \u5BF9\u6253\u4E0A\u6807\u8BB0\u7684\u6587\u4EF6\u8FDB\u884C\u5206\u7C7B\u5199\u5165\r\n await markWriteFile(nodes, ele.name, absolutePath)\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u5206\u79BB\u4E00\u4E2A\u9012\u5F52\u8C03\u7528\u7684mark\u51FD\u6570\r\n * @author: majun\r\n */\r\nexport async function setNodeMark(nodes: ItemType[], name: string, path: string) {\r\n debug('setNodeMark\u5165\u53C2: ', name, path )\r\n // debug('nodes: ', nodes)\r\n // \u901A\u8FC7\u6587\u4EF6\u5730\u5740, \u627E\u5230nodes\u7684\u4F9D\u8D56\u5730\u5740, \u628A\u4F9D\u8D56\u6587\u4EF6\u4E5F\u6253\u6807\u8BB0\r\n const node = findNodes(nodes, path)\r\n if (node) {\r\n // \u6253\u6807\u8BB0\r\n setmark(path, name)\r\n }\r\n // debug('\u67E5\u627E\u7684node: ', node)\r\n if (node && node.imports) {\r\n // \u6807\u8BB0\u5F52\u5C5E\u8BBE\u7F6E\r\n if (node.belongTo.indexOf(name)>-1) return // \u5DF2\u7ECF\u5206\u6790\u8FC7\u8BE5\u6587\u4EF6\u4E86, \u5C31\u4E0D\u518D\u5206\u6790,\u5426\u5219\u4F1A\u6B7B\u5FAA\u73AF\r\n node.belongTo.push(name)\r\n // \u627E\u5230\u6709\u5B50\u6587\u4EF6\u4E86,\u5FAA\u73AF\u5B83\r\n for (let index = 0; index < node.imports.length; index++) {\r\n const element = node.imports[index]\r\n debug('\u4F9D\u8D56\u6587\u4EF6: ', element)\r\n // \u5982\u679C\u6587\u4EF6\u5B58\u5728\r\n if (fs.existsSync(path)) {\r\n // \u7EE7\u7EED\u9012\u5F52,\u76F4\u5230\u5B50\u6587\u4EF6\u6CA1\u6709\u5B50\u6587\u4EF6\r\n await setNodeMark(nodes, name, element)\r\n } else {\r\n logger.error(`\u6587\u4EF6\u4E0D\u5B58\u5728: ${path}`)\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u9012\u5F52\u901A\u8FC7\u6587\u4EF6\u5168\u540D\u627E\u8282\u70B9\r\n * @author: majun\r\n * @param {*} nodes\r\n * @param {*} path\r\n */\r\nexport function findNodes(nodes: ItemType[], path: string): ItemType | null {\r\n let node = null\r\n function find(nodes: ItemType[]) {\r\n for (let index = 0; index < nodes.length; index++) {\r\n const element = nodes[index]\r\n if (element.children) find(element.children)\r\n if (element.fullPath === path) node = element\r\n }\r\n }\r\n find(nodes)\r\n return node\r\n}\r\n\r\n/**\r\n * @desc: \u7ED9\u6587\u4EF6\u6807\u8BB0\r\n * @author: majun\r\n * @param {string} file\r\n * @param {string} name\r\n */\r\nexport function setmark(file: string, name: string) {\r\n try {\r\n debug(`mark preper ${file}`)\r\n let fileStr = fs.readFileSync(file, 'utf-8')\r\n if (fileStr.indexOf('//' + name + '\\n') === 0) {\r\n // \u6253\u8FC7\u6807\u8BB0\u4E86,\u5C31\u4E0D\u6253\u4E86\r\n return\r\n }\r\n // \u76F4\u63A5\u6253\u4E0A\u6807\u8BB0\r\n fileStr = '//' + name + '\\n' + fileStr\r\n fs.writeFileSync(file, fileStr)\r\n logger.info(`mark successful-------: ${file}`)\r\n } catch (error) {\r\n logger.error(`\u7ED9\u6587\u4EF6\u6253\u6807\u8BB0\u7684\u6587\u4EF6\u4E0D\u5B58\u5728: ${file}`)\r\n return\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u9012\u5F52\u6240\u6709\u6587\u4EF6,\u5220\u9664\u6240\u6709\u6807\u8BB0\r\n * @author: majun\r\n * @param {Array} nodes\r\n */\r\nexport function deletMarkAll(nodes: ItemType[], name: string) {\r\n function find(nodes: ItemType[]) {\r\n for (let index = 0; index < nodes.length; index++) {\r\n const element = nodes[index]\r\n if (element.children) find(element.children)\r\n else deletMark(element.fullPath, name)\r\n }\r\n }\r\n find(nodes)\r\n}\r\n\r\n/**\r\n * @desc: \u7ED9\u6587\u4EF6\u6807\u8BB0\r\n * @author: majun\r\n * @param {string} file\r\n * @param {string} name\r\n */\r\nexport function deletMark(file: string, name: string) {\r\n let fileStr=''\r\n try {\r\n fileStr = fs.readFileSync(file, 'utf-8')\r\n let sarr = fileStr.split(/[\\n]/g)\r\n for (let index = 0; index < sarr.length; index++) {\r\n const ele = sarr[index]\r\n if (ele.indexOf('//' + name) > -1) {\r\n sarr.splice(index, 1)\r\n index-- //i\u9700\u8981\u81EA\u51CF\uFF0C\u5426\u5219\u6BCF\u6B21\u5220\u9664\u90FD\u4F1A\u8BB2\u539F\u6570\u7EC4\u7D22\u5F15\u53D1\u751F\u53D8\u5316\r\n }\r\n }\r\n fileStr = sarr.join('\\n')\r\n fs.writeFileSync(file, fileStr, { encoding: 'utf8' })\r\n debug('delete mark successful-------' + file)\r\n return fileStr\r\n } catch (error) {\r\n console.error('\u5220\u9664\u6807\u8BB0\u7684\u6587\u4EF6\u4E0D\u5B58\u5728: ', file)\r\n }\r\n return ''\r\n}\r\n", "/* \u5BF9\u6253\u4E0A\u6807\u8BB0\u7684\u6587\u4EF6\u8FDB\u884C\u5206\u7C7B\u5199\u5165, \u5206\u6B65\u9AA4\u5199\u65B9\u6CD5, \u867D\u7136\u5BF9\u4E8E\u6027\u80FD\u6709\u5F71\u54CD, \u4F46\u4E00\u70B9\u70B9\u7B97\u4EC0\u4E48, \u80FD\u591F\u5206\u6B65\u9AA4\u8C03\u8BD5\u6700\u597D, \u4E0D\u8981\u8FD9\u4E2A\u6B65\u9AA4, \u76F4\u63A5\u6CE8\u91CA\u6389\u8FD9\u4E2A\u65B9\u6CD5\u5C31\u884C */\r\nimport createDebugger from 'debug'\r\nimport { findNodes } from './mark-file'\r\nimport { ItemType } from './get-file'\r\nimport fs from 'fs-extra'\r\nimport logger from '../shared/logger'\r\nconst rootPath = process.cwd().replace(/\\\\/g, '/')\r\nconst debug = createDebugger('mark-write-file')\r\ndebug.enabled = false\r\n/**\r\n * @desc: \u9012\u5F52\u6587\u4EF6\u5B50\u4F9D\u8D56\u521B\u5EFA\u6587\u4EF6- \u6587\u4EF6\u5916\u9012\u5F52\r\n * @author: majun\r\n * @param {ItemType} nodes\r\n * @param {string} name\r\n * @param {string} path \u7EDD\u5BF9\u8DEF\u5F84\r\n * @param {string} rootPath \u786E\u5B9A\u54EA\u4E00\u7EA7\u5F00\u59CB\u521B\u5EFA\u6587\u4EF6\u5939\r\n */\r\nexport async function markWriteFile(nodes: ItemType[], name: string, path: string) {\r\n debug('\u5165\u53C2: ', name, path)\r\n // \u901A\u8FC7\u6587\u4EF6\u5730\u5740, \u627E\u5230nodes\u7684\u4F9D\u8D56\u5730\u5740, \u628A\u4F9D\u8D56\u6587\u4EF6\u4E5F\u6253\u6807\u8BB0\r\n const node = findNodes(nodes, path)\r\n debug('\u67E5\u627E\u7684node: ', node)\r\n if (node) {\r\n if (node.copyed) return // \u5982\u679C\u8FD9\u4E2A\u6587\u4EF6\u5DF2\u7ECF\u88AB\u5206\u6790\u8FC7\u4E86,\u90A3\u4E48\u8DF3\u8FC7, \u5426\u5219\u4F1A\u65E0\u9650\u5206\u6790\r\n node.copyed = true\r\n // \u5F97\u5230\u6807\u8BB0\r\n const belongTo = node.belongTo\r\n if (belongTo.length > 0) {\r\n await setDispFileNew(path, name)\r\n }\r\n if (node.imports) {\r\n // \u627E\u5230\u6709\u5B50\u6587\u4EF6\u4E86,\u5FAA\u73AF\u5B83\r\n for (let index = 0; index < node.imports.length; index++) {\r\n const element = node.imports[index]\r\n // debug('\u4F9D\u8D56\u6587\u4EF6: ', element)\r\n // \u5982\u679C\u6587\u4EF6\u5B58\u5728\r\n if (fs.existsSync(path)) {\r\n // \u7EE7\u7EED\u9012\u5F52,\u76F4\u5230\u5B50\u6587\u4EF6\u6CA1\u6709\u5B50\u6587\u4EF6\r\n await markWriteFile(nodes, name, element)\r\n } else {\r\n logger.error( `${path}\u6587\u4EF6\u4E0D\u5B58\u5728`, )\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @desc: \u529F\u80FD\u5C31\u662F\u627E\u5230\u6587\u4EF6\u7136\u540Ecopy\u6587\u4EF6,\r\n * @author: majun\r\n * @param {string} pathN\r\n * @param {string} name\r\n * @param {string} rootPath\r\n */\r\nexport async function setDispFileNew(pathN: string, name: string) {\r\n const relative = pathN.replace(rootPath, '')\r\n const originPath = pathN\r\n const writeFileName = rootPath + '/' + name + relative\r\n try {\r\n if (fs.existsSync(writeFileName)) return // \u5982\u679C\u6587\u4EF6\u90FD\u5B58\u5728\u90A3\u7B97\u4E86\r\n await fs.copy(originPath, writeFileName)\r\n debug('\u5199\u5165\u6587\u4EF6success! : ', writeFileName)\r\n } catch (err) {\r\n console.error(err)\r\n }\r\n}\r\n", "import fs from 'fs'\r\nimport createDebugger from 'debug'\r\nimport logger from '../shared/logger'\r\nimport path from 'path'\r\nconst debug = createDebugger('get-file')\r\ndebug.enabled = false\r\nconst rootPath = process.cwd().replace(/\\\\/g, '/')\r\n\r\n/**\r\n * @desc: \u9012\u5F52\u83B7\u53D6\u8DEF\u7531\u6570\u7EC4\r\n * @author: majun\r\n */\r\nexport function getRouterFilePath() {\r\n const dir = rootPath + '/router'\r\n let routes: any[] = []\r\n function finder(p: string) {\r\n let files = fs.readdirSync(p)\r\n files.forEach((val) => {\r\n let fPath = path.join(p, val).replace(/\\\\/g, '/')\r\n let stats = fs.statSync(fPath)\r\n if (stats.isDirectory()) finder(fPath)\r\n if (stats.isFile()) routes.push(fPath)\r\n })\r\n }\r\n finder(dir)\r\n return routes\r\n}\r\n\r\n/**\r\n * @desc: \u83B7\u53D6\u6240\u6709\u8DEF\u7531\r\n * @author: majun\r\n */\r\nexport function getAllRouter() {\r\n const arrs = getRouterFilePath()\r\n const routers: { path: string; component: string; }[] = []\r\n for (let index = 0; index < arrs.length; index++) {\r\n const p = arrs[index]\r\n let itemArrs = getRouter(p)\r\n routers.push(...itemArrs)\r\n }\r\n return routers\r\n}\r\n/**\r\n * @desc: \u5F97\u5230\u8DEF\u7531\r\n * @author: majun\r\n */\r\nexport function getRouter(routerPath:string) {\r\n let routers = []\r\n let path = ''\r\n if (fs.existsSync(routerPath)) {\r\n const str = fs.readFileSync(routerPath, 'utf-8')\r\n const sarrs = str.split(/[\\n]/g)\r\n for (let index = 0; index < sarrs.length; index++) {\r\n const st = sarrs[index]\r\n if (st.indexOf('//') > -1) continue // \u6253\u4E86\u6CE8\u91CA\u7684\u4E0D\u8981\r\n // path: '/form/base-form' \u5339\u914D\u8FD9\u6837\u5B50\u7684path\r\n const pathReg = /path: [\\'|\\\"](.*)[\\'|\\\"]/\r\n const pathStrs = st.match(pathReg)\r\n if (pathStrs) {\r\n path = pathStrs[1]\r\n }\r\n // \u7528\u6B63\u5219\u5339\u914D\u51FA\u6240\u6709 component: () => import( )\u4E2D\u7684\u7EC4\u4EF6\r\n const reg = /component: \\(\\) => import\\([\\'|\\\"](.*)[\\'|\\\"]\\)/\r\n const impStr = st.match(reg)\r\n if (impStr) {\r\n routers.push({\r\n path,\r\n component: impStr[1]\r\n })\r\n debug(impStr[1])\r\n }\r\n }\r\n }\r\n return routers\r\n}\r\n\r\n/**\r\n * @desc: \u83B7\u53D6\u8981\u64CD\u4F5C\u7684\u8DEF\u7531\r\n * @author: majun\r\n */\r\nexport function getRouterArrs() {\r\n let pathName = rootPath + '/classify.js'\r\n let routers = null\r\n if (fs.existsSync(pathName)) {\r\n routers = require(pathName)\r\n } else {\r\n // \u5982\u679C\u6CA1\u6709classify,\u90A3\u4E48\u76F4\u63A5\u627E\u8DEF\u7531\r\n routers = [\r\n {\r\n name: 'plan',\r\n router: getAllRouter()\r\n }\r\n ]\r\n }\r\n if (!routers) {\r\n logger.error('\u8DDF\u8DEF\u5F84\u6CA1\u53D1\u73B0\u6709classify.js,\u5E76\u4E14src\u91CC\u9762\u6CA1\u6709router\u6587\u4EF6, \u73B0\u5728\u9000\u51FA')\r\n process.exit(1)\r\n }\r\n return routers\r\n}\r\n", "/* \u89E3\u6790package */\r\nimport { name, version } from '../../package.json';\r\n\r\nexport const CWD = process.cwd();\r\n\r\nexport const VERSION = version;\r\n\r\nexport const PKG_NAME = name;\r\n"],
5
+ "mappings": ";quBAAA,cAMA,oBAA6B,MAAM,CAQjC,YAAY,EAAU,EAAM,EAAS,CACnC,MAAM,CAAO,EAEb,MAAM,kBAAkB,KAAM,KAAK,WAAW,EAC9C,KAAK,KAAO,KAAK,YAAY,KAC7B,KAAK,KAAO,EACZ,KAAK,SAAW,EAChB,KAAK,YAAc,MACrB,CACF,EAMA,gBAAmC,GAAe,CAMhD,YAAY,EAAS,CACnB,MAAM,EAAG,4BAA6B,CAAO,EAE7C,MAAM,kBAAkB,KAAM,KAAK,WAAW,EAC9C,KAAK,KAAO,KAAK,YAAY,IAC/B,CACF,EAEA,GAAQ,eAAiB,GACzB,GAAQ,qBAAuB,KC5C/B,iBAAM,CAAE,yBAAyB,KAIjC,QAAe,CAUb,YAAY,EAAM,EAAa,CAQ7B,OAPA,KAAK,YAAc,GAAe,GAClC,KAAK,SAAW,GAChB,KAAK,SAAW,OAChB,KAAK,aAAe,OACpB,KAAK,wBAA0B,OAC/B,KAAK,WAAa,OAEV,EAAK,QACN,IACH,KAAK,SAAW,GAChB,KAAK,MAAQ,EAAK,MAAM,EAAG,EAAE,EAC7B,UACG,IACH,KAAK,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