Skip to content

Commit ee0185e

Browse files
committed
fix: Argument of type 'any' is not assignable to parameter of type 'never' error when args was used
1 parent fc8f856 commit ee0185e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ function processCommandExecution<TCommand extends CommandDefinition<any, any>>(
478478
export function processConfig<TCommands extends Record<string, CommandDefinition<any, any>> = {}>(
479479
config: DefineConfig<TCommands>,
480480
args: string[],
481-
): ProcessResult<TCommands[keyof TCommands]> {
481+
): ProcessResult<CommandDefinition<any, any>> {
482482
const parsedFlags = parseFlags(args);
483483
const commandArgs = (parsedFlags._ as string[]) || [];
484484

@@ -496,9 +496,7 @@ export function processConfig<TCommands extends Record<string, CommandDefinition
496496
process.exit(0);
497497
} else if (config.defaultCommand) {
498498
// Use default command when no command is specified
499-
return processCommandExecution(config.defaultCommand, parsedFlags, commandArgs) as ProcessResult<
500-
TCommands[keyof TCommands]
501-
>;
499+
return processCommandExecution(config.defaultCommand, parsedFlags, commandArgs);
502500
} else {
503501
// Show help and throw error
504502
displayHelp(config.commands, config.meta);
@@ -521,7 +519,7 @@ export function processConfig<TCommands extends Record<string, CommandDefinition
521519
}
522520

523521
// Process the command
524-
return processCommandExecution(command, parsedFlags, remainingArgs) as ProcessResult<TCommands[keyof TCommands]>;
522+
return processCommandExecution(command, parsedFlags, remainingArgs);
525523
}
526524

527525
// Export main functions and types from config

0 commit comments

Comments
 (0)