Skip to content

Commit e46a499

Browse files
Simplified type check
1 parent ea73deb commit e46a499

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/connection_string.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,8 +1252,8 @@ export const OPTIONS = {
12521252
(typeof value === 'string' && ['stderr', 'stdout'].includes(value)) ||
12531253
(value &&
12541254
typeof value === 'object' &&
1255-
Object.keys(value).indexOf('write') >= 0 &&
1256-
typeof Object.values(value)[Object.keys(value).indexOf('write')] === 'function')
1255+
'write' in value &&
1256+
typeof value.write === 'function')
12571257
)
12581258
) {
12591259
throw new MongoAPIError(

0 commit comments

Comments
 (0)