mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-26 03:27:18 +00:00
Fix window.btoa call in browser (#7814)
This commit is contained in:
parent
23a576b8bd
commit
801e8e312c
@ -823,8 +823,8 @@ exports.hashString = function(str) {
|
||||
Base64 utility functions that work in either browser or Node.js
|
||||
*/
|
||||
if(typeof window !== 'undefined') {
|
||||
exports.btoa = window.btoa;
|
||||
exports.atob = window.atob;
|
||||
exports.btoa = function(binstr) { return window.btoa(binstr); }
|
||||
exports.atob = function(b64) { return window.atob(b64); }
|
||||
} else {
|
||||
exports.btoa = function(binstr) {
|
||||
return Buffer.from(binstr, 'binary').toString('base64');
|
||||
|
Loading…
Reference in New Issue
Block a user