Skip to content

Commit a6e6c71

Browse files
committed
Fixed typescript duck typing error for isConnected call
1 parent c05abc1 commit a6e6c71

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/gridfs.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
UrlStorageOptions,
3232
DbStorageOptions
3333
} from './types';
34+
import hasOwn from "has-own-prop";
3435

3536
const isGeneratorFn = isGenerator.fn;
3637

@@ -455,7 +456,8 @@ export class GridFsStorage extends EventEmitter implements StorageEngine {
455456
}
456457

457458
if (this.client) {
458-
this.connected = this.client.isConnected
459+
this.connected = hasOwn(this.client, 'isConnected')
460+
// @ts-ignore
459461
? this.client.isConnected()
460462
: true;
461463
return;

0 commit comments

Comments
 (0)