Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
fix: add initial value in reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
Vahor committed Apr 20, 2024
1 parent ea66905 commit a518e78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/algorithms/src/generate_classes/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default class Class {
typeof attribute === "number" ? attribute : attribute.key(),
) ?? 0,
)
.reduce((acc, cur) => acc + cur);
.reduce((acc, cur) => acc + cur, 0);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/algorithms/src/generate_classes/rules/rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export abstract class Rule {
return entry
.students()
.map((student) => entry.studentValue(student, this).value)
.reduce((acc, cur) => acc + cur);
.reduce((acc, cur) => acc + cur, 0);
}

/**
Expand Down

0 comments on commit a518e78

Please sign in to comment.