Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jan 31, 2024
1 parent 516369d commit 1c236ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Expand Up @@ -27,7 +27,8 @@
"globals": {
"DEBUG": true,
"process": true,
"Buffer": true
"Buffer": true,
"globalThis": true,
},
"extends": "eslint:recommended",
"parserOptions": {
Expand Down
2 changes: 1 addition & 1 deletion src/SourceMap.js
@@ -1,7 +1,7 @@
import { encode } from '@jridgewell/sourcemap-codec';

function getBtoa() {
if (typeof globalThis.btoa === 'function') {
if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') {
return (str) => globalThis.btoa(unescape(encodeURIComponent(str)));
} else if (typeof Buffer === 'function') {
return (str) => Buffer.from(str, 'utf-8').toString('base64');
Expand Down

0 comments on commit 1c236ae

Please sign in to comment.