This commit is contained in:
2025-12-11 11:25:22 +01:00
parent 6a427eab57
commit e4c1be628d
86 changed files with 1222 additions and 736 deletions

View File

@@ -1,5 +1,7 @@
export type Weekday = 'Mon' | 'Tue' | 'Wed' | 'Thu' | 'Fri' | 'Sat' | 'Sun';
import { RacingDomainInvariantError } from '../errors/RacingDomainError';
export const ALL_WEEKDAYS: Weekday[] = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
export function weekdayToIndex(day: Weekday): number {
@@ -20,6 +22,6 @@ export function weekdayToIndex(day: Weekday): number {
return 7;
default:
// This should be unreachable because Weekday is a closed union.
throw new Error(`Unknown weekday: ${day}`);
throw new RacingDomainInvariantError(`Unknown weekday: ${day}`);
}
}