Initial commit (by create-cloudflare CLI)

This commit is contained in:
Jonas_Jones 2023-09-12 00:20:38 +02:00
parent 8cb86120f1
commit fff961078a
1777 changed files with 1011798 additions and 0 deletions

View file

@ -0,0 +1,20 @@
import { provideWasm } from './esm/browser/wasm.js';
import * as wasm from './dist/wasm/web/blake3_js.js';
import * as blake3 from './esm/browser/index.js';
let cached;
/**
* Manually loads the WebAssembly module, returning a promise that resolves
* to the BLAKE3 implementation once available.
*/
export default function load(module) {
if (!cached) {
cached = wasm.default(module).then(() => {
provideWasm(wasm);
return blake3;
});
}
return cached;
}