How to use js-brasil - 10 common examples

To help you get started, we’ve selected a few js-brasil examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mariohmol / ng-brazil / ng-brazil / src / inscricaoestadual / validator.ts View on Github external
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 };
    };
}
github mariohmol / ng-brazil / ng-brazil / src / rg / validator.ts View on Github external
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};
}
github mariohmol / ng-brazil / ng-brazil / src / telefone / validator.ts View on Github external
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 };
}
github mariohmol / ng-brazil / ng-brazil / src / cnpj / validator.ts View on Github external
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};
}
github mariohmol / ng-brazil / ng-brazil / src / placa / validator.ts View on Github external
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};
}
github mariohmol / ng-brazil / ng-brazil / src / time / validator.ts View on Github external
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};
}
github mariohmol / ng-brazil / ng-brazil / src / percentage / validator.ts View on Github external
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 };
}
github mariohmol / ng-brazil / ng-brazil / src / cpf / validator.ts View on Github external
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};
}
github mariohmol / ng-brazil / ng-brazil / src / currency / validator.ts View on Github external
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 };
}
github mariohmol / ng-brazil / ng-brazil / src / cep / validator.ts View on Github external
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 };
}