mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-08 14:58:12 +03:00
switch parseInt calls for Number calls
This commit is contained in:
@@ -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.)`);
|
||||
|
||||
Reference in New Issue
Block a user