Skip to content

Commit f2314a9

Browse files
PR suggestion, primary review
1 parent e46a499 commit f2314a9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/connection_string.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
ServerApiVersion
2424
} from './mongo_client';
2525
import {
26+
type MongoDBLogWritable,
2627
MongoLoggableComponent,
2728
MongoLogger,
2829
type MongoLoggerEnvOptions,
@@ -1250,10 +1251,7 @@ export const OPTIONS = {
12501251
if (
12511252
!(
12521253
(typeof value === 'string' && ['stderr', 'stdout'].includes(value)) ||
1253-
(value &&
1254-
typeof value === 'object' &&
1255-
'write' in value &&
1256-
typeof value.write === 'function')
1254+
(typeof value === 'object' && typeof (value as MongoDBLogWritable)?.write === 'function')
12571255
)
12581256
) {
12591257
throw new MongoAPIError(

0 commit comments

Comments
 (0)