Skip to content

Commit 9e9d7b9

Browse files
committed
Use destructuring to avoid undefined option values
1 parent 41c46ac commit 9e9d7b9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/utils/sdk.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ export async function setupSdk(
114114
return {
115115
ok: true,
116116
data: new SocketSdk(apiToken, {
117-
agent: apiProxy ? new ProxyAgent({ proxy: apiProxy }) : undefined,
118-
baseUrl: apiBaseUrl,
117+
...(apiProxy ? { agent: new ProxyAgent({ proxy: apiProxy }) } : {}),
118+
...(apiBaseUrl ? { baseUrl: apiBaseUrl } : {}),
119119
timeout: constants.ENV.SOCKET_CLI_API_TIMEOUT,
120120
userAgent: createUserAgentFromPkgJson({
121121
name: constants.ENV.INLINED_SOCKET_CLI_NAME,

0 commit comments

Comments
 (0)