(targetColumns: string[], tuples: unknown[][])
| 266 | } |
| 267 | |
| 268 | function buildLinkPredicate(targetColumns: string[], tuples: unknown[][]): Predicate | undefined { |
| 269 | if (tuples.length === 0) { |
| 270 | return undefined |
| 271 | } |
| 272 | |
| 273 | if (targetColumns.length === 1) { |
| 274 | return inList( |
| 275 | targetColumns[0], |
| 276 | tuples.map((tuple) => tuple[0]), |
| 277 | ) |
| 278 | } |
| 279 | |
| 280 | let tuplePredicates = tuples.map((tuple) => { |
| 281 | let comparisons = targetColumns.map((column, index) => eq(column, tuple[index])) |
| 282 | |
| 283 | return and(...comparisons) |
| 284 | }) |
| 285 | |
| 286 | return or(...tuplePredicates) |
| 287 | } |
| 288 | |
| 289 | function groupRowsByTuple( |
| 290 | rows: Record<string, unknown>[], |
no test coverage detected
searching dependent graphs…