UNPKG

@webnotion-net/typescript-model-validator

Version:

Flexible and extensible library for validating data models in TypeScript

16 lines (15 loc) 512 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Email = /** @class */ (function () { function Email() { } Email.prototype.validate = function (email) { var emailRegex = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/; return emailRegex.test(email); }; Email.prototype.getErrorMessage = function () { return "The provided email is invalid. Please double-check and try again."; }; return Email; }()); exports.default = Email;