(
hotkey: Hotkey | ParsedHotkey | (string & {}),
platform: 'mac' | 'windows' | 'linux' = detectPlatform(),
)
| 314 | * ``` |
| 315 | */ |
| 316 | export function hasNonModifierKey( |
| 317 | hotkey: Hotkey | ParsedHotkey | (string & {}), |
| 318 | platform: 'mac' | 'windows' | 'linux' = detectPlatform(), |
| 319 | ): boolean { |
| 320 | const parsed = |
| 321 | typeof hotkey === 'string' ? parseHotkey(hotkey, platform) : hotkey |
| 322 | |
| 323 | // Check if the key part is actually a modifier |
| 324 | const keyIsModifier = isModifierKey(parsed.key) |
| 325 | |
| 326 | // A valid hotkey must have a non-modifier key |
| 327 | return !keyIsModifier && parsed.key.length > 0 |
| 328 | } |
no test coverage detected
searching dependent graphs…