Faz somente verifica atravez de um regex se a chave tem o formato válido, pelo CPF, TELEFONE, E-MAIL ou chave Aleatória. E retorna ela formatada e tipo chave inserida e se o valor e valido
npm i @starley/validacao-pix
Importe dentro do modulo que ira utilizar
my-component.module.ts
import { ValidacaoPix } from '@starley/validacao-pix';
export class MyComponent {
constructor (private validacaoPix: ValidacaoPix)
}
Ele ira retornar os valores chavePix, tipoChave, isValid!
my-component.ts
let pixValido: {chavePix, tipoChave, isValid} = this.validacaoPix.validarChavePIX(chavePix);
console.log("🚀 ~ :", pixValido)