| Conditions | 3 |
| Total Lines | 15 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { elements, resetBoxes, setStateFromIndex, state } from '../../bip39'; |
||
| 8 | |||
| 9 | export function validateWordInput(): void { |
||
| 10 | const value = elements.wordInput.value.trim().toLowerCase(); |
||
| 11 | |||
| 12 | if (!value) { |
||
| 13 | clearInputError(); |
||
| 14 | return; |
||
| 15 | } |
||
| 16 | |||
| 17 | const wordExists = isWordInWordlist(value, state.wordlist); |
||
| 18 | |||
| 19 | if (wordExists) { |
||
| 20 | handleValidWord(value); |
||
| 21 | } else { |
||
| 22 | handleInvalidWord(); |
||
| 23 | } |
||
| 55 |