(parsed: ParsedHotkey)
| 51 | * ``` |
| 52 | */ |
| 53 | export function formatHotkey(parsed: ParsedHotkey): string { |
| 54 | const parts: Array<string> = [] |
| 55 | |
| 56 | // Add modifiers in canonical order |
| 57 | for (const modifier of MODIFIER_ORDER) { |
| 58 | if (parsed.modifiers.includes(modifier)) { |
| 59 | parts.push(modifier) |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | // Add the key |
| 64 | parts.push(parsed.key) |
| 65 | |
| 66 | return parts.join('+') |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Formats a hotkey for display in a user interface. |
no outgoing calls
no test coverage detected
searching dependent graphs…