From 801e8e312c1cb398643d8c608f6bb83303d4ceed Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 26 Oct 2023 15:05:59 +0700 Subject: [PATCH] Fix window.btoa call in browser (#7814) --- core/modules/utils/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/utils/utils.js b/core/modules/utils/utils.js index 21e87f30dd3..9fffb171426 100644 --- a/core/modules/utils/utils.js +++ b/core/modules/utils/utils.js @@ -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');