Skip to content

Commit

Permalink
🐛 📦 Slay the hydra, sync the lock file
Browse files Browse the repository at this point in the history
  • Loading branch information
GilbertGobbels committed Aug 24, 2019
1 parent 940afaa commit 58b5518
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 31 deletions.
39 changes: 8 additions & 31 deletions Commands/Public/strike.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,37 +43,14 @@ module.exports = async ({ Constants: { Text, Colors }, client }, { serverDocumen
modlog_entry: ModLogID,
});

const strikeLength = String(targetMemberQueryDocument.val.strikes.length);
let strikeAmount;
if (targetMemberQueryDocument.val.strikes.length < 20) {
switch (strikeLength) {
case "1":
strikeAmount = "first";
break;
case "2":
strikeAmount = "second";
break;
case "3":
strikeAmount = "third";
break;
default:
strikeAmount = `${strikeLength}th`;
}
} else {
switch (strikeLength.charAt(strikeLength.length - 1)) {
case "1":
strikeAmount = `${strikeLength}st`;
break;
case "2":
strikeAmount = `${strikeLength}nd`;
break;
case "3":
strikeAmount = `${strikeLength}rd`;
break;
default:
strikeAmount = `${strikeLength}th`;
}
}
const strikeLength = targetMemberQueryDocument.val.strikes.length;
const lastDigit = strikeLength % 10;
const lastTwoDigits = strikeLength % 100;
const suffix = lastTwoDigits > 10 && lastTwoDigits < 20 ? "th" :
lastDigit === 1 ? "st" :
lastDigit === 2 ? "nd" :
lastDigit === 3 ? "rd" : "th";
const strikeAmount = `${strikeLength}${suffix}`;

let success = true;
try {
Expand Down
4 changes: 4 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 58b5518

Please sign in to comment.