We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
btoa
1 parent 5bfb56d commit 8679648Copy full SHA for 8679648
2 files changed
.eslintrc
@@ -27,7 +27,8 @@
27
"globals": {
28
"DEBUG": true,
29
"process": true,
30
- "Buffer": true
+ "Buffer": true,
31
+ "globalThis": true,
32
},
33
"extends": "eslint:recommended",
34
"parserOptions": {
src/SourceMap.js
@@ -1,8 +1,8 @@
1
import { encode } from '@jridgewell/sourcemap-codec';
2
3
function getBtoa() {
4
- if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
5
- return (str) => window.btoa(unescape(encodeURIComponent(str)));
+ if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') {
+ return (str) => globalThis.btoa(unescape(encodeURIComponent(str)));
6
} else if (typeof Buffer === 'function') {
7
return (str) => Buffer.from(str, 'utf-8').toString('base64');
8
} else {
0 commit comments