wow
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
export declare const isEmail: (email: string) => string | undefined;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isEmail = void 0;
|
||||
exports.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 "@".';
|
||||
}
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=regex.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"regex.js","sourceRoot":"","sources":["../../src/regex/regex.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,CAAC,KAAa,EAAsB,EAAE;IAC3D,KAAK,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IAC5B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACtB,OAAO,oBAAoB,CAAA;KAC5B;IACD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC9B,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,OAAO,6BAA6B,CAAA;KACrC;SAAM;QACL,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;QAChC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;YAC9B,OAAO,mCAAmC,CAAA;SAC3C;KACF;AACH,CAAC,CAAA"}
|
||||
Reference in New Issue
Block a user