MCPcopy Create free account
hub / github.com/TanStack/db / extractEqualityField

Function extractEqualityField

packages/db/src/query/predicate-utils.ts:1213–1226  ·  view source on GitHub ↗
(func: Func)

Source from the content-addressed store, hash-verified

1211}
1212
1213function extractEqualityField(func: Func): ComparisonField | null {
1214 if (func.name === `eq`) {
1215 const firstArg = func.args[0]
1216 const secondArg = func.args[1]
1217
1218 if (firstArg?.type === `ref` && secondArg?.type === `val`) {
1219 return {
1220 ref: firstArg,
1221 value: secondArg.value,
1222 }
1223 }
1224 }
1225 return null
1226}
1227
1228interface InField {
1229 ref: PropRef

Callers 3

minusSameFieldPredicatesFunction · 0.85
minusRangePredicatesFunction · 0.85
groupPredicatesByFieldFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected