-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set webcrypto only if crypto instance is not available (#1338)
* set webcrypto only if not available * update package-lock.json * add changelog
- Loading branch information
Showing
3 changed files
with
6 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Set webcrypto only if crypto instance is not available (nodejs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
// https://docs.rs/getrandom/0.2.8/getrandom/index.html#nodejs-es-module-support | ||
import { webcrypto } from "node:crypto"; | ||
globalThis.crypto = webcrypto; | ||
if (typeof globalThis.crypto === "undefined") { | ||
globalThis.crypto = webcrypto; | ||
} | ||
|
||
export * from "./index.js"; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.