18 lines
449 B
JavaScript
18 lines
449 B
JavaScript
var Validations = {
|
|
_emailRe: /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
isValidEmail: function(value) {
|
|
return this._emailRe.test(value);
|
|
|
|
},
|
|
isValidRequired: function(value) {
|
|
if(value === undefined || value === "") {
|
|
return false;
|
|
}
|
|
return true;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = Validations;
|