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

Function valueExtractor

packages/db/src/query/compiler/group-by.ts:522–529  ·  view source on GitHub ↗
([, namespacedRow]: [string, NamespacedRow])

Source from the content-addressed store, hash-verified

520
521 // Create a value extractor function for the expression to aggregate
522 const valueExtractor = ([, namespacedRow]: [string, NamespacedRow]) => {
523 const value = compiledExpr(namespacedRow)
524 // Ensure we return a number for numeric aggregate functions
525 if (typeof value === `number`) {
526 return value
527 }
528 return value != null ? Number(value) : 0
529 }
530
531 // Create a value extractor function for min/max that preserves comparable types
532 const valueExtractorForMinMax = ([, namespacedRow]: [

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected