mirror of
https://github.com/loro-dev/loro.git
synced 2025-01-23 05:24:51 +00:00
a76143068a
* chore: rm needless fuzz code * fix(wasm): build script fix * chore: release info
11 lines
433 B
JavaScript
11 lines
433 B
JavaScript
// Don't patch this if it already exists (for example in Deno)
|
|
if (!globalThis.crypto) {
|
|
// We need this patch because we use `getrandom` crate in Rust, which relies on this patch
|
|
// for nodejs
|
|
// https://docs.rs/getrandom/latest/getrandom/#nodejs-es-module-support
|
|
const { webcrypto } = require("crypto");
|
|
Object.defineProperty(globalThis, 'crypto', {
|
|
value: webcrypto,
|
|
writable: true
|
|
});
|
|
}
|