(input: unknown)
| 1350 | } |
| 1351 | |
| 1352 | export function normalizeKeymapOverrides(input: unknown): KeymapOverrides { |
| 1353 | if (!input || typeof input !== "object") return {}; |
| 1354 | const overrides: KeymapOverrides = {}; |
| 1355 | for (const definition of KEYMAP_DEFINITIONS) { |
| 1356 | const raw = (input as Record<string, unknown>)[definition.id]; |
| 1357 | if (typeof raw !== "string") continue; |
| 1358 | const normalized = normalizeKeymapBinding(definition.id, raw); |
| 1359 | if (normalized && normalized !== definition.defaultBinding) { |
| 1360 | overrides[definition.id] = normalized; |
| 1361 | } |
| 1362 | } |
| 1363 | return overrides; |
| 1364 | } |
| 1365 | |
| 1366 | export function shortcutBindingFromEvent(event: KeyboardEvent): string | null { |
| 1367 | const mac = isMacPlatform(); |
no test coverage detected