![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Gerador, validador e formatador de CPF que roda tanto no navegador quanto no servidor. Super pequeno, apenas 447 Bytes gzipped.
(README available in english in README-en).
Instale a última versão do cpf-check:
npm install cpf-check --save
Agora é só usá-lo no seu index.html
<script type="text/javascript" src="./node_modules/cpf-check/dist/index.umd.js"></script>
// window.CPF
Ou importa-lo como um módulo:
const CPF = require('cpf-check');
// ou, em ES6+
import CPF from 'cpf-check';
Esse módulo é compativel com o padrão UMD, portanto é compatível com o RequireJs, AMD, CommonJs 1 e 2, etc.
Assinatura do método:
validate(algumCpf: any): boolean;
import CPF, { validate } from 'cpf-check';
const algumCpf = '676.754.677-10';
CPF.validate(algumCpf);
// « true
validate(algumCpf);
// « true
validate('não-cpf');
// « false
validate('12345678910');
// « false
Assinatura do método:
generate(formatar?: boolean): string;
Esse método gera CPFs válidos.
import CPF, { generate } from 'cpf-check';
CPF.generate();
// « '67675467710'
generate(true);
// « '676.754.677-10'
generate();
// « '67675467710'
Assinatura do método:
format(algumCpf: any): string;
Esse método adiciona pontuação a strings de CPFs.
import CPF, { format } from 'cpf-check';
const meuCpf = '67675467710';
CPF.format(meuCpf);
// « '676.754.677-10'
format(meuCpf);
// « '676.754.677-10'
format('não-cpf');
// « ''
Assinatura do método:
strip(algumCpf: any): string;
Esse método retira caracteres não numéricos de uma string.
import CPF, { strip } from 'cpf-check';
const algumCpf = '676.754.677-10';
CPF.strip(algumCpf);
// « '67675467710'
strip(algumCpf);
// « '67675467710'
Copyright (c) 2019 Marcel de Oliveira Coelho sob a Licença MIT. Go Crazy. :rocket:
FAQs
Validador de CPF Moderno, Isomórfico e Super Leve.
The npm package cpf-check receives a total of 311 weekly downloads. As such, cpf-check popularity was classified as not popular.
We found that cpf-check demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.