Skip to content

Commit

Permalink
[TypeScript] Replace some type assertions with type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
rikurauhala committed Oct 22, 2024
1 parent cf280b0 commit 6334fe5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions services/backend/src/services/statMerger.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const populationCourseStatsMerger = (multiYearStats: any) => {
const courseCodes = [] as string[]
const stats = {} as Record<string, any>
const courseCodes: string[] = []
const stats: Record<string, any> = {}
stats.coursestatistics = []
stats.allStudents = 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ const passRateStudentGraphOptions = (isRelative: boolean, categories: string[],
})

const getPassRateAttemptSeriesFromStats = stats => {
const all = [] as number[]
const passed = [] as number[]
const failed = [] as number[]
const enrolledNoGrade = [] as number[]
const all: number[] = []
const passed: number[] = []
const failed: number[] = []
const enrolledNoGrade: number[] = []

stats.forEach(year => {
const { passed: p, failed: f } = year.attempts.categories
Expand Down Expand Up @@ -119,10 +119,10 @@ const getPassRateAttemptSeriesFromStats = stats => {
}

const getPassRateStudentSeriesFromStats = stats => {
const all = [] as number[]
const passed = [] as number[]
const failed = [] as number[]
const enrolledNoGrade = [] as number[]
const all: number[] = []
const passed: number[] = []
const failed: number[] = []
const enrolledNoGrade: number[] = []

stats.forEach(year => {
all.push(year.students.total || 0)
Expand Down

0 comments on commit 6334fe5

Please sign in to comment.