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

Function normalizeRegisterableHotkey

packages/hotkeys/src/parse.ts:221–231  ·  view source on GitHub ↗
(
  hotkey: RegisterableHotkey,
  platform: 'mac' | 'windows' | 'linux' = detectPlatform(),
)

Source from the content-addressed store, hash-verified

219 * Use this in framework adapters instead of branching on `formatHotkey(rawHotkeyToParsedHotkey(...))`.
220 */
221export function normalizeRegisterableHotkey(
222 hotkey: RegisterableHotkey,
223 platform: 'mac' | 'windows' | 'linux' = detectPlatform(),
224): Hotkey {
225 return typeof hotkey === 'string'
226 ? normalizeHotkey(hotkey, platform)
227 : normalizeHotkeyFromParsed(
228 rawHotkeyToParsedHotkey(hotkey, platform),
229 platform,
230 )
231}
232
233/**
234 * Checks if a string is a recognized modifier token (including aliases).

Callers 15

createHotkeyFunction · 0.90
createHotkeysFunction · 0.90
registerHotkeyFunction · 0.90
createHotkeyFunction · 0.90
createHotkeyAttachmentFunction · 0.90
createHotkeysFunction · 0.90
createHotkeysAttachmentFunction · 0.90
useHotkeyFunction · 0.90
useHotkeysFunction · 0.90
injectHotkeysFunction · 0.90
injectHotkeyFunction · 0.90
useHotkeyFunction · 0.90

Calls 4

detectPlatformFunction · 0.90
normalizeHotkeyFunction · 0.85
rawHotkeyToParsedHotkeyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…