1 function checkNameEmail(o
)
3 if (typeof o
.name
=== "string")
5 if (o
.name
.length
== 0)
7 if (!o
.name
.match(/^[\w]+$/))
8 return "Bad characters in name";
10 if (typeof o
.email
=== "string")
12 if (o
.email
.length
== 0)
14 if (!o
.email
.match(/^[\w.+-]+@[\w.+-]+$/))
15 return "Bad characters in email";
19 module
.exports
= checkNameEmail
;