Skip to content

Commit

Permalink
fix: disuse unique symbol to brand prisma types to avoid TS4058 error
Browse files Browse the repository at this point in the history
  • Loading branch information
SegaraRai committed Jan 13, 2025
1 parent ff74019 commit 93c538b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/curvy-hornets-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fraci": minor
---

Do not use unique symbol to brand prisma types to avoid TS4058 error.
7 changes: 1 addition & 6 deletions src/prisma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ const EXTENSION_NAME = "fraci";

const PRISMA_CONFLICT_CODE = "P2002";

/**
* A type-only unique symbol for branding Prisma models and fields.
*/
declare const PRISMA_BRAND: unique symbol;

/**
* `PrismaClientKnownRequestError` of the conflict error.
*/
Expand All @@ -34,7 +29,7 @@ export type PrismaClientConflictError = PrismaClientKnownRequestError & {
* @template F The field name.
*/
type PrismaBrand<M extends string, F extends string> = {
[PRISMA_BRAND]: { model: M; field: F };
readonly __prisma__: { model: M; field: F };
};

/**
Expand Down

0 comments on commit 93c538b

Please sign in to comment.