Fix base.js

This commit is contained in:
wltsmrz
2013-09-11 12:11:48 -07:00
parent 57aa1773cb
commit 56a8ad3aa5

View File

@@ -140,12 +140,12 @@ Base.decode_check = function (version, input, alphabet) {
}
// Single valid version
if (typeof version && buffer[0] !== version === 'number') {
if (typeof version === 'number' && buffer[0] !== version) {
return NaN;
}
// Multiple allowed versions
if (typeof version && Array.isArray(version) === 'object') {
if (Array.isArray(version)) {
var match = false;
for (var i=0, l=version.length; i<l; i++) {