Skip to content

Commit

Permalink
Fix executableDir() return type
Browse files Browse the repository at this point in the history
  • Loading branch information
aweebit authored and abetomo committed Aug 19, 2023
1 parent 880b028 commit 68a4276
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -1964,7 +1964,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
* program.executableDir('subcommands');
*
* @param {string} [path]
* @return {string|Command}
* @return {string|null|Command}
*/

executableDir(path) {
Expand Down
2 changes: 1 addition & 1 deletion typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ export class Command {
/**
* Get the executable search directory.
*/
executableDir(): string;
executableDir(): string | null;

/**
* Output help information for this command.
Expand Down
2 changes: 1 addition & 1 deletion typings/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ expectType<commander.Command>(program.nameFromFilename(__filename));

// executableDir
expectType<commander.Command>(program.executableDir(__dirname));
expectType<string>(program.executableDir());
expectType<string | null>(program.executableDir());

// outputHelp
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type, @typescript-eslint/no-confusing-void-expression
Expand Down

0 comments on commit 68a4276

Please sign in to comment.