Skip to content

Commit 264f7bc

Browse files
committed
fix: access node process object via globalThis
To allow use of noise in the browser with minimal bundling, access `process.env.FOO` via `globalThis` and with optional chaining. Removes the need to use babel etc to transpile the code first.
1 parent fe1ea66 commit 264f7bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export const NOISE_MSG_MAX_LENGTH_BYTES = 65535
22
export const NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG = NOISE_MSG_MAX_LENGTH_BYTES - 16
33

4-
export const DUMP_SESSION_KEYS = process.env.DUMP_SESSION_KEYS
4+
export const DUMP_SESSION_KEYS = Boolean(globalThis.process?.env?.DUMP_SESSION_KEYS)

0 commit comments

Comments
 (0)