Skip to content

Commit

Permalink
feat: add assmuptions on values
Browse files Browse the repository at this point in the history
  • Loading branch information
littlebtc committed Jul 26, 2021
1 parent 67678e2 commit 5dccbc2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/dx_intl/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ const parsePlayer = (
const courseRank = parseInt(rawCourseRank, 10)
const classRank = parseInt(rawClassRank, 10)
assertBetween(rating, 0, 17000, "rating")
// We will not have assertion on the new grades until it is confirmed.
assertBetween(courseRank, 0, 22, "courseRank")
assertBetween(classRank, 0, 25, "classRank")
if (courseRank === 11) {
throw new Error("11 is not a expected course rank value")
}
return {
card_name: cardName,
title,
Expand Down

0 comments on commit 5dccbc2

Please sign in to comment.