MCPcopy
hub / github.com/remix-run/remix / buildLinkPredicate

Function buildLinkPredicate

packages/data-table/src/lib/database/relations.ts:268–287  ·  view source on GitHub ↗
(targetColumns: string[], tuples: unknown[][])

Source from the content-addressed store, hash-verified

266}
267
268function 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
289function groupRowsByTuple(
290 rows: Record<string, unknown>[],

Callers 2

loadDirectRelationValuesFunction · 0.85
loadHasManyThroughValuesFunction · 0.85

Calls 5

inListFunction · 0.90
eqFunction · 0.90
andFunction · 0.90
orFunction · 0.90
mapMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…