Skip to content

Commit 07670be

Browse files
committed
[scramjet/controller] fix missing base64 encode function
1 parent 7a1fbfc commit 07670be

File tree

1 file changed

+11
-0
lines changed
  • packages/scramjet/packages/controller/src

1 file changed

+11
-0
lines changed

packages/scramjet/packages/controller/src/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,17 @@ function yieldGetInjectScripts(
335335
handler,
336336
script
337337
) => {
338+
function base64Encode(text: string) {
339+
return btoa(
340+
new TextEncoder()
341+
.encode(text)
342+
.reduce(
343+
(data, byte) => (data.push(String.fromCharCode(byte)), data),
344+
[] as any
345+
)
346+
.join("")
347+
);
348+
}
338349
return [
339350
script(config.scramjetPath),
340351
script(config.injectPath),

0 commit comments

Comments
 (0)