Comparing version 17.4.1 to 17.5.0
@@ -73,3 +73,3 @@ import { isCommandBuilderCallback } from './command.js'; | ||
!options.hiddenOptions.includes(key) && | ||
!this.argsContainKey(args, argv, key, negable)) { | ||
!this.argsContainKey(args, key, negable)) { | ||
this.completeOptionKey(key, completions, current); | ||
@@ -143,10 +143,11 @@ if (negable && !!options.default[key]) | ||
} | ||
argsContainKey(args, argv, key, negable) { | ||
if (args.indexOf(`--${key}`) !== -1) | ||
argsContainKey(args, key, negable) { | ||
const argsContains = (s) => args.indexOf((/^[^0-9]$/.test(s) ? '-' : '--') + s) !== -1; | ||
if (argsContains(key)) | ||
return true; | ||
if (negable && args.indexOf(`--no-${key}`) !== -1) | ||
if (negable && argsContains(`no-${key}`)) | ||
return true; | ||
if (this.aliases) { | ||
for (const alias of this.aliases[key]) { | ||
if (argv[alias] !== undefined) | ||
if (argsContains(alias)) | ||
return true; | ||
@@ -153,0 +154,0 @@ } |
@@ -5,4 +5,6 @@ export class YError extends Error { | ||
this.name = 'YError'; | ||
Error.captureStackTrace(this, YError); | ||
if (Error.captureStackTrace) { | ||
Error.captureStackTrace(this, YError); | ||
} | ||
} | ||
} |
{ | ||
"name": "yargs", | ||
"version": "17.4.1", | ||
"version": "17.5.0", | ||
"description": "yargs the modern, pirate-themed, successor to optimist.", | ||
@@ -19,4 +19,9 @@ "main": "./index.cjs", | ||
}, | ||
"./browser": { | ||
"import": "./browser.mjs", | ||
"types": "./browser.d.ts" | ||
}, | ||
"./yargs": [ | ||
{ | ||
"import": "./yargs.mjs", | ||
"require": "./yargs" | ||
@@ -23,0 +28,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
285059
5152