Misc Primitive Fixes
This commit is contained in:
@@ -14,7 +14,7 @@ export type MnemonicRaw = {
|
||||
* Supports 12, 15, 18, 21, and 24 word phrases with optional passphrase.
|
||||
*/
|
||||
export class Mnemonic {
|
||||
public static VALID_WORD_COUNTS = new Set([12, 15, 18, 21, 24]);
|
||||
protected static VALID_WORD_COUNTS = new Set([12, 15, 18, 21, 24]);
|
||||
|
||||
/**
|
||||
* Instantiate Mnemonic from a phrase string.
|
||||
@@ -40,12 +40,9 @@ export class Mnemonic {
|
||||
phraseOrWords: string | Array<string>,
|
||||
wordList: Array<string> = bip39WordListEnglish,
|
||||
) {
|
||||
// If this is a list of words...
|
||||
if (Array.isArray(phraseOrWords)) {
|
||||
return this.fromWords(phraseOrWords, wordList);
|
||||
}
|
||||
|
||||
return this.fromPhrase(phraseOrWords, wordList);
|
||||
return Array.isArray(phraseOrWords)
|
||||
? this.fromWords(phraseOrWords, wordList)
|
||||
: this.fromPhrase(phraseOrWords, wordList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user