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

Function createComparisonPredicate

packages/data-table/src/lib/operators.ts:411–436  ·  view source on GitHub ↗
(
  operator: Exclude<ComparisonOperator, 'in' | 'notIn'>,
  column: string | ColumnReferenceLike,
  value: unknown,
)

Source from the content-addressed store, hash-verified

409}
410
411function createComparisonPredicate(
412 operator: Exclude<ComparisonOperator, 'in' | 'notIn'>,
413 column: string | ColumnReferenceLike,
414 value: unknown,
415): Predicate<string> {
416 let normalizedColumn = resolvePredicateColumn(column)
417 let normalizedValue = resolveComparisonValue(value)
418
419 if (isQualifiedColumnReference(normalizedColumn) && isQualifiedColumnReference(normalizedValue)) {
420 return {
421 type: 'comparison',
422 operator,
423 column: normalizedColumn,
424 value: normalizedValue,
425 valueType: 'column',
426 }
427 }
428
429 return {
430 type: 'comparison',
431 operator,
432 column: normalizedColumn,
433 value: normalizedValue,
434 valueType: 'value',
435 }
436}

Callers 6

eqFunction · 0.85
neFunction · 0.85
gtFunction · 0.85
gteFunction · 0.85
ltFunction · 0.85
lteFunction · 0.85

Calls 3

resolvePredicateColumnFunction · 0.85
resolveComparisonValueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…