diff --git a/src/utils/parseCommands.ts b/src/utils/parseCommands.ts new file mode 100644 index 0000000..c2a9740 --- /dev/null +++ b/src/utils/parseCommands.ts @@ -0,0 +1,18 @@ +type CommandEntry = { + key: string; + description: string; +}; + +type ParsedCommand = { + name: string; + key: string; + description: string; +}; + +export function parseCommands(commands: Record): ParsedCommand[] { + return Object.entries(commands).map(([name, details]) => ({ + name, + key: details.key, + description: details.description, + })); +}