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