mirror of
https://github.com/AmanTahiliani/box-box.git
synced 2026-08-08 04:06:18 -04:00
Tighten race result ingestion ordering
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user