Skip to content

Commit

Permalink
👽️ polyfill base64 for alchemy-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
cruzdanilo committed Dec 6, 2023
1 parent 86371e1 commit d31ac38
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"expo-system-ui": "~2.4.0",
"expo-web-browser": "~12.3.2",
"expo-webauthn": "workspace:*",
"js-base64": "^3.7.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-native": "0.72.6",
Expand Down
3 changes: 3 additions & 0 deletions utils/polyfill.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { atob, btoa } from "js-base64";
import { TextEncoder } from "text-encoding";

/* eslint-disable @typescript-eslint/no-unnecessary-condition */

global.atob ??= atob;
global.btoa ??= btoa;
global.TextEncoder ??= TextEncoder;

if (global.window) {
Expand Down

0 comments on commit d31ac38

Please sign in to comment.