MCPcopy Create free account
hub / github.com/TanStack/hotkeys / formatHotkey

Function formatHotkey

packages/hotkeys/src/format.ts:53–67  ·  view source on GitHub ↗
(parsed: ParsedHotkey)

Source from the content-addressed store, hash-verified

51 * ```
52 */
53export 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.

Callers 3

hostConnectedMethod · 0.90
registerMethod · 0.90
format.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…