Skip to content

Commit 811c2be

Browse files
suryaiyer95claude
andcommitted
fix: resolve TypeScript spread-type errors in Azure AD conditional options
Use ternary expressions (`x ? {...} : {}`) instead of short-circuit (`x && {...}`) to avoid spreading a boolean value. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5a77db9 commit 811c2be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/drivers/src/sqlserver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export async function connect(config: ConnectionConfig): Promise<Connector> {
6262
mssqlConfig.authentication = {
6363
type: "azure-active-directory-default",
6464
options: {
65-
...(config.azure_client_id && { clientId: config.azure_client_id as string }),
65+
...(config.azure_client_id ? { clientId: config.azure_client_id as string } : {}),
6666
},
6767
}
6868
} else if (authType === "azure-active-directory-password") {
@@ -87,7 +87,7 @@ export async function connect(config: ConnectionConfig): Promise<Connector> {
8787
mssqlConfig.authentication = {
8888
type: authType,
8989
options: {
90-
...(config.azure_client_id && { clientId: config.azure_client_id }),
90+
...(config.azure_client_id ? { clientId: config.azure_client_id } : {}),
9191
},
9292
}
9393
} else if (authType === "azure-active-directory-service-principal-secret") {

0 commit comments

Comments
 (0)