Use string port
This commit is contained in:
parent
eb7545455c
commit
8fa91ac470
6 changed files with 84 additions and 93 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue