(blocks: KeybindingBlock[])
| 189 | * Parse keybinding blocks (from JSON config) into a flat list of ParsedBindings. |
| 190 | */ |
| 191 | export function parseBindings(blocks: KeybindingBlock[]): ParsedBinding[] { |
| 192 | const bindings: ParsedBinding[] = [] |
| 193 | for (const block of blocks) { |
| 194 | for (const [key, action] of Object.entries(block.bindings)) { |
| 195 | bindings.push({ |
| 196 | chord: parseChord(key), |
| 197 | action, |
| 198 | context: block.context, |
| 199 | }) |
| 200 | } |
| 201 | } |
| 202 | return bindings |
| 203 | } |
| 204 |
no test coverage detected