import { ValidationErrors, } from 'ngrx-forms'; import { CVV_REGEX, } from './../../../models/index'; export const cvvValidation = ( value: string | null, ): ValidationErrors => { return !value || CVV_REGEX.test(value.replace(/-|\s/g, '')) ? null : { cvvValidation: true, }; };