Skip to content

Commit 22444d5

Browse files
authored
Merge pull request #26 from Zxilly/patch
fix: enhance constuctor
2 parents a6f456b + 41be103 commit 22444d5

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/adapter.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ export class PrismaAdapter implements Adapter {
99
#option?: Prisma.PrismaClientOptions;
1010
#prisma: PrismaClient;
1111

12-
constructor(
13-
option?: Prisma.PrismaClientOptions,
14-
prismaClient?: PrismaClient
15-
) {
16-
this.#option = option;
17-
if (prismaClient) {
18-
this.#prisma = prismaClient;
12+
constructor(option?: Prisma.PrismaClientOptions | PrismaClient) {
13+
if (option instanceof PrismaClient) {
14+
this.#prisma = option;
15+
} else {
16+
this.#option = option;
1917
}
2018
}
2119

0 commit comments

Comments
 (0)