import { FieldValidation } from '@/validation/protocols' ; import { RequiredFieldError } from '@/validation/errors' ; export class RequiredFieldValidation implements FieldValidation { constructor ( readonly field ) { } validate ( input ) { return input [ this . field ] ? null : new RequiredFieldError ( ) ; } }