(hotkey: string, platform?: string | undefined)
| 89 | const matchApplePlatform = /Mac|iPod|iPhone|iPad/i |
| 90 | |
| 91 | function localizeMod(hotkey: string, platform?: string | undefined): string { |
| 92 | const ssrSafeWindow = typeof window === 'undefined' ? undefined : window |
| 93 | const safePlatform = platform ?? ssrSafeWindow?.navigator.platform ?? '' |
| 94 | |
| 95 | const localModifier = matchApplePlatform.test(safePlatform) ? 'Meta' : 'Control' |
| 96 | return hotkey.replace('Mod', localModifier) |
| 97 | } |
| 98 | |
| 99 | const orderedModifiers: Partial<Record<string, number>> = { |
| 100 | Control: 0, |