Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
fn?: (t: PrismaObjectType) => void,
): WrappedType[] {
// TODO refactor + make use of `objectTypeName`
const realTypeName =
typeof typeName === 'string' ? typeName : typeName.prismaTypeName
const objectType = new PrismaObjectType(realTypeName)
if (fn === undefined) {
return [new WrappedType(objectType), ...objectType.prismaFields()]
}
// mutate objectType
fn(objectType)
return [new WrappedType(objectType), ...objectType.getTypesToExport()]
}