mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-03-21 17:25:10 -05:00
Correctly support Node 18
This commit is contained in:
parent
d8a051e364
commit
557ed5008b
|
|
@ -212,7 +212,7 @@ export class SodiumRNG implements RNG {
|
|||
// TODO: Fix that @types/node >14 issue
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore Web Crypto isn't actually in Node 18
|
||||
if (typeof crypto === 'undefined') crypto = require('node:crypto');
|
||||
if (typeof crypto === 'undefined') globalThis.crypto = require('node:crypto');
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore Web Crypto _is_ available in newer Node
|
||||
crypto.getRandomValues(seed);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user