Skip to content

Commit

Permalink
fix: handle process.env being undefined in debug func (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Mar 21, 2024
1 parent abdba1e commit e90a964
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ function applyHeadersMut(targetHeaders: Headers, newHeaders: Headers): void {
}

export function debug(action: string, ...args: any[]) {
if (typeof process !== 'undefined' && process.env['DEBUG'] === 'true') {
if (typeof process !== 'undefined' && process?.env?.['DEBUG'] === 'true') {
console.log(`Mux:DEBUG:${action}`, ...args);
}
}
Expand Down

0 comments on commit e90a964

Please sign in to comment.