Skip to content

Commit

Permalink
Fix window.btoa call in browser (TiddlyWiki#7814)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmunn authored Oct 26, 2023
1 parent 23a576b commit 801e8e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/modules/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 801e8e3

Please sign in to comment.