Skip to content

Commit a670f92

Browse files
authored
chore(data-service): do not modify options passed to connectMongoClient (#3070)
Only a minor code cleanup.
1 parent bddafc1 commit a670f92

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

packages/data-service/src/connect-mongo-client.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
const { debug, log } = createLoggerAndTelemetry('COMPASS-CONNECT');
2020

2121
export default async function connectMongoClientCompass(
22-
connectionOptions: ConnectionOptions,
22+
connectionOptions: Readonly<ConnectionOptions>,
2323
setupListeners: (client: MongoClient) => void
2424
): Promise<
2525
[
@@ -42,10 +42,13 @@ export default async function connectMongoClientCompass(
4242
};
4343

4444
if (options.autoEncryption && process.env.COMPASS_CSFLE_LIBRARY_PATH) {
45-
options.autoEncryption.extraOptions = {
46-
...options.autoEncryption.extraOptions,
47-
// @ts-expect-error next driver release has types
48-
csflePath: process.env.COMPASS_CSFLE_LIBRARY_PATH,
45+
options.autoEncryption = {
46+
...options.autoEncryption,
47+
extraOptions: {
48+
...options.autoEncryption?.extraOptions,
49+
// @ts-expect-error next driver release has types
50+
csflePath: process.env.COMPASS_CSFLE_LIBRARY_PATH,
51+
},
4952
};
5053
}
5154

0 commit comments

Comments
 (0)