Skip to content

Commit

Permalink
Use @Package instead of @api private in JSDoc
Browse files Browse the repository at this point in the history
Fixes tj#1949
  • Loading branch information
aweebit committed Aug 17, 2023
1 parent 71d0966 commit cd4338b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
4 changes: 2 additions & 2 deletions lib/argument.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Argument {
}

/**
* @api private
* @package
*/

_concatValue(value, previous) {
Expand Down Expand Up @@ -131,7 +131,7 @@ class Argument {
*
* @param {Argument} arg
* @return {string}
* @api private
* @package
*/

function humanReadableArgName(arg) {
Expand Down
62 changes: 31 additions & 31 deletions lib/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ class Command extends EventEmitter {

/**
* @return {boolean}
* @api private
* @package
*/

_hasImplicitHelpCommand() {
Expand Down Expand Up @@ -443,7 +443,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
* @param {string} code an id string representing the error
* @param {string} message human-readable description of the error
* @return never
* @api private
* @package
*/

_exit(exitCode, code, message) {
Expand Down Expand Up @@ -581,7 +581,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
/**
* Internal implementation shared by .option() and .requiredOption()
*
* @api private
* @package
*/
_optionEx(config, flags, description, fn, defaultValue) {
if (typeof flags === 'object' && flags instanceof Option) {
Expand Down Expand Up @@ -839,7 +839,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
* Get user arguments from implied or explicit arguments.
* Side-effects: set _scriptPath if args included script. Used for default program name, and subcommand searches.
*
* @api private
* @package
*/

_prepareUserArgs(argv, parseOptions) {
Expand Down Expand Up @@ -942,7 +942,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
/**
* Execute a sub-command executable.
*
* @api private
* @package
*/

_executeSubCommand(subcommand, args) {
Expand Down Expand Up @@ -1067,7 +1067,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
}

/**
* @api private
* @package
*/

_dispatchSubcommand(commandName, operands, unknown) {
Expand All @@ -1090,7 +1090,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
* Invoke help directly if possible, or dispatch if necessary.
* e.g. help foo
*
* @api private
* @package
*/

_dispatchHelpCommand(subcommandName) {
Expand All @@ -1109,7 +1109,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
/**
* Check this.args against expected this._args.
*
* @api private
* @package
*/

_checkNumberOfArguments() {
Expand All @@ -1131,7 +1131,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
/**
* Process this.args using this._args and save as this.processedArgs!
*
* @api private
* @package
*/

_processArguments() {
Expand Down Expand Up @@ -1186,7 +1186,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
* @param {Promise|undefined} promise
* @param {Function} fn
* @return {Promise|undefined}
* @api private
* @package
*/

_chainOrCall(promise, fn) {
Expand All @@ -1204,7 +1204,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
* @param {Promise|undefined} promise
* @param {string} event
* @return {Promise|undefined}
* @api private
* @package
*/

_chainOrCallHooks(promise, event) {
Expand Down Expand Up @@ -1236,7 +1236,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
* @param {Command} subCommand
* @param {string} event
* @return {Promise|undefined}
* @api private
* @package
*/

_chainOrCallSubCommandHook(promise, subCommand, event) {
Expand All @@ -1255,7 +1255,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
* Process arguments in context of this command.
* Returns action result, in case it is a promise.
*
* @api private
* @package
*/

_parseCommand(operands, unknown) {
Expand Down Expand Up @@ -1341,7 +1341,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
/**
* Find matching command.
*
* @api private
* @package
*/
_findCommand(name) {
if (!name) return undefined;
Expand All @@ -1353,7 +1353,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
*
* @param {string} arg
* @return {Option | undefined}
* @api private
* @package
*/

_findOption(arg) {
Expand All @@ -1364,7 +1364,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
* Display an error message if a mandatory option does not have a value.
* Called after checking for help flags in leaf subcommand.
*
* @api private
* @package
*/

_checkForMissingMandatoryOptions() {
Expand All @@ -1381,7 +1381,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
/**
* Display an error message if conflicting options are used together in this.
*
* @api private
* @package
*/
_checkForConflictingLocalOptions() {
const definedNonDefaultOptions = this.options.filter(
Expand Down Expand Up @@ -1412,7 +1412,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
* Display an error message if conflicting options are used together.
* Called after checking for help flags in leaf subcommand.
*
* @api private
* @package
*/
_checkForConflictingOptions() {
// Walk up hierarchy so can call in subcommand after checking for displaying help.
Expand Down Expand Up @@ -1616,7 +1616,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
* Apply any option related environment variables, if option does
* not have a value from cli or client code.
*
* @api private
* @package
*/
_parseOptionsEnv() {
this.options.forEach((option) => {
Expand All @@ -1643,7 +1643,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
/**
* Apply any implied option values, if option is undefined or default value.
*
* @api private
* @package
*/
_parseOptionsImplied() {
const dualHelper = new DualOptions(this.options);
Expand Down Expand Up @@ -1671,7 +1671,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
* Argument `name` is missing.
*
* @param {string} name
* @api private
* @package
*/

missingArgument(name) {
Expand All @@ -1683,7 +1683,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
* `Option` is missing an argument.
*
* @param {Option} option
* @api private
* @package
*/

optionMissingArgument(option) {
Expand All @@ -1695,7 +1695,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
* `Option` does not have a value, and is a mandatory option.
*
* @param {Option} option
* @api private
* @package
*/

missingMandatoryOptionValue(option) {
Expand All @@ -1708,7 +1708,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
*
* @param {Option} option
* @param {Option} conflictingOption
* @api private
* @package
*/
_conflictingOption(option, conflictingOption) {
// The calling code does not know whether a negated option is the source of the
Expand Down Expand Up @@ -1745,7 +1745,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
* Unknown option `flag`.
*
* @param {string} flag
* @api private
* @package
*/

unknownOption(flag) {
Expand Down Expand Up @@ -1774,7 +1774,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
* Excess arguments, more than expected.
*
* @param {string[]} receivedArgs
* @api private
* @package
*/

_excessArguments(receivedArgs) {
Expand All @@ -1790,7 +1790,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
/**
* Unknown command.
*
* @api private
* @package
*/

unknownCommand() {
Expand Down Expand Up @@ -2003,7 +2003,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
}

/**
* @api private
* @package
*/

_getHelpContext(contextOptions) {
Expand Down Expand Up @@ -2134,7 +2134,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
*
* @param {Command} cmd - command to output help for
* @param {Array} args - array of options to search for help flags
* @api private
* @package
*/

function outputHelpIfRequested(cmd, args) {
Expand All @@ -2151,7 +2151,7 @@ function outputHelpIfRequested(cmd, args) {
*
* @param {string[]} args - array of arguments from node.execArgv
* @returns {string[]}
* @api private
* @package
*/

function incrementNodeInspectorPort(args) {
Expand Down Expand Up @@ -2196,7 +2196,7 @@ function incrementNodeInspectorPort(args) {
/**
* @param {Command} startCommand
* @returns {Command[]}
* @api private
* @package
*/

function getCommandAndParents(startCommand) {
Expand Down
12 changes: 6 additions & 6 deletions lib/option.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class Option {
}

/**
* @api private
* @package
*/

_concatValue(value, previous) {
Expand Down Expand Up @@ -209,7 +209,7 @@ class Option {
* as a object attribute key.
*
* @return {string}
* @api private
* @package
*/

attributeName() {
Expand All @@ -221,7 +221,7 @@ class Option {
*
* @param {string} arg
* @return {boolean}
* @api private
* @package
*/

is(arg) {
Expand All @@ -234,7 +234,7 @@ class Option {
* Options are one of boolean, negated, required argument, or optional argument.
*
* @return {boolean}
* @api private
* @package
*/

isBoolean() {
Expand Down Expand Up @@ -294,7 +294,7 @@ class DualOptions {
*
* @param {string} str
* @return {string}
* @api private
* @package
*/

function camelcase(str) {
Expand All @@ -306,7 +306,7 @@ function camelcase(str) {
/**
* Split the short and long flag out of something like '-m,--mixed <value>'
*
* @api private
* @package
*/

function splitOptionFlags(flags) {
Expand Down

0 comments on commit cd4338b

Please sign in to comment.