Skip to content

Commit

Permalink
Use basic types in JSDoc rather than object types (#1178)
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowspawn authored Feb 10, 2020
1 parent 28b649d commit 31f1878
Showing 1 changed file with 57 additions and 57 deletions.
114 changes: 57 additions & 57 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class Option {
/**
* Initialize a new `Option` with the given `flags` and `description`.
*
* @param {String} flags
* @param {String} description
* @param {string} flags
* @param {string} description
* @api public
*/

Expand All @@ -31,7 +31,7 @@ class Option {
/**
* Return option name.
*
* @return {String}
* @return {string}
* @api private
*/

Expand All @@ -43,7 +43,7 @@ class Option {
* Return option name, in a camelcase format that can be used
* as a object attribute key.
*
* @return {String}
* @return {string}
* @api private
*/

Expand All @@ -54,8 +54,8 @@ class Option {
/**
* Check if `arg` matches the short or long flag.
*
* @param {String} arg
* @return {Boolean}
* @param {string} arg
* @return {boolean}
* @api private
*/

Expand All @@ -71,9 +71,9 @@ class Option {
class CommanderError extends Error {
/**
* Constructs the CommanderError class
* @param {Number} exitCode suggested exit code which could be used with process.exit
* @param {String} code an id string representing the error
* @param {String} message human-readable description of the error
* @param {number} exitCode suggested exit code which could be used with process.exit
* @param {string} code an id string representing the error
* @param {string} message human-readable description of the error
* @constructor
*/
constructor(exitCode, code, message) {
Expand All @@ -90,7 +90,7 @@ class Command extends EventEmitter {
/**
* Initialize a new `Command`.
*
* @param {String} [name]
* @param {string} [name]
* @api public
*/

Expand Down Expand Up @@ -335,9 +335,9 @@ class Command extends EventEmitter {
/**
* Call process.exit, and _exitCallback if defined.
*
* @param {Number} exitCode exit code for using with process.exit
* @param {String} code an id string representing the error
* @param {String} message human-readable description of the error
* @param {number} exitCode exit code for using with process.exit
* @param {string} code an id string representing the error
* @param {string} message human-readable description of the error
* @return never
* @api private
*/
Expand Down Expand Up @@ -398,8 +398,8 @@ class Command extends EventEmitter {
* Internal implementation shared by .option() and .requiredOption()
*
* @param {Object} config
* @param {String} flags
* @param {String} description
* @param {string} flags
* @param {string} description
* @param {Function|*} [fn] - custom option processing function or default vaue
* @param {*} [defaultValue]
* @return {Command} for chaining
Expand Down Expand Up @@ -516,8 +516,8 @@ class Command extends EventEmitter {
* // optional argument
* program.option('-c, --cheese [type]', 'add cheese [marble]');
*
* @param {String} flags
* @param {String} description
* @param {string} flags
* @param {string} description
* @param {Function|*} [fn] - custom option processing function or default vaue
* @param {*} [defaultValue]
* @return {Command} for chaining
Expand All @@ -534,8 +534,8 @@ class Command extends EventEmitter {
*
* The `flags` string should contain both the short and long flags, separated by comma, a pipe or space.
*
* @param {String} flags
* @param {String} description
* @param {string} flags
* @param {string} description
* @param {Function|*} [fn] - custom option processing function or default vaue
* @param {*} [defaultValue]
* @return {Command} for chaining
Expand All @@ -549,7 +549,7 @@ class Command extends EventEmitter {
/**
* Allow unknown options on the command line.
*
* @param {Boolean} arg if `true` or omitted, no error will be thrown
* @param {Boolean} [arg] - if `true` or omitted, no error will be thrown
* for unknown options.
* @api public
*/
Expand Down Expand Up @@ -592,7 +592,7 @@ class Command extends EventEmitter {
/**
* Store option value
*
* @param {String} key
* @param {string} key
* @param {Object} value
* @api private
*/
Expand All @@ -608,7 +608,7 @@ class Command extends EventEmitter {
/**
* Retrieve option value
*
* @param {String} key
* @param {string} key
* @return {Object} value
* @api private
*/
Expand Down Expand Up @@ -910,7 +910,7 @@ class Command extends EventEmitter {
/**
* Return an option matching `arg` if any.
*
* @param {String} arg
* @param {string} arg
* @return {Option}
* @api private
*/
Expand Down Expand Up @@ -1060,7 +1060,7 @@ class Command extends EventEmitter {
/**
* Argument `name` is missing.
*
* @param {String} name
* @param {string} name
* @api private
*/

Expand All @@ -1074,7 +1074,7 @@ class Command extends EventEmitter {
* `Option` is missing an argument, but received `flag` or nothing.
*
* @param {Option} option
* @param {String} [flag]
* @param {string} [flag]
* @api private
*/

Expand Down Expand Up @@ -1105,7 +1105,7 @@ class Command extends EventEmitter {
/**
* Unknown option `flag`.
*
* @param {String} flag
* @param {string} flag
* @api private
*/

Expand All @@ -1119,7 +1119,7 @@ class Command extends EventEmitter {
/**
* Unknown command.
*
* @param {String} flag
* @param {string} flag
* @api private
*/

Expand All @@ -1142,9 +1142,9 @@ class Command extends EventEmitter {
*
* You can optionally supply the flags and description to override the defaults.
*
* @param {String} str
* @param {String} [flags]
* @param {String} [description]
* @param {string} str
* @param {string} [flags]
* @param {string} [description]
* @return {Command} for chaining
* @api public
*/
Expand All @@ -1167,7 +1167,7 @@ class Command extends EventEmitter {
/**
* Set the description to `str`.
*
* @param {String} str
* @param {string} str
* @param {Object} [argsDescription]
* @return {String|Command}
* @api public
Expand All @@ -1183,7 +1183,7 @@ class Command extends EventEmitter {
/**
* Set an alias for the command
*
* @param {String} alias
* @param {string} alias
* @return {String|Command}
* @api public
*/
Expand All @@ -1205,7 +1205,7 @@ class Command extends EventEmitter {
/**
* Set / get the command usage `str`.
*
* @param {String} [str]
* @param {string} [str]
* @return {String|Command}
* @api public
*/
Expand All @@ -1228,7 +1228,7 @@ class Command extends EventEmitter {
/**
* Get or set the name of the command
*
* @param {String} [str]
* @param {string} [str]
* @return {String|Command}
* @api public
*/
Expand Down Expand Up @@ -1272,7 +1272,7 @@ class Command extends EventEmitter {
/**
* Return the largest command length.
*
* @return {Number}
* @return {number}
* @api private
*/

Expand All @@ -1286,7 +1286,7 @@ class Command extends EventEmitter {
/**
* Return the largest option length.
*
* @return {Number}
* @return {number}
* @api private
*/

Expand All @@ -1304,7 +1304,7 @@ class Command extends EventEmitter {
/**
* Return the largest arg length.
*
* @return {Number}
* @return {number}
* @api private
*/

Expand All @@ -1317,7 +1317,7 @@ class Command extends EventEmitter {
/**
* Return the pad width.
*
* @return {Number}
* @return {number}
* @api private
*/

Expand All @@ -1341,7 +1341,7 @@ class Command extends EventEmitter {
/**
* Return help for options.
*
* @return {String}
* @return {string}
* @api private
*/

Expand All @@ -1363,7 +1363,7 @@ class Command extends EventEmitter {
/**
* Return command help documentation.
*
* @return {String}
* @return {string}
* @api private
*/

Expand All @@ -1389,7 +1389,7 @@ class Command extends EventEmitter {
/**
* Return program help documentation.
*
* @return {String}
* @return {string}
* @api public
*/

Expand Down Expand Up @@ -1472,8 +1472,8 @@ class Command extends EventEmitter {
* You can pass in flags and a description to override the help
* flags and help description for your command.
*
* @param {String} [flags]
* @param {String} [description]
* @param {string} [flags]
* @param {string} [description]
* @return {Command}
* @api public
*/
Expand Down Expand Up @@ -1535,8 +1535,8 @@ exports.CommanderError = CommanderError;
/**
* Camel-case the given `flag`
*
* @param {String} flag
* @return {String}
* @param {string} flag
* @return {string}
* @api private
*/

Expand All @@ -1549,9 +1549,9 @@ function camelcase(flag) {
/**
* Pad `str` to `width`.
*
* @param {String} str
* @param {Number} width
* @return {String}
* @param {string} str
* @param {number} width
* @return {string}
* @api private
*/

Expand All @@ -1564,10 +1564,10 @@ function pad(str, width) {
* Wraps the given string with line breaks at the specified width while breaking
* words and indenting every but the first line on the left.
*
* @param {String} str
* @param {Number} width
* @param {Number} indent
* @return {String}
* @param {string} str
* @param {number} width
* @param {number} indent
* @return {string}
* @api private
*/
function wrap(str, width, indent) {
Expand All @@ -1586,10 +1586,10 @@ function wrap(str, width, indent) {
* while indenting with indent spaces. Do not wrap if insufficient width or
* string is manually formatted.
*
* @param {String} str
* @param {Number} width
* @param {Number} indent
* @return {String}
* @param {string} str
* @param {number} width
* @param {number} indent
* @return {string}
* @api private
*/
function optionalWrap(str, width, indent) {
Expand Down Expand Up @@ -1624,7 +1624,7 @@ function outputHelpIfRequested(cmd, args) {
* Takes an argument and returns its human readable equivalent for help usage.
*
* @param {Object} arg
* @return {String}
* @return {string}
* @api private
*/

Expand Down

0 comments on commit 31f1878

Please sign in to comment.