wow
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
declare type Options = {
|
||||
sender: string;
|
||||
validateRegex: boolean;
|
||||
validateMx: boolean;
|
||||
validateTypo: boolean;
|
||||
validateDisposable: boolean;
|
||||
validateSMTP: boolean;
|
||||
};
|
||||
declare type MailCheckOptions = {
|
||||
additionalTopLevelDomains?: string[];
|
||||
};
|
||||
export declare type ValidatorOptions = Partial<Options> & {
|
||||
email: string;
|
||||
} & MailCheckOptions;
|
||||
declare type ValidatorOptionsFinal = Options & {
|
||||
email: string;
|
||||
} & MailCheckOptions;
|
||||
export declare function getOptions(emailOrOptions: string | ValidatorOptions): ValidatorOptionsFinal;
|
||||
export {};
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getOptions = void 0;
|
||||
const defaultOptions = {
|
||||
email: '[email protected]',
|
||||
sender: '[email protected]',
|
||||
validateRegex: true,
|
||||
validateMx: true,
|
||||
validateTypo: true,
|
||||
validateDisposable: true,
|
||||
validateSMTP: true,
|
||||
};
|
||||
function getOptions(emailOrOptions) {
|
||||
let options = defaultOptions;
|
||||
if (typeof emailOrOptions === 'string') {
|
||||
options = Object.assign(Object.assign({}, options), { email: emailOrOptions });
|
||||
}
|
||||
else {
|
||||
options = Object.assign(Object.assign({}, options), emailOrOptions);
|
||||
}
|
||||
return options;
|
||||
}
|
||||
exports.getOptions = getOptions;
|
||||
//# sourceMappingURL=options.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/options/options.ts"],"names":[],"mappings":";;;AAAA,MAAM,cAAc,GAA0B;IAC5C,KAAK,EAAE,kBAAkB;IACzB,MAAM,EAAE,kBAAkB;IAC1B,aAAa,EAAE,IAAI;IACnB,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,IAAI;IAClB,kBAAkB,EAAE,IAAI;IACxB,YAAY,EAAE,IAAI;CACnB,CAAA;AAkBD,SAAgB,UAAU,CACxB,cAAyC;IAEzC,IAAI,OAAO,GAA0B,cAAc,CAAA;IAEnD,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;QACtC,OAAO,mCAAQ,OAAO,KAAE,KAAK,EAAE,cAAc,GAAE,CAAA;KAChD;SAAM;QACL,OAAO,mCAAQ,OAAO,GAAK,cAAc,CAAE,CAAA;KAC5C;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAXD,gCAWC"}
|
||||
Reference in New Issue
Block a user