Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.

Commit 5788e35

Browse files
author
Noel
authored
fix: check global var process (#429)
1 parent c126b3d commit 5788e35

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/zilliqa-js-crypto/src/random.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ export const randomBytes = (bytes: number) => {
3838
typeof self === 'object' &&
3939
self.constructor?.name === 'DedicatedWorkerGlobalScope';
4040

41-
const isNodeEnv = typeof process?.versions?.node === 'string';
41+
const isNodeEnv =
42+
typeof process !== 'undefined' &&
43+
typeof process?.versions?.node === 'string';
4244

4345
let crypto = undefined;
4446
if (isBrowserEnv || isWebWorkerEnv) {

0 commit comments

Comments
 (0)