Skip to content

Commit 900600a

Browse files
committed
effect-mongodb: fix isMongoClient and isDb to check new wrapped classes
1 parent 0d7a374 commit 900600a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

packages/effect-mongodb/src/Db.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import * as Data from "effect/Data"
55
import * as Effect from "effect/Effect"
66
import * as F from "effect/Function"
77
import type * as Schema from "effect/Schema"
8-
import type { Document, DropCollectionOptions, ListCollectionsOptions } from "mongodb"
9-
import { Db as Db_ } from "mongodb"
8+
import type { Db as Db_, Document, DropCollectionOptions, ListCollectionsOptions } from "mongodb"
109
import type * as Collection from "./Collection.js"
1110
import * as DocumentCollection from "./DocumentCollection.js"
1211
import { mongoErrorOrDie } from "./internal/mongo-error.js"
@@ -87,7 +86,7 @@ export const dropCollection: {
8786
)
8887
)
8988

90-
const isDb = (x: unknown) => x instanceof Db_
89+
const isDb = (x: unknown) => x instanceof Db
9190

9291
const errorSource = (db: Db, functionName: string) =>
9392
new MongoError.DbErrorSource({ module: "Db", functionName, db: db.db.databaseName })

packages/effect-mongodb/src/MongoClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const db: {
5353
new Db.Db({ db: client.db(dbName, options) })
5454
)
5555

56-
const isMongoClient = (x: unknown) => x instanceof MongoClient_
56+
const isMongoClient = (x: unknown) => x instanceof MongoClient
5757

5858
const errorSource = (hosts: Array<string>, functionName: string) =>
5959
new MongoError.ClientErrorSource({ module: "MongoClient", functionName, hosts })

0 commit comments

Comments
 (0)