Use string port

This commit is contained in:
Ken-Håvard Lieng 2020-05-10 02:53:39 +02:00
parent eb7545455c
commit 8fa91ac470
6 changed files with 84 additions and 93 deletions

View file

@ -121,6 +121,10 @@ export function isValidUsername(username) {
}
export function isInt(i, min, max) {
if (typeof i === 'string') {
i = parseInt(i, 10);
}
if (i < min || i > max || Math.floor(i) !== i) {
return false;
}