(row: unknown)
| 123 | }; |
| 124 | |
| 125 | const createDataUserId = (row: unknown): string | undefined => { |
| 126 | if (!isRecord(row)) { |
| 127 | return undefined; |
| 128 | } |
| 129 | const scalarUserId = typeof row.userId === 'string' ? row.userId : undefined; |
| 130 | const relationUserId = row.user === undefined ? undefined : connectedUserId(row.user); |
| 131 | |
| 132 | if (row.user !== undefined && relationUserId === undefined) { |
| 133 | return undefined; |
| 134 | } |
| 135 | if (scalarUserId !== undefined && relationUserId !== undefined && scalarUserId !== relationUserId) { |
| 136 | return undefined; |
| 137 | } |
| 138 | |
| 139 | return relationUserId ?? scalarUserId; |
| 140 | }; |
| 141 | |
| 142 | const assertCreateDataForUser = ( |
| 143 | data: unknown, |
no test coverage detected