Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
required: {
func: Validators.required
},
requiredTrue: {
func: Validators.requiredTrue
},
base64: {
func: CustomValidators.base64,
params: ["min"]
},
creditCard: {
func: CustomValidators.creditCard
},
date: {
func: CustomValidators.date
},
dateISO: {
func: CustomValidators.dateISO
},
digits: {
func: CustomValidators.digits
},
equal: {
func: CustomValidators.equal,
params: ["equal"]
},
equalTo: {
func: CustomValidators.equalTo,
params: ["equalTo"]
},
gt: {
const foundEqualToControl = availableControls[validator.validatorOption]
if (!!foundEqualToControl) {
formValidators.push(CustomValidators.equalTo(foundEqualToControl))
}
break
case ValidatorType.Email:
formValidators.push(CustomValidators.email)
break
case ValidatorType.Number:
formValidators.push(CustomValidators.number)
break
case ValidatorType.NumberRange:
formValidators.push(CustomValidators.range(JSON.parse(validator.validatorOption)))
break
case ValidatorType.DateTime:
formValidators.push(CustomValidators.date)
break
case ValidatorType.MinDate:
formValidators.push(CustomValidators.minDate(validator.validatorOption))
break
case ValidatorType.MaxDate:
formValidators.push(CustomValidators.maxDate(validator.validatorOption))
break
case ValidatorType.Regex:
formValidators.push(Validators.pattern(validator.validatorOption))
break
case ValidatorType.MinLength:
formValidators.push(Validators.minLength(parseInt(validator.validatorOption)))
break
case ValidatorType.MaxLength:
formValidators.push(Validators.maxLength(parseInt(validator.validatorOption)))
break