(key, platform = "win")
| 679 | } |
| 680 | |
| 681 | function normalizeKey(key, platform = "win") { |
| 682 | if (!key) return null; |
| 683 | const replaced = key.replace(/Mod/g, platform === "mac" ? "Cmd" : "Ctrl"); |
| 684 | const { modifiers, baseKey } = parseKeyParts(replaced); |
| 685 | if (!baseKey) return [...modifiers].join("-") || null; |
| 686 | const ordered = MODIFIER_ORDER.filter((mod) => modifiers.has(mod)); |
| 687 | return [...ordered, baseKey].join("-"); |
| 688 | } |
| 689 | |
| 690 | function ensureModifier(combo, modifier) { |
| 691 | if (!combo) return null; |
no test coverage detected