Skip to content

Instantly share code, notes, and snippets.

View Alex-Lima84's full-sized avatar
😃

Alexandre Luiz Alex-Lima84

😃
View GitHub Profile
@joaohcrangel
joaohcrangel / validation-cpf.ts
Last active June 25, 2024 15:16
Função para validar CPF em TypeScript
function isValidCPF(value: string) {
if (typeof value !== 'string') {
return false;
}
value = value.replace(/[^\d]+/g, '');
if (value.length !== 11 || !!value.match(/(\d)\1{10}/)) {
return false;
}