import { AbstractControl, ValidationErrors } from "@angular/forms";

export class CantContainWhiteSpaceValidator {
  static cantContainSpace(control: AbstractControl): ValidationErrors | null {
    if (control?.value) {
      if ((control.value as string).indexOf(" ") >= 0) {
        return { cantContainSpace: true };
      }
    }
    return null;
  }
}
