Started code review + some fixes (unfinished)
[vchess.git] / client / src / data / userCheck.js
CommitLineData
6808d7a1
BA
1export function checkNameEmail(o) {
2 if (typeof o.name === "string") {
3 if (o.name.length == 0) return "Empty name";
4 if (!o.name.match(/^[\w]+$/)) return "Bad characters in name";
dac39588 5 }
6808d7a1
BA
6 if (typeof o.email === "string") {
7 if (o.email.length == 0) return "Empty email";
8 if (!o.email.match(/^[\w.+-]+@[\w.+-]+$/)) return "Bad characters in email";
dac39588 9 }
6808d7a1 10 return "";
8a477a7e 11}