(
table: AnyTable,
{ select = true, where, orderBy, join, ...options }: FindManyOptions,
)
| 49 | } |
| 50 | |
| 51 | function buildFindOptions( |
| 52 | table: AnyTable, |
| 53 | { select = true, where, orderBy, join, ...options }: FindManyOptions, |
| 54 | ): SimplifyFindOptions<FindManyOptions> | false { |
| 55 | let conditions = where ? buildCondition(table.columns, where) : undefined; |
| 56 | if (conditions === true) conditions = undefined; |
| 57 | if (conditions === false) return false; |
| 58 | |
| 59 | return { |
| 60 | select, |
| 61 | where: conditions, |
| 62 | orderBy: simplifyOrderBy(table.columns, orderBy), |
| 63 | join: join ? buildJoin(table, join) : undefined, |
| 64 | ...options, |
| 65 | }; |
| 66 | } |
| 67 | |
| 68 | function buildJoin<T extends AnyTable>( |
| 69 | table: AnyTable, |
no test coverage detected