wasm.js 535 B

123456789101112131415161718
  1. let wasm;
  2. /**
  3. * Gets the webassembly module provided in provideWasm.
  4. */
  5. export const getWasm = () => {
  6. if (!wasm) {
  7. throw new Error('BLAKE3 webassembly not loaded. Please import the module via `blake3/browser` or `blake3/browser-async`');
  8. }
  9. return wasm;
  10. };
  11. /**
  12. * Sets the webassembly module used for the browser build. This indirection is
  13. * needed to provide compatibility between the "browser" and "browser-async" modes.
  14. */
  15. export const provideWasm = (w) => {
  16. wasm = w;
  17. };
  18. //# sourceMappingURL=wasm.js.map