11 lines
297 B
TypeScript
11 lines
297 B
TypeScript
import { webcrypto } from "node:crypto";
|
|
|
|
// Polyfill Web Crypto for Node.js environments (Vitest forks pool)
|
|
if (typeof globalThis.crypto === "undefined") {
|
|
Object.defineProperty(globalThis, "crypto", {
|
|
value: webcrypto,
|
|
writable: false,
|
|
configurable: true,
|
|
});
|
|
}
|