@sebgroup/frontend-tools
Version:
A set of frontend tools
16 lines (12 loc) • 511 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
/**
* Check if an email is valid
* @param {string} value email
* @returns {boolean} true if email is valid, false if email is not valid
*/
function isEmail(value) {
return new RegExp(/^(([^<>()\[\]\\.,;:\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,}))$/).test(value);
}
exports.isEmail = isEmail;
//# sourceMappingURL=isEmail.js.map