Skip to content

Commit

Permalink
feat: to allow both undefined and nulls, for benefit of TypeScript (#945
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mike-weshop authored and bcoe committed Sep 3, 2017
1 parent 71c7ec7 commit 792564d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yargs.js
Expand Up @@ -384,7 +384,7 @@ function Yargs (processArgs, cwd, parentRequire) {
}

self.demandCommand = function demandCommand (min, max, minMsg, maxMsg) {
argsert('[number] [number|string] [string|null] [string|null]', [min, max, minMsg, maxMsg], arguments.length)
argsert('[number] [number|string] [string|null|undefined] [string|null|undefined]', [min, max, minMsg, maxMsg], arguments.length)

if (typeof min === 'undefined') min = 1

Expand Down Expand Up @@ -428,7 +428,7 @@ function Yargs (processArgs, cwd, parentRequire) {
}

self.usage = function (msg, opts) {
argsert('<string|null|object> [object]', [msg, opts], arguments.length)
argsert('<string|null|undefined|object> [object]', [msg, opts], arguments.length)

if (!opts && typeof msg === 'object') {
opts = msg
Expand Down Expand Up @@ -685,7 +685,7 @@ function Yargs (processArgs, cwd, parentRequire) {
}

self.wrap = function (cols) {
argsert('<number|null>', [cols], arguments.length)
argsert('<number|null|undefined>', [cols], arguments.length)
usage.wrap(cols)
return self
}
Expand Down

0 comments on commit 792564d

Please sign in to comment.