* Check if a full chord matches a binding's chord.
( chord: ParsedKeystroke[], binding: ParsedBinding, )
| 138 | * Check if a full chord matches a binding's chord. |
| 139 | */ |
| 140 | function chordExactlyMatches( |
| 141 | chord: ParsedKeystroke[], |
| 142 | binding: ParsedBinding, |
| 143 | ): boolean { |
| 144 | if (chord.length !== binding.chord.length) return false |
| 145 | for (let i = 0; i < chord.length; i++) { |
| 146 | const chordKey = chord[i] |
| 147 | const bindingKey = binding.chord[i] |
| 148 | if (!chordKey || !bindingKey) return false |
| 149 | if (!keystrokesEqual(chordKey, bindingKey)) return false |
| 150 | } |
| 151 | return true |
| 152 | } |
| 153 | |
| 154 | /** |
| 155 | * Resolve a key with chord state support. |
no test coverage detected