Tighten race result ingestion ordering

This commit is contained in:
2026-05-25 10:03:57 -04:00
parent 404029ff24
commit 17c94d83ad
9 changed files with 258 additions and 35 deletions

View File

@@ -64,3 +64,12 @@ export function positionClass(pos: number): string {
if (pos === 3) return 'pos-p3'
return 'pos-n'
}
/** Classified finish order; position 0 (DNF/DNS) sorts last. */
export function finishPositionOrder(pos: number): number {
return pos > 0 ? pos : 9999
}
export function compareFinishPosition(a: number, b: number): number {
return finishPositionOrder(a) - finishPositionOrder(b)
}