From a4a9fec107eda044199393df904cd7404c683dc2 Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Thu, 21 Mar 2024 15:53:41 +0000 Subject: [PATCH] fix: handle process.env being undefined in debug func --- src/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.ts b/src/core.ts index 7b5a97bb..dfe9bd5b 100644 --- a/src/core.ts +++ b/src/core.ts @@ -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); } }