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

Function sign

packages/db/tests/comparison.property.test.ts:60–64  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

58
59// Helper to get sign of a number
60const sign = (n: number): -1 | 0 | 1 => {
61 if (n < 0) return -1
62 if (n > 0) return 1
63 return 0
64}
65
66/**
67 * Check antisymmetry property: sign(compare(a, b)) === -sign(compare(b, a))

Callers 1

checkAntisymmetryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected