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

Function customComparator

packages/db/tests/btree-index-undefined-values.test.ts:293–299  ·  view source on GitHub ↗
(a: unknown, b: unknown)

Source from the content-addressed store, hash-verified

291 const comparisons: Array<[unknown, unknown]> = []
292
293 function customComparator(a: unknown, b: unknown): number {
294 comparisons.push([a, b])
295 if (a === undefined && b === undefined) return 0
296 if (a === undefined) return 1
297 if (b === undefined) return -1
298 return (a as number) - (b as number)
299 }
300
301 const index = new BTreeIndex<string>(
302 1,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected