Compare commits

..

No commits in common. '29df1a24d474db31f31dca68ff4ff50b6b481fd1' and '3d2fdce169409b84e1256549391e7c02245b69bc' have entirely different histories.

@ -3,16 +3,11 @@
const ValidationError = require("@validatem/error");
const isString = require("@validatem/is-string");
let commonErrors = [
/^mailto:.+$/, // mailto:email@example.com
/^.+<[^>]+>$/, // Real Name <email@example.com>
];
module.exports = [
isString,
function isEmailAddress(value) {
// TODO: Include explanation in README as to how checking for the presence of '@' really *is* the correct check in practice, and that any further validation should be done by actually trying to send an e-mail
if (!value.includes("@") || commonErrors.some((errorRegex) => errorRegex.test(value))) {
// TODO: Include explanation in README as to how this really *is* the correct check in practice, and that any further validation should be done by actually trying to send an e-mail
if (!value.includes("@")) {
throw new ValidationError(`Must be an e-mail address`);
}
}

@ -5,7 +5,7 @@
"validatem",
"validator"
],
"version": "0.1.1",
"version": "0.1.0",
"main": "index.js",
"repository": "http://git.cryto.net/validatem/is-email-address.git",
"author": "Sven Slootweg <admin@cryto.net>",

Loading…
Cancel
Save