Don't import Decimal from internal libraries
This was causing the project build to not work properly.
This commit is contained in:
parent
95137acbed
commit
5602c22861
2 changed files with 5 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
|||
import { Decimal } from "@prisma/client/runtime/library";
|
||||
import { Prisma } from "@prisma/client";
|
||||
|
||||
type func = (...args: any[]) => any | Function;
|
||||
|
||||
|
@ -8,7 +8,7 @@ export type replaceJsonUnparsableToString<T> =
|
|||
[K in keyof T]:
|
||||
T[K] extends null ? null
|
||||
: T[K] extends func ? never
|
||||
: T[K] extends Decimal ? `${number}`
|
||||
: T[K] extends Prisma.Decimal ? `${number}`
|
||||
: T[K] extends Array<infer E> ? Array<replaceJsonUnparsableToString<E>>
|
||||
: T[K] extends object ? replaceJsonUnparsableToString<T[K]>
|
||||
: T[K] extends bigint ? `${bigint}`
|
||||
|
@ -34,7 +34,7 @@ export function prismaToWeb<T>(ivalue: T): replaceJsonUnparsableToString<T> {
|
|||
const current = ivalue[i];
|
||||
if (current === null) rvalue[i] = null;
|
||||
else if (typeof current === 'function') continue;
|
||||
else if (current instanceof Decimal) rvalue[i] = current.toString();
|
||||
else if (current instanceof Prisma.Decimal) rvalue[i] = current.toString();
|
||||
else if (current instanceof Array) rvalue[i] = arrayPrismaToWeb(current);
|
||||
else if (typeof current === 'object') rvalue[i] = prismaToWeb(current);
|
||||
else if (typeof current === 'bigint') rvalue[i] = current.toString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue