Skip to content

Commit 9510181

Browse files
committed
style: capitalize argument cannot be undefined
1 parent 4575640 commit 9510181

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/builtins.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ const groupCommandsByCategory = (commands: CommandConfig[]) => {
1717
}, {})
1818
}
1919

20-
const capitalize = (str: string | undefined) => {
21-
return str ? `${str.charAt(0).toUpperCase()}${str.slice(1)}` : str
20+
const capitalize = (str: string) => {
21+
return `${str.charAt(0).toUpperCase()}${str.slice(1)}`
2222
}
2323

2424
export const helpCommand = defineCommand(
@@ -86,7 +86,7 @@ export const helpCommand = defineCommand(
8686
fields: [
8787
{
8888
name: 'Category',
89-
value: capitalize(cmd.config.category) ?? 'None',
89+
value: capitalize(cmd.config.category ?? 'None'),
9090
inline: true
9191
},
9292
{

0 commit comments

Comments
 (0)