X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fdata%2FuserCheck.js;h=dac8ef6f0c17c8596fdffda31381571b855ac24e;hp=9eb8562235f1c8f791e462913d2070c7d5cf663c;hb=6808d7a16ec1e761c6a2dffec2281c96953e4d89;hpb=ae2c49bb0bbaac3953f63be5b720e9c6835f00b6 diff --git a/client/src/data/userCheck.js b/client/src/data/userCheck.js index 9eb85622..dac8ef6f 100644 --- a/client/src/data/userCheck.js +++ b/client/src/data/userCheck.js @@ -1,17 +1,11 @@ -export function checkNameEmail(o) -{ - if (typeof o.name === "string") - { - if (o.name.length == 0) - return "Empty name"; - if (!o.name.match(/^[\w]+$/)) - return "Bad characters in name"; +export function checkNameEmail(o) { + if (typeof o.name === "string") { + if (o.name.length == 0) return "Empty name"; + if (!o.name.match(/^[\w]+$/)) return "Bad characters in name"; } - if (typeof o.email === "string") - { - if (o.email.length == 0) - return "Empty email"; - if (!o.email.match(/^[\w.+-]+@[\w.+-]+$/)) - return "Bad characters in email"; + if (typeof o.email === "string") { + if (o.email.length == 0) return "Empty email"; + if (!o.email.match(/^[\w.+-]+@[\w.+-]+$/)) return "Bad characters in email"; } + return ""; }