Revise server code + a few fixes in trnalsations and ComputerGame
[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";
866842c3 4 if (!o.name.match(/^[\w]+$/)) return "Name: alphanumerics and underscore";
dac39588 5 }
910d631b 6
6808d7a1
BA
7 if (typeof o.email === "string") {
8 if (o.email.length == 0) return "Empty email";
866842c3 9 if (!o.email.match(/^[\w.+-]+@[\w.+-]+$/)) return "Invalid email";
dac39588 10 }
910d631b 11
6808d7a1 12 return "";
8a477a7e 13}