switch parseInt calls for Number calls

This commit is contained in:
zkldi
2021-04-20 23:40:18 +01:00
parent 7f21312bd1
commit 43bfd07219
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ export function PRIVATEINFO_GetUserWithID(userID: integer) {
export function ResolveUser(usernameOrID: string) {
// user ID passed
if (usernameOrID.match(/^[0-9]$/)) {
let intID = parseInt(usernameOrID, 10);
let intID = Number(usernameOrID);
return db.users.findOne(
{
@@ -9,7 +9,7 @@ export function AssertStrAsPositiveInt(strVal: string, errorMessage: string) {
throw new InvalidScoreFailure(`${errorMessage} (Not an integer.)`);
}
let val = parseInt(strVal, 10);
let val = Number(strVal);
if (Number.isNaN(val)) {
throw new InvalidScoreFailure(`${errorMessage} (Not a number.)`);
@@ -29,7 +29,7 @@ export function AssertStrAsPositiveNonZeroInt(strVal: string, errorMessage: stri
throw new InvalidScoreFailure(`${errorMessage} (Not an integer.)`);
}
let val = parseInt(strVal, 10);
let val = Number(strVal);
if (Number.isNaN(val)) {
throw new InvalidScoreFailure(`${errorMessage} (Not a number.)`);