MCPcopy Create free account
hub / github.com/chhoumann/quickadd / getCommandDisplayName

Function getCommandDisplayName

src/utils/macroHelpers.ts:8–24  ·  view source on GitHub ↗
(cmd: ICommand)

Source from the content-addressed store, hash-verified

6import { getConditionSummary } from "./conditionalHelpers";
7
8export 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}

Callers

nothing calls this directly

Calls 3

getQuickAddInstanceFunction · 0.90
getConditionSummaryFunction · 0.90
getChoiceByIdMethod · 0.80

Tested by

no test coverage detected