fix: support classes with no location (#242)

This commit is contained in:
Samuel Gunter
2024-09-30 22:43:09 -05:00
committed by GitHub
parent e2cbfa3f48
commit 3ff06e043b

View File

@@ -72,10 +72,12 @@ export class CourseSchedule {
days,
startTime,
endTime,
location: {
building: location[0] ?? '',
room: location[1] ?? '',
},
location: location[0]
? {
building: location[0],
room: location[1] ?? '',
}
: undefined,
} satisfies Serialized<CourseMeeting>);
} catch (e) {
throw new Error(`Failed to parse schedule: ${dayLine} ${timeLine} ${locLine}`);