Skip to content

Commit

Permalink
refactor: remove TS ASsertions and use ??
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Oct 12, 2023
1 parent 6d87104 commit 2c2be68
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/commands/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ export default class Commands extends Command {
ux.table(
commands.map((command) => {
// Massage some fields so it looks good in the table
command.description = (command.description || '').split(EOL)[0]
command.summary = command.summary || (command.description || '').split(EOL)[0]
command.description = (command.description ?? '').split(EOL)[0]
command.summary = command.summary ?? (command.description ?? '').split(EOL)[0]
command.hidden = Boolean(command.hidden)
command.usage = command.usage || ''
return command as unknown as Record<string, unknown>
command.usage ??= ''
return command
}),
{
description: {
Expand Down

0 comments on commit 2c2be68

Please sign in to comment.