Skip to content

Commit e12ea2e

Browse files
authored
Add Command parent property to TypeScript (#1475)
1 parent 948796d commit e12ea2e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

typings/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ declare namespace commander {
156156

157157
interface Command {
158158
args: string[];
159-
160159
commands: Command[];
160+
parent: Command | null;
161161

162162
/**
163163
* Set the program version to `str`.

typings/index.test-d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ expectType<commander.Command>(commander.createCommand());
2121
// Command properties
2222
expectType<string[]>(program.args);
2323
expectType<commander.Command[]>(program.commands);
24+
expectType<commander.Command | null>(program.parent);
2425

2526
// version
2627
expectType<commander.Command>(program.version('1.2.3'));

0 commit comments

Comments
 (0)