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

Function maxValue

packages/db/src/query/predicate-utils.ts:1165–1170  ·  view source on GitHub ↗

* Get the maximum of two values, handling both numbers and Dates

(a: any, b: any)

Source from the content-addressed store, hash-verified

1163 * Get the maximum of two values, handling both numbers and Dates
1164 */
1165function maxValue(a: any, b: any): any {
1166 if (a instanceof Date && b instanceof Date) {
1167 return a.getTime() > b.getTime() ? a : b
1168 }
1169 return Math.max(a, b)
1170}
1171
1172/**
1173 * Get the minimum of two values, handling both numbers and Dates

Callers 1

unionSameFieldPredicatesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected