11 lines
299 B
TypeScript
11 lines
299 B
TypeScript
import { webcrypto } from "node:crypto";
|
|
|
|
// Polyfill Web Crypto API for Node/Bun test environments that lack it
|
|
if (typeof globalThis.crypto === "undefined") {
|
|
Object.defineProperty(globalThis, "crypto", {
|
|
value: webcrypto,
|
|
configurable: true,
|
|
writable: true,
|
|
});
|
|
}
|