Add well-formed timetable validation check
Closed this issue · 0 comments
kokrui commented
Right now, NUSMods just checks on load for whether a timetable object exists. This could potentially cause issues since we never explicitly check that data
is of type PageData
. Notice here that data
is implicitly converted from any
as returned in JSON.parse
to PageData
, received as a parameter to validatePageData
.
Lines 49 to 50 in 47238fa
Lines 66 to 71 in 089993f
We could implement a basic check that the data it contains is well-formed according to PageData
's type definition.