Skip to content

Commit a618d14

Browse files
authored
fix: make lib loadable on ie9 (niklasvh#30)
1 parent 98f9344 commit a618d14

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
22

33
// Use a lookup table to find the index.
4-
const lookup = new Uint8Array(256);
4+
const lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
55
for (let i = 0; i < chars.length; i++) {
66
lookup[chars.charCodeAt(i)] = i;
77
}

0 commit comments

Comments
 (0)