Skip to content

Commit c4732f6

Browse files
authored
Fix RangeError when source maps are large (#22)
1 parent 3b8c231 commit c4732f6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,11 @@ const encoder = new TextEncoder();
221221
const decoder = new TextDecoder();
222222

223223
function encodeBase64(str) {
224-
return btoa(String.fromCharCode(...encoder.encode(str)));
224+
let result = "";
225+
for (let char of encoder.encode(str)) {
226+
result += String.fromCharCode(char);
227+
}
228+
return btoa(result);
225229
}
226230

227231
function decodeBase64(str) {

0 commit comments

Comments
 (0)