| 4 | import type { Generable } from class="st">'./Generable' |
| 5 | |
| 6 | export class FieldRefInput implements Generable { |
| 7 | constructor(private type: DMMF.FieldRefType) {} |
| 8 | |
| 9 | toTS() { |
| 10 | const allowedTypes = this.getAllowedTypes() |
| 11 | return ` |
| 12 | /** |
| 13 | * Reference to a field of type ${allowedTypes} |
| 14 | */ |
| 15 | export type ${this.type.name}<$PrismaModel> = FieldRefInputType<$PrismaModel, ${allowedTypes}> |
| 16 | ` |
| 17 | } |
| 18 | |
| 19 | private getAllowedTypes() { |
| 20 | return this.type.allowTypes.map(getRefAllowedTypeName).join(class="st">' | ') |
| 21 | } |
| 22 | } |
nothing calls this directly
no outgoing calls
no test coverage detected