cal.pub0.org/packages/lib/isPrismaObj.ts

12 lines
296 B
TypeScript

import { 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;