fix(core): update

This commit is contained in:
2020-06-18 15:34:05 +00:00
parent 2117c2f5d9
commit 2b1f8a2718
6 changed files with 203 additions and 30 deletions

View File

@ -1 +1,2 @@
export * from './smartmail.classes.smartmail';
export * from './smartmail.classes.emailaddressvalidator';

View File

@ -0,0 +1,19 @@
import * as plugins from './smartmail.plugins';
export interface IEmailValidationResult {
valid: boolean;
reason: string;
}
export class EmailAddressValidator {
public smartdns = new plugins.smartdns.Smartdns({});
public async validate(emailArg: string): Promise<IEmailValidationResult> {
const emailArray = emailArg.split('@');
const result = await this.smartdns.getRecord(emailArray[1], 'MX');
return {
valid: !!result,
reason: 'todo'
};
}
}

View File

@ -1,4 +1,5 @@
import * as smartdns from '@pushrocks/smartdns';
import * as smartfile from '@pushrocks/smartfile';
import * as smartmustache from '@pushrocks/smartmustache';
export { smartfile, smartmustache };
export { smartdns, smartfile, smartmustache };