feat: extension support (#78)

This commit is contained in:
Levi authored and GitHub committed 2023-10-16 09:47:31 +08:00
1 parent 82d316af83
commit c073fc0a67
118 files changed
+6971 -780

No files matched your search

@@ -0,0 +1,3 @@
import { Blob } from "blob-polyfill";
globalThis.Blob = Blob;
@@ -0,0 +1,13 @@
globalThis.crypto = {
getRandomValues(arr) {
for (let i = 0, len = arr.length; i < len; i++) {
arr[i] = Math.floor(Math.random() * 256);
}
return arr;
},
randomUUID() {
return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) => {
return (c ^ (this.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
})
}
}
@@ -0,0 +1 @@
import 'whatwg-fetch'
@@ -0,0 +1,3 @@
import "./blob/index.js"
import "./crypto/index.js"
import "./fetch/index.js"