Skip to content

Commit

Permalink
fix: handle process.env being undefined in debug func (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Mar 21, 2024
1 parent f92c50a commit 3b0f38a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core.ts
Expand Up @@ -1075,7 +1075,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(`Anthropic:DEBUG:${action}`, ...args);
}
}
Expand Down

0 comments on commit 3b0f38a

Please sign in to comment.