diff --git a/src/validation/validators/email-validation/email-validation.ts b/src/validation/validators/email-validation/email-validation.ts new file mode 100644 index 0000000..52f4359 --- /dev/null +++ b/src/validation/validators/email-validation/email-validation.ts @@ -0,0 +1,10 @@ +import {InvalidFieldError} from '@/validation/errors'; +import {FieldValidation} from '@/validation/protocols'; + +export class EmailValidation implements FieldValidation { + constructor(readonly field: string) {} + validate(value: string): Error { + console.log(value); + return new InvalidFieldError('email'); + } +} diff --git a/src/validation/validators/index.ts b/src/validation/validators/index.ts index fbb9de2..5b98390 100644 --- a/src/validation/validators/index.ts +++ b/src/validation/validators/index.ts @@ -1 +1,2 @@ +export * from './email-validation/email-validation'; export * from './required-field/required-field-validation';