The current mnemonicToIndices method doesn't throw an exception when a word can't be mapped to an index. Instead it returns 'undefined' as the index. In the end the checksum at the end fails. This error is slightly misleading.
In order to debug what was wrong I needed to log the output of the mapping to notice the 'undefined' value.
Proposed explicitly throwing an exception when a word can't be mapped, clearly indicating which word is problematic.
The current mnemonicToIndices method doesn't throw an exception when a word can't be mapped to an index. Instead it returns 'undefined' as the index. In the end the checksum at the end fails. This error is slightly misleading.
In order to debug what was wrong I needed to log the output of the mapping to notice the 'undefined' value.
Proposed explicitly throwing an exception when a word can't be mapped, clearly indicating which word is problematic.