File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ const analyzeRow = (columns: string[]) => {
120
120
year : analyzeYear ( columns [ 4 ] ) ,
121
121
details : [ ] ,
122
122
instructor : columns [ 8 ] ,
123
+ error : false ,
123
124
}
124
125
125
126
const moduleString = columns [ 5 ]
@@ -142,15 +143,17 @@ const analyzeRow = (columns: string[]) => {
142
143
( periodArray . length === count || periodArray . length === 1 ) &&
143
144
( roomArray . length === count || roomArray . length === 1 )
144
145
)
145
- )
146
+ ) {
146
147
console . log ( 'Warning!' )
148
+ classData . error = true
149
+ }
147
150
148
151
for ( let i = 0 ; i < count ; i ++ ) {
149
152
const modules = analyzeModule (
150
- moduleArray . length === 1 ? moduleArray [ 0 ] : moduleArray [ i ] || ''
153
+ moduleArray . length === 1 ? moduleArray [ 0 ] : moduleArray [ i ] || 'unknown '
151
154
)
152
155
const when = analyzeDayAndPeriod (
153
- periodArray . length === 1 ? periodArray [ 0 ] : periodArray [ i ] || ''
156
+ periodArray . length === 1 ? periodArray [ 0 ] : periodArray [ i ] || 'unknown '
154
157
)
155
158
modules . forEach ( ( mod ) =>
156
159
when . forEach ( ( w ) =>
@@ -181,7 +184,6 @@ export default (data: Buffer): Lecture[] => {
181
184
for ( let c = 0 ; c < 16 ; c ++ )
182
185
columns . push ( sheet [ utils . encode_cell ( { r, c } ) ] . v )
183
186
if ( columns [ 0 ] === '' ) break
184
- // console.log(r)
185
187
classes . push ( analyzeRow ( columns ) )
186
188
}
187
189
console . log ( '✔ Done' )
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export interface Lecture {
13
13
room : string
14
14
} [ ]
15
15
instructor : string
16
+ error : boolean
16
17
}
17
18
18
19
export enum Module {
You can’t perform that action at this time.
0 commit comments