mirror of
https://github.com/status-im/bip39.git
synced 2025-01-09 12:15:45 +00:00
index: use every not reduce
This commit is contained in:
parent
f3b4f8cc35
commit
6488b6362e
7
index.js
7
index.js
@ -41,9 +41,10 @@ BIP39.prototype.validate = function(mnemonic) {
|
|||||||
if (mnemonic.length % 3 !== 0) return false
|
if (mnemonic.length % 3 !== 0) return false
|
||||||
|
|
||||||
var wordlist = this.wordlist
|
var wordlist = this.wordlist
|
||||||
var belongToList = mnemonic.reduce(function(memo, m) {
|
|
||||||
return memo && (wordlist.indexOf(m) > -1)
|
var belongToList = mnemonic.every(function(word) {
|
||||||
}, true)
|
return wordlist.indexOf(word) > -1
|
||||||
|
})
|
||||||
|
|
||||||
if (!belongToList) return false
|
if (!belongToList) return false
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user