id
int64
0
3.78k
code
stringlengths
13
37.9k
declarations
stringlengths
16
64.6k
2,800
setParsed(parsed: DetailedArguments) { this.aliases = parsed.aliases; }
interface DetailedArguments extends ParserDetailedArguments { argv: Arguments; aliases: Dictionary<string[]>; }
2,801
setParsed(parsed: DetailedArguments) { this.aliases = parsed.aliases; }
interface DetailedArguments { /** An object representing the parsed value of `args` */ argv: Arguments; /** Populated with an error object if an exception occurred during parsing. */ error: Error | null; /** The inferred list of aliases built by combining lists in opts.alias. */ aliases: Dictionary<string[]...
2,802
function completion( yargs: YargsInstance, usage: UsageInstance, command: CommandInstance, shim: PlatformShim ): CompletionInstance { return new Completion(yargs, usage, command, shim); }
class CommandInstance { shim: PlatformShim; requireCache: Set<string> = new Set(); handlers: Dictionary<CommandHandler> = {}; aliasMap: Dictionary<string> = {}; defaultCommand?: CommandHandler; usage: UsageInstance; globalMiddleware: GlobalMiddleware; validation: ValidationInstance; // Used to cache s...
2,803
function completion( yargs: YargsInstance, usage: UsageInstance, command: CommandInstance, shim: PlatformShim ): CompletionInstance { return new Completion(yargs, usage, command, shim); }
interface UsageInstance { cacheHelpMessage(): void; clearCachedHelpMessage(): void; hasCachedHelpMessage(): boolean; command( cmd: string, description: string | undefined, isDefault: boolean, aliases: string[], deprecated?: boolean ): void; deferY18nLookup(str: string): string; describ...
2,804
function completion( yargs: YargsInstance, usage: UsageInstance, command: CommandInstance, shim: PlatformShim ): CompletionInstance { return new Completion(yargs, usage, command, shim); }
interface PlatformShim { cwd: Function; format: Function; normalize: Function; require: Function; resolve: Function; env: Function; }
2,805
function completion( yargs: YargsInstance, usage: UsageInstance, command: CommandInstance, shim: PlatformShim ): CompletionInstance { return new Completion(yargs, usage, command, shim); }
interface PlatformShim { assert: { notStrictEqual: ( expected: any, observed: any, message?: string | Error ) => void; strictEqual: ( expected: any, observed: any, message?: string | Error ) => void; }; findUp: ( startDir: string, fn: (dir: string[], nam...
2,806
function completion( yargs: YargsInstance, usage: UsageInstance, command: CommandInstance, shim: PlatformShim ): CompletionInstance { return new Completion(yargs, usage, command, shim); }
class YargsInstance { $0: string; argv?: Arguments; customScriptName = false; parsed: DetailedArguments | false = false; #command: CommandInstance; #cwd: string; // use context object to keep track of resets, subcommand execution, etc., // submodules should modify and check the state of context as nece...
2,807
(onCompleted?: CompletionCallback) => any
type CompletionCallback = ( err: Error | null, completions: string[] | undefined ) => void;
2,808
function isSyncCompletionFunction( completionFunction: CompletionFunction ): completionFunction is SyncCompletionFunction { return completionFunction.length < 3; }
type CompletionFunction = | SyncCompletionFunction | AsyncCompletionFunction | FallbackCompletionFunction;
2,809
function isFallbackCompletionFunction( completionFunction: CompletionFunction ): completionFunction is FallbackCompletionFunction { return completionFunction.length > 3; }
type CompletionFunction = | SyncCompletionFunction | AsyncCompletionFunction | FallbackCompletionFunction;
2,810
constructor(yargs: YargsInstance) { this.yargs = yargs; }
class YargsInstance { $0: string; argv?: Arguments; customScriptName = false; parsed: DetailedArguments | false = false; #command: CommandInstance; #cwd: string; // use context object to keep track of resets, subcommand execution, etc., // submodules should modify and check the state of context as nece...
2,811
addCoerceMiddleware( callback: MiddlewareCallback, option: string ): YargsInstance { const aliases = this.yargs.getAliases(); this.globalMiddleware = this.globalMiddleware.filter(m => { const toCheck = [...(aliases[option] || []), option]; if (!m.option) return true; else return !toC...
interface MiddlewareCallback { (argv: Arguments, yargs: YargsInstance): | Partial<Arguments> | Promise<Partial<Arguments>>; }
2,812
(argv: Arguments, yargs: YargsInstance): | Partial<Arguments> | Promise<Partial<Arguments>>
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,813
(argv: Arguments, yargs: YargsInstance): | Partial<Arguments> | Promise<Partial<Arguments>>
interface Arguments { /** The script name or node command */ $0: string; /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,814
(argv: Arguments, yargs: YargsInstance): | Partial<Arguments> | Promise<Partial<Arguments>>
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,815
(argv: Arguments, yargs: YargsInstance): | Partial<Arguments> | Promise<Partial<Arguments>>
class YargsInstance { $0: string; argv?: Arguments; customScriptName = false; parsed: DetailedArguments | false = false; #command: CommandInstance; #cwd: string; // use context object to keep track of resets, subcommand execution, etc., // submodules should modify and check the state of context as nece...
2,816
function usage(yargs: YargsInstance, shim: PlatformShim) { const __ = shim.y18n.__; const self = {} as UsageInstance; // methods for ouputting/building failure message. const fails: (FailureFunction | boolean)[] = []; self.failFn = function failFn(f) { fails.push(f); }; let failMessage: string | nil ...
interface PlatformShim { cwd: Function; format: Function; normalize: Function; require: Function; resolve: Function; env: Function; }
2,817
function usage(yargs: YargsInstance, shim: PlatformShim) { const __ = shim.y18n.__; const self = {} as UsageInstance; // methods for ouputting/building failure message. const fails: (FailureFunction | boolean)[] = []; self.failFn = function failFn(f) { fails.push(f); }; let failMessage: string | nil ...
interface PlatformShim { assert: { notStrictEqual: ( expected: any, observed: any, message?: string | Error ) => void; strictEqual: ( expected: any, observed: any, message?: string | Error ) => void; }; findUp: ( startDir: string, fn: (dir: string[], nam...
2,818
function usage(yargs: YargsInstance, shim: PlatformShim) { const __ = shim.y18n.__; const self = {} as UsageInstance; // methods for ouputting/building failure message. const fails: (FailureFunction | boolean)[] = []; self.failFn = function failFn(f) { fails.push(f); }; let failMessage: string | nil ...
class YargsInstance { $0: string; argv?: Arguments; customScriptName = false; parsed: DetailedArguments | false = false; #command: CommandInstance; #cwd: string; // use context object to keep track of resets, subcommand execution, etc., // submodules should modify and check the state of context as nece...
2,819
constructor( usage: UsageInstance, validation: ValidationInstance, globalMiddleware: GlobalMiddleware, shim: PlatformShim ) { this.shim = shim; this.usage = usage; this.globalMiddleware = globalMiddleware; this.validation = validation; }
class GlobalMiddleware { globalMiddleware: Middleware[] = []; yargs: YargsInstance; frozens: Array<Middleware[]> = []; constructor(yargs: YargsInstance) { this.yargs = yargs; } addMiddleware( callback: MiddlewareCallback | MiddlewareCallback[], applyBeforeValidation: boolean, global = true, ...
2,820
constructor( usage: UsageInstance, validation: ValidationInstance, globalMiddleware: GlobalMiddleware, shim: PlatformShim ) { this.shim = shim; this.usage = usage; this.globalMiddleware = globalMiddleware; this.validation = validation; }
interface ValidationInstance { conflicting(argv: Arguments): void; conflicts( key: string | Dictionary<string | string[]>, value?: string | string[] ): void; freeze(): void; getConflicting(): Dictionary<(string | undefined)[]>; getImplied(): Dictionary<KeyOrPos[]>; implications(argv: Arguments): v...
2,821
constructor( usage: UsageInstance, validation: ValidationInstance, globalMiddleware: GlobalMiddleware, shim: PlatformShim ) { this.shim = shim; this.usage = usage; this.globalMiddleware = globalMiddleware; this.validation = validation; }
interface UsageInstance { cacheHelpMessage(): void; clearCachedHelpMessage(): void; hasCachedHelpMessage(): boolean; command( cmd: string, description: string | undefined, isDefault: boolean, aliases: string[], deprecated?: boolean ): void; deferY18nLookup(str: string): string; describ...
2,822
constructor( usage: UsageInstance, validation: ValidationInstance, globalMiddleware: GlobalMiddleware, shim: PlatformShim ) { this.shim = shim; this.usage = usage; this.globalMiddleware = globalMiddleware; this.validation = validation; }
interface PlatformShim { cwd: Function; format: Function; normalize: Function; require: Function; resolve: Function; env: Function; }
2,823
constructor( usage: UsageInstance, validation: ValidationInstance, globalMiddleware: GlobalMiddleware, shim: PlatformShim ) { this.shim = shim; this.usage = usage; this.globalMiddleware = globalMiddleware; this.validation = validation; }
interface PlatformShim { assert: { notStrictEqual: ( expected: any, observed: any, message?: string | Error ) => void; strictEqual: ( expected: any, observed: any, message?: string | Error ) => void; }; findUp: ( startDir: string, fn: (dir: string[], nam...
2,824
private shouldUpdateUsage(yargs: YargsInstance) { return ( !yargs.getInternalMethods().getUsageInstance().getUsageDisabled() && yargs.getInternalMethods().getUsageInstance().getUsage().length === 0 ); }
class YargsInstance { $0: string; argv?: Arguments; customScriptName = false; parsed: DetailedArguments | false = false; #command: CommandInstance; #cwd: string; // use context object to keep track of resets, subcommand execution, etc., // submodules should modify and check the state of context as nece...
2,825
private populatePositionals( commandHandler: CommandHandler, argv: Arguments, context: Context, yargs: YargsInstance ) { argv._ = argv._.slice(context.commands.length); // nuke the current commands const demanded = commandHandler.demanded.slice(0); const optional = commandHandler.optional....
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,826
private populatePositionals( commandHandler: CommandHandler, argv: Arguments, context: Context, yargs: YargsInstance ) { argv._ = argv._.slice(context.commands.length); // nuke the current commands const demanded = commandHandler.demanded.slice(0); const optional = commandHandler.optional....
interface Arguments { /** The script name or node command */ $0: string; /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,827
private populatePositionals( commandHandler: CommandHandler, argv: Arguments, context: Context, yargs: YargsInstance ) { argv._ = argv._.slice(context.commands.length); // nuke the current commands const demanded = commandHandler.demanded.slice(0); const optional = commandHandler.optional....
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,828
private populatePositionals( commandHandler: CommandHandler, argv: Arguments, context: Context, yargs: YargsInstance ) { argv._ = argv._.slice(context.commands.length); // nuke the current commands const demanded = commandHandler.demanded.slice(0); const optional = commandHandler.optional....
interface CommandHandler { builder: CommandBuilder; demanded: Positional[]; deprecated?: boolean; description?: string | false; handler: CommandHandlerCallback; middlewares: Middleware[]; optional: Positional[]; original: string; }
2,829
private populatePositionals( commandHandler: CommandHandler, argv: Arguments, context: Context, yargs: YargsInstance ) { argv._ = argv._.slice(context.commands.length); // nuke the current commands const demanded = commandHandler.demanded.slice(0); const optional = commandHandler.optional....
class YargsInstance { $0: string; argv?: Arguments; customScriptName = false; parsed: DetailedArguments | false = false; #command: CommandInstance; #cwd: string; // use context object to keep track of resets, subcommand execution, etc., // submodules should modify and check the state of context as nece...
2,830
private populatePositionals( commandHandler: CommandHandler, argv: Arguments, context: Context, yargs: YargsInstance ) { argv._ = argv._.slice(context.commands.length); // nuke the current commands const demanded = commandHandler.demanded.slice(0); const optional = commandHandler.optional....
interface Context { commands: string[]; fullCommands: string[]; }
2,831
private populatePositional( positional: Positional, argv: Arguments, positionalMap: Dictionary<string[]> ) { const cmd = positional.cmd[0]; if (positional.variadic) { positionalMap[cmd] = argv._.splice(0).map(String); } else { if (argv._.length) positionalMap[cmd] = [String(argv._....
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,832
private populatePositional( positional: Positional, argv: Arguments, positionalMap: Dictionary<string[]> ) { const cmd = positional.cmd[0]; if (positional.variadic) { positionalMap[cmd] = argv._.splice(0).map(String); } else { if (argv._.length) positionalMap[cmd] = [String(argv._....
interface Arguments { /** The script name or node command */ $0: string; /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,833
private populatePositional( positional: Positional, argv: Arguments, positionalMap: Dictionary<string[]> ) { const cmd = positional.cmd[0]; if (positional.variadic) { positionalMap[cmd] = argv._.splice(0).map(String); } else { if (argv._.length) positionalMap[cmd] = [String(argv._....
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,834
private populatePositional( positional: Positional, argv: Arguments, positionalMap: Dictionary<string[]> ) { const cmd = positional.cmd[0]; if (positional.variadic) { positionalMap[cmd] = argv._.splice(0).map(String); } else { if (argv._.length) positionalMap[cmd] = [String(argv._....
interface Positional { cmd: NotEmptyArray<string>; variadic: boolean; }
2,835
private postProcessPositionals( argv: Arguments, positionalMap: Dictionary<string[]>, parseOptions: Positionals, yargs: YargsInstance ) { // combine the parsing hints we've inferred from the command // string with explicitly configured parsing hints. const options = Object.assign({}, yargs...
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,836
private postProcessPositionals( argv: Arguments, positionalMap: Dictionary<string[]>, parseOptions: Positionals, yargs: YargsInstance ) { // combine the parsing hints we've inferred from the command // string with explicitly configured parsing hints. const options = Object.assign({}, yargs...
interface Arguments { /** The script name or node command */ $0: string; /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,837
private postProcessPositionals( argv: Arguments, positionalMap: Dictionary<string[]>, parseOptions: Positionals, yargs: YargsInstance ) { // combine the parsing hints we've inferred from the command // string with explicitly configured parsing hints. const options = Object.assign({}, yargs...
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,838
private postProcessPositionals( argv: Arguments, positionalMap: Dictionary<string[]>, parseOptions: Positionals, yargs: YargsInstance ) { // combine the parsing hints we've inferred from the command // string with explicitly configured parsing hints. const options = Object.assign({}, yargs...
interface Positionals extends Pick<Options, 'alias' | 'array' | 'default'> { demand: Dictionary<boolean>; }
2,839
private postProcessPositionals( argv: Arguments, positionalMap: Dictionary<string[]>, parseOptions: Positionals, yargs: YargsInstance ) { // combine the parsing hints we've inferred from the command // string with explicitly configured parsing hints. const options = Object.assign({}, yargs...
class YargsInstance { $0: string; argv?: Arguments; customScriptName = false; parsed: DetailedArguments | false = false; #command: CommandInstance; #cwd: string; // use context object to keep track of resets, subcommand execution, etc., // submodules should modify and check the state of context as nece...
2,840
isDefaulted(yargs: YargsInstance, key: string): boolean { const {default: defaults} = yargs.getOptions(); return ( Object.prototype.hasOwnProperty.call(defaults, key) || Object.prototype.hasOwnProperty.call( defaults, this.shim.Parser.camelCase(key) ) ); }
class YargsInstance { $0: string; argv?: Arguments; customScriptName = false; parsed: DetailedArguments | false = false; #command: CommandInstance; #cwd: string; // use context object to keep track of resets, subcommand execution, etc., // submodules should modify and check the state of context as nece...
2,841
isInConfigs(yargs: YargsInstance, key: string): boolean { const {configObjects} = yargs.getOptions(); return ( configObjects.some(c => Object.prototype.hasOwnProperty.call(c, key)) || configObjects.some(c => Object.prototype.hasOwnProperty.call(c, this.shim.Parser.camelCase(key)) ) ...
class YargsInstance { $0: string; argv?: Arguments; customScriptName = false; parsed: DetailedArguments | false = false; #command: CommandInstance; #cwd: string; // use context object to keep track of resets, subcommand execution, etc., // submodules should modify and check the state of context as nece...
2,842
runDefaultBuilderOn(yargs: YargsInstance): unknown | Promise<unknown> { if (!this.defaultCommand) return; if (this.shouldUpdateUsage(yargs)) { // build the root-level command string from the default string. const commandString = DEFAULT_MARKER.test(this.defaultCommand.original) ? this.defaul...
class YargsInstance { $0: string; argv?: Arguments; customScriptName = false; parsed: DetailedArguments | false = false; #command: CommandInstance; #cwd: string; // use context object to keep track of resets, subcommand execution, etc., // submodules should modify and check the state of context as nece...
2,843
private moduleName(obj: CommandHandlerDefinition) { const mod = whichModule(obj); if (!mod) throw new Error( `No command name given for module: ${this.shim.inspect(obj)}` ); return this.commandFromFilename(mod.filename); }
interface CommandHandlerDefinition extends Partial< Pick< CommandHandler, 'deprecated' | 'description' | 'handler' | 'middlewares' > > { aliases?: string[]; builder?: CommandBuilder | CommandBuilderDefinition; command?: string | string[]; desc?: CommandHandler['description']; describe?...
2,844
private extractDesc({describe, description, desc}: CommandHandlerDefinition) { for (const test of [describe, description, desc]) { if (typeof test === 'string' || test === false) return test; assertNotStrictEqual(test, true as const, this.shim); } return false; }
interface CommandHandlerDefinition extends Partial< Pick< CommandHandler, 'deprecated' | 'description' | 'handler' | 'middlewares' > > { aliases?: string[]; builder?: CommandBuilder | CommandBuilderDefinition; command?: string | string[]; desc?: CommandHandler['description']; describe?...
2,845
function command( usage: UsageInstance, validation: ValidationInstance, globalMiddleware: GlobalMiddleware, shim: PlatformShim ) { return new CommandInstance(usage, validation, globalMiddleware, shim); }
class GlobalMiddleware { globalMiddleware: Middleware[] = []; yargs: YargsInstance; frozens: Array<Middleware[]> = []; constructor(yargs: YargsInstance) { this.yargs = yargs; } addMiddleware( callback: MiddlewareCallback | MiddlewareCallback[], applyBeforeValidation: boolean, global = true, ...
2,846
function command( usage: UsageInstance, validation: ValidationInstance, globalMiddleware: GlobalMiddleware, shim: PlatformShim ) { return new CommandInstance(usage, validation, globalMiddleware, shim); }
interface ValidationInstance { conflicting(argv: Arguments): void; conflicts( key: string | Dictionary<string | string[]>, value?: string | string[] ): void; freeze(): void; getConflicting(): Dictionary<(string | undefined)[]>; getImplied(): Dictionary<KeyOrPos[]>; implications(argv: Arguments): v...
2,847
function command( usage: UsageInstance, validation: ValidationInstance, globalMiddleware: GlobalMiddleware, shim: PlatformShim ) { return new CommandInstance(usage, validation, globalMiddleware, shim); }
interface UsageInstance { cacheHelpMessage(): void; clearCachedHelpMessage(): void; hasCachedHelpMessage(): boolean; command( cmd: string, description: string | undefined, isDefault: boolean, aliases: string[], deprecated?: boolean ): void; deferY18nLookup(str: string): string; describ...
2,848
function command( usage: UsageInstance, validation: ValidationInstance, globalMiddleware: GlobalMiddleware, shim: PlatformShim ) { return new CommandInstance(usage, validation, globalMiddleware, shim); }
interface PlatformShim { cwd: Function; format: Function; normalize: Function; require: Function; resolve: Function; env: Function; }
2,849
function command( usage: UsageInstance, validation: ValidationInstance, globalMiddleware: GlobalMiddleware, shim: PlatformShim ) { return new CommandInstance(usage, validation, globalMiddleware, shim); }
interface PlatformShim { assert: { notStrictEqual: ( expected: any, observed: any, message?: string | Error ) => void; strictEqual: ( expected: any, observed: any, message?: string | Error ) => void; }; findUp: ( startDir: string, fn: (dir: string[], nam...
2,850
(argv: Arguments): any
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,851
(argv: Arguments): any
interface Arguments { /** The script name or node command */ $0: string; /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,852
(argv: Arguments): any
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,853
(y: YargsInstance, helpOrVersionSet: boolean): YargsInstance | void
class YargsInstance { $0: string; argv?: Arguments; customScriptName = false; parsed: DetailedArguments | false = false; #command: CommandInstance; #cwd: string; // use context object to keep track of resets, subcommand execution, etc., // submodules should modify and check the state of context as nece...
2,854
function isCommandBuilderCallback( builder: CommandBuilder ): builder is CommandBuilderCallback { return typeof builder === 'function'; }
type CommandBuilder = | CommandBuilderCallback | Dictionary<OptionDefinition>;
2,855
function isCommandBuilderOptionDefinitions( builder: CommandBuilder ): builder is Dictionary<OptionDefinition> { return typeof builder === 'object'; }
type CommandBuilder = | CommandBuilderCallback | Dictionary<OptionDefinition>;
2,856
function validation( yargs: YargsInstance, usage: UsageInstance, shim: PlatformShim ) { const __ = shim.y18n.__; const __n = shim.y18n.__n; const self = {} as ValidationInstance; // validate appropriate # of non-option // arguments were provided, i.e., '_'. self.nonOptionCount = function nonOptionCou...
interface UsageInstance { cacheHelpMessage(): void; clearCachedHelpMessage(): void; hasCachedHelpMessage(): boolean; command( cmd: string, description: string | undefined, isDefault: boolean, aliases: string[], deprecated?: boolean ): void; deferY18nLookup(str: string): string; describ...
2,857
function validation( yargs: YargsInstance, usage: UsageInstance, shim: PlatformShim ) { const __ = shim.y18n.__; const __n = shim.y18n.__n; const self = {} as ValidationInstance; // validate appropriate # of non-option // arguments were provided, i.e., '_'. self.nonOptionCount = function nonOptionCou...
interface PlatformShim { cwd: Function; format: Function; normalize: Function; require: Function; resolve: Function; env: Function; }
2,858
function validation( yargs: YargsInstance, usage: UsageInstance, shim: PlatformShim ) { const __ = shim.y18n.__; const __n = shim.y18n.__n; const self = {} as ValidationInstance; // validate appropriate # of non-option // arguments were provided, i.e., '_'. self.nonOptionCount = function nonOptionCou...
interface PlatformShim { assert: { notStrictEqual: ( expected: any, observed: any, message?: string | Error ) => void; strictEqual: ( expected: any, observed: any, message?: string | Error ) => void; }; findUp: ( startDir: string, fn: (dir: string[], nam...
2,859
function validation( yargs: YargsInstance, usage: UsageInstance, shim: PlatformShim ) { const __ = shim.y18n.__; const __n = shim.y18n.__n; const self = {} as ValidationInstance; // validate appropriate # of non-option // arguments were provided, i.e., '_'. self.nonOptionCount = function nonOptionCou...
class YargsInstance { $0: string; argv?: Arguments; customScriptName = false; parsed: DetailedArguments | false = false; #command: CommandInstance; #cwd: string; // use context object to keep track of resets, subcommand execution, etc., // submodules should modify and check the state of context as nece...
2,860
function keyExists(argv: Arguments, val: any): any { // convert string '1' to number 1 const num = Number(val); val = isNaN(num) ? val : num; if (typeof val === 'number') { // check length of argv._ val = argv._.length >= val; } else if (val.match(/^--no-.+/)) { // check if key/va...
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,861
function keyExists(argv: Arguments, val: any): any { // convert string '1' to number 1 const num = Number(val); val = isNaN(num) ? val : num; if (typeof val === 'number') { // check length of argv._ val = argv._.length >= val; } else if (val.match(/^--no-.+/)) { // check if key/va...
interface Arguments { /** The script name or node command */ $0: string; /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,862
function keyExists(argv: Arguments, val: any): any { // convert string '1' to number 1 const num = Number(val); val = isNaN(num) ? val : num; if (typeof val === 'number') { // check length of argv._ val = argv._.length >= val; } else if (val.match(/^--no-.+/)) { // check if key/va...
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,863
conflicting(argv: Arguments): void
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,864
conflicting(argv: Arguments): void
interface Arguments { /** The script name or node command */ $0: string; /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,865
conflicting(argv: Arguments): void
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,866
implications(argv: Arguments): void
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,867
implications(argv: Arguments): void
interface Arguments { /** The script name or node command */ $0: string; /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,868
implications(argv: Arguments): void
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,869
limitedChoices(argv: Arguments): void
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,870
limitedChoices(argv: Arguments): void
interface Arguments { /** The script name or node command */ $0: string; /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,871
limitedChoices(argv: Arguments): void
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,872
nonOptionCount(argv: Arguments): void
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,873
nonOptionCount(argv: Arguments): void
interface Arguments { /** The script name or node command */ $0: string; /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,874
nonOptionCount(argv: Arguments): void
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,875
requiredArguments( argv: Arguments, demandedOptions: Dictionary<string | undefined> ): void
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,876
requiredArguments( argv: Arguments, demandedOptions: Dictionary<string | undefined> ): void
interface Arguments { /** The script name or node command */ $0: string; /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,877
requiredArguments( argv: Arguments, demandedOptions: Dictionary<string | undefined> ): void
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,878
reset(localLookup: Dictionary): ValidationInstance
type Dictionary<T = any> = {[key: string]: T};
2,879
unknownArguments( argv: Arguments, aliases: DetailedArguments['aliases'], positionalMap: Dictionary, isDefaultCommand: boolean, checkPositionals?: boolean ): void
type Dictionary<T = any> = {[key: string]: T};
2,880
unknownArguments( argv: Arguments, aliases: DetailedArguments['aliases'], positionalMap: Dictionary, isDefaultCommand: boolean, checkPositionals?: boolean ): void
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,881
unknownArguments( argv: Arguments, aliases: DetailedArguments['aliases'], positionalMap: Dictionary, isDefaultCommand: boolean, checkPositionals?: boolean ): void
interface Arguments { /** The script name or node command */ $0: string; /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,882
unknownArguments( argv: Arguments, aliases: DetailedArguments['aliases'], positionalMap: Dictionary, isDefaultCommand: boolean, checkPositionals?: boolean ): void
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,883
unknownCommands(argv: Arguments): boolean
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,884
unknownCommands(argv: Arguments): boolean
interface Arguments { /** The script name or node command */ $0: string; /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,885
unknownCommands(argv: Arguments): boolean
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,886
function YargsFactory(_shim: PlatformShim) { return ( processArgs: string | string[] = [], cwd = _shim.process.cwd(), parentRequire?: RequireType ): YargsInstance => { const yargs = new YargsInstance(processArgs, cwd, parentRequire, _shim); // Legacy yargs.argv interface, it's recommended that y...
interface PlatformShim { cwd: Function; format: Function; normalize: Function; require: Function; resolve: Function; env: Function; }
2,887
function YargsFactory(_shim: PlatformShim) { return ( processArgs: string | string[] = [], cwd = _shim.process.cwd(), parentRequire?: RequireType ): YargsInstance => { const yargs = new YargsInstance(processArgs, cwd, parentRequire, _shim); // Legacy yargs.argv interface, it's recommended that y...
interface PlatformShim { assert: { notStrictEqual: ( expected: any, observed: any, message?: string | Error ) => void; strictEqual: ( expected: any, observed: any, message?: string | Error ) => void; }; findUp: ( startDir: string, fn: (dir: string[], nam...
2,888
reset(aliases?: Aliases): YargsInstance
interface Aliases { [key: string]: Array<string>; }
2,889
(argv: Arguments) => void
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,890
(argv: Arguments) => void
interface Arguments { /** The script name or node command */ $0: string; /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,891
(argv: Arguments) => void
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,892
(argv: Arguments, options: Options) => any
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,893
(argv: Arguments, options: Options) => any
interface Arguments { /** The script name or node command */ $0: string; /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,894
(argv: Arguments, options: Options) => any
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,895
(argv: Arguments, options: Options) => any
interface Options extends ParserOptions { __: (format: any, ...param: any[]) => string; alias: Dictionary<string[]>; array: string[]; boolean: string[]; choices: Dictionary<string[]>; config: Dictionary<ConfigCallback | boolean>; configObjects: Dictionary[]; configuration: Configuration; count: string...
2,896
(argv: Arguments, options: Options) => any
interface Options { /** An object representing the set of aliases for a key: `{ alias: { foo: ['f']} }`. */ alias: Dictionary<string | string[]>; /** * Indicate that keys should be parsed as an array: `{ array: ['foo', 'bar'] }`. * Indicate that keys should be parsed as an array and coerced to booleans / nu...
2,897
( argv: Arguments, _yargs: YargsInstance ): Partial<Arguments> | Promise<Partial<Arguments>> => { return maybeAsyncResult< Partial<Arguments> | Promise<Partial<Arguments>> | any >( () => { return f(argv, _yargs.getOptions()); }, (...
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,898
( argv: Arguments, _yargs: YargsInstance ): Partial<Arguments> | Promise<Partial<Arguments>> => { return maybeAsyncResult< Partial<Arguments> | Promise<Partial<Arguments>> | any >( () => { return f(argv, _yargs.getOptions()); }, (...
interface Arguments { /** The script name or node command */ $0: string; /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }
2,899
( argv: Arguments, _yargs: YargsInstance ): Partial<Arguments> | Promise<Partial<Arguments>> => { return maybeAsyncResult< Partial<Arguments> | Promise<Partial<Arguments>> | any >( () => { return f(argv, _yargs.getOptions()); }, (...
interface Arguments { /** Non-option arguments */ _: ArgsOutput; /** Arguments after the end-of-options flag `--` */ '--'?: ArgsOutput; /** All remaining options */ [argName: string]: any; }