Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return (control: AbstractControl): { [key: string]: boolean } => {
if (utilsBr.isPresent(Validators.required(control))) {
return null;
}
const v: string = control.value;
return validateBr.inscricaoestadual(v, estado) ? null : { inscricaoestadual: true };
};
}
export const rg: ValidatorFn = (control: AbstractControl): {[key: string]: boolean} => {
if (utilsBr.isPresent(Validators.required(control))) {
return null;
}
const v: string = control.value;
return validateBr.rg(v) ? null : {rg: true};
}
export const telefone: ValidatorFn = (control: AbstractControl): { [key: string]: boolean } => {
if (utilsBr.isPresent(Validators.required(control))) {
return null;
}
const v: string = control.value;
return validateBr.telefone(v) ? null : { telefone: true };
}
export const cnpj: ValidatorFn = (control: AbstractControl): {[key: string]: boolean} => {
if (utilsBr.isPresent(Validators.required(control))) {
return null;
}
const v: string = control.value;
return validateBr.cnpj(v) ? null : {cnpj: true};
}
export const placa: ValidatorFn = (control: AbstractControl): {[key: string]: boolean} => {
if (utilsBr.isPresent(Validators.required(control))) {
return null;
}
const v: string = control.value;
return validateBr.placa(v) ? null : {placa: true};
}
export const time: ValidatorFn = (control: AbstractControl): {[key: string]: boolean} => {
if (utilsBr.isPresent(Validators.required(control))) {
return null;
}
const v: string = control.value;
return validateBr.time(v) ? null : {time: true};
}
export const percentage: ValidatorFn = (control: AbstractControl): { [key: string]: boolean } => {
if (utilsBr.isPresent(Validators.required(control))) {
return null;
}
const v: string = control.value;
return validateBr.porcentagem(v) ? null : { percentage: true };
}
export const cpf: ValidatorFn = (control: AbstractControl): {[key: string]: boolean} => {
if (utilsBr.isPresent(Validators.required(control))) {
return null;
}
const v: string = control.value;
return validateBr.cpf(v) ? null : {cpf: true};
}
export const currency: ValidatorFn = (control: AbstractControl): { [key: string]: boolean } => {
if (utilsBr.isPresent(Validators.required(control))) {
return null;
}
const v: string = control.value;
return validateBr.currency(v) ? null : { currency: true };
}
export const cep: ValidatorFn = (control: AbstractControl): { [key: string]: boolean } => {
if (utilsBr.isPresent(Validators.required(control))) {
return null;
}
const v: string = control.value;
return validateBr.cep(v) ? null : { cep: true };
}