UNPKG

deep-email-validator-extended

Version:

Validates emails based on regex, common typos, disposable email blacklists, DNS records and SMTP server response.

21 lines 585 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isEmail = void 0; const isEmail = (email) => { email = (email || '').trim(); if (email.length === 0) { return 'Email not provided'; } const split = email.split('@'); if (split.length < 2) { return 'Email does not contain "@".'; } else { const [domain] = split.slice(-1); if (domain.indexOf('.') === -1) { return 'Must contain a "." after the "@".'; } } }; exports.isEmail = isEmail; //# sourceMappingURL=regex.js.map