Skip to content

Commit

Permalink
Add Command parent property to TypeScript (#1475)
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowspawn committed Feb 20, 2021
1 parent 948796d commit e12ea2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion typings/index.d.ts
Expand Up @@ -156,8 +156,8 @@ declare namespace commander {

interface Command {
args: string[];

commands: Command[];
parent: Command | null;

/**
* Set the program version to `str`.
Expand Down
1 change: 1 addition & 0 deletions typings/index.test-d.ts
Expand Up @@ -21,6 +21,7 @@ expectType<commander.Command>(commander.createCommand());
// Command properties
expectType<string[]>(program.args);
expectType<commander.Command[]>(program.commands);
expectType<commander.Command | null>(program.parent);

// version
expectType<commander.Command>(program.version('1.2.3'));
Expand Down

0 comments on commit e12ea2e

Please sign in to comment.