File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ export class Command<PreParseReturn = Args, Options extends Command.Options = Co
154
154
* @note You can set {@link Command.Options.fullCategory} to override the built-in category resolution.
155
155
*/
156
156
public get category ( ) : string | null {
157
- return this . fullCategory . length > 0 ? this . fullCategory [ 0 ] : null ;
157
+ return this . fullCategory . at ( 0 ) ?? null ;
158
158
}
159
159
160
160
/**
@@ -166,7 +166,7 @@ export class Command<PreParseReturn = Args, Options extends Command.Options = Co
166
166
* @note You can set {@link Command.Options.fullCategory} to override the built-in category resolution.
167
167
*/
168
168
public get subCategory ( ) : string | null {
169
- return this . fullCategory . length > 1 ? this . fullCategory [ 1 ] : null ;
169
+ return this . fullCategory . at ( 1 ) ?? null ;
170
170
}
171
171
172
172
/**
@@ -178,7 +178,7 @@ export class Command<PreParseReturn = Args, Options extends Command.Options = Co
178
178
* @note You can set {@link Command.Options.fullCategory} to override the built-in category resolution.
179
179
*/
180
180
public get parentCategory ( ) : string | null {
181
- return this . fullCategory . length > 1 ? this . fullCategory [ this . fullCategory . length - 1 ] : null ;
181
+ return this . fullCategory . at ( - 1 ) ?? null ;
182
182
}
183
183
184
184
/**
You can’t perform that action at this time.
0 commit comments