mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-04 04:51:16 +08:00
missing function require
This commit is contained in:
parent
f312d23c43
commit
c2c16c3111
1 changed files with 6 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
|||
const MonkeyError = require("./error");
|
||||
|
||||
const { roundTo2 } = require("./misc");
|
||||
|
||||
function isUsernameValid(name) {
|
||||
if (name === null || name === undefined || name === "") return false;
|
||||
if (/miodec/.test(name.toLowerCase())) return false;
|
||||
|
@ -117,9 +119,11 @@ function validateObjectValues(val) {
|
|||
errCount += validateObjectValues(val[valkey]);
|
||||
});
|
||||
} else {
|
||||
if (!/^[0-9a-zA-Z._\-\+]+$/.test(val)) errCount++;
|
||||
if (!/^[0-9a-zA-Z._\-+]+$/.test(val)) {
|
||||
errCount++;
|
||||
}
|
||||
}
|
||||
return errCount == 0;
|
||||
return errCount;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
|
Loading…
Reference in a new issue