(cmd: ICommand)
| 6 | import { getConditionSummary } from "./conditionalHelpers"; |
| 7 | |
| 8 | export function getCommandDisplayName(cmd: ICommand): string { |
| 9 | if (cmd.type === CommandType.Choice) { |
| 10 | try { |
| 11 | return getQuickAddInstance().getChoiceById((cmd as IChoiceCommand).choiceId) |
| 12 | .name; |
| 13 | } catch { |
| 14 | return "(missing choice)"; |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | if (cmd.type === CommandType.Conditional) { |
| 19 | const condition = (cmd as IConditionalCommand).condition; |
| 20 | return `If ${getConditionSummary(condition)}`; |
| 21 | } |
| 22 | |
| 23 | return cmd.name; |
| 24 | } |
nothing calls this directly
no test coverage detected