( query: QueryIR, alias: string, )
| 160 | } |
| 161 | |
| 162 | function getSourceFromAlias( |
| 163 | query: QueryIR, |
| 164 | alias: string, |
| 165 | ): CollectionRef | QueryRef | undefined { |
| 166 | if (query.join) { |
| 167 | for (const join of query.join) { |
| 168 | if (join.from.alias === alias) { |
| 169 | return join.from |
| 170 | } |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | const from = query.from |
| 175 | const sources = |
| 176 | from.type === `unionFrom` |
| 177 | ? from.sources |
| 178 | : from.type === `unionAll` |
| 179 | ? [] |
| 180 | : [from] |
| 181 | return sources.find((source) => source.alias === alias) |
| 182 | } |
| 183 | |
| 184 | function dedupeLazyLoadTargets( |
| 185 | targets: Array<LazyLoadTarget>, |
no outgoing calls
no test coverage detected