Files
suaveplan/packages/foundation/data/mime/tests/setup/polyfills.ts
2026-05-27 23:47:53 +01:00

9 lines
273 B
TypeScript

// Ensure `globalThis.crypto` is available in bare-Node vitest runs.
import { webcrypto } from "node:crypto";
type WritableGlobal = { crypto?: Crypto };
const g = globalThis as WritableGlobal;
if (g.crypto === undefined) {
g.crypto = webcrypto as unknown as Crypto;
}