12 lines
301 B
TypeScript
12 lines
301 B
TypeScript
import type { Prisma } from "@prisma/client";
|
|
|
|
function isPrismaObj(obj: unknown): obj is Prisma.JsonObject {
|
|
return typeof obj === "object" && !Array.isArray(obj);
|
|
}
|
|
|
|
export function isPrismaObjOrUndefined(obj: unknown) {
|
|
return isPrismaObj(obj) ? obj : undefined;
|
|
}
|
|
|
|
export default isPrismaObj;
|