(userRelation: unknown)
| 110 | // Extracts the userId from a Prisma relation connect object. |
| 111 | // Prisma's connect syntax for a relation looks like: { connect: { id: "some-id" } } |
| 112 | const connectedUserId = (userRelation: unknown): string | undefined => { |
| 113 | if (!isRecord(userRelation) || !('connect' in userRelation)) { |
| 114 | return undefined; |
| 115 | } |
| 116 | |
| 117 | const connect = userRelation.connect; |
| 118 | if (!isRecord(connect) || !('id' in connect) || typeof connect.id !== 'string') { |
| 119 | return undefined; |
| 120 | } |
| 121 | |
| 122 | return connect.id; |
| 123 | }; |
| 124 | |
| 125 | const createDataUserId = (row: unknown): string | undefined => { |
| 126 | if (!isRecord(row)) { |
no test coverage detected