mobile safari fix

This commit is contained in:
AJ ONeal 2015-10-23 02:12:29 -07:00
parent ae560e7803
commit e39c6956f2
1 changed files with 6 additions and 1 deletions

View File

@ -131,7 +131,12 @@ exports.base32ToBuffer = function(encoded) {
throw new Error('Invalid input - it is not base32 encoded string'); throw new Error('Invalid input - it is not base32 encoded string');
} }
} }
return decoded.slice(0, plainPos); if (decoded.slice) {
return decoded.slice(0, plainPos);
} else {
// Mobile Safari's Uint8Array doesn't have slice
return Array.prototype.slice.apply(decoded, 0, plainPos);
}
}; };
}(window.Unibabel || window)); }(window.Unibabel || window));