Skip to content

Commit

Permalink
fix: name of the method generateCnpj
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-logan committed Apr 11, 2024
1 parent c4f8c5c commit fb80dd3
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 40 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ This npm package provides JavaScript functions to generate valid Brazilian CPF (

unpkg:
```bash
https://unpkg.com/Gerador-CPF-e-CNPJ-valido@1.1.0/dist/bundle.js
https://unpkg.com/cpf_and_cnpj-generator@1.1.1/dist/bundle.js
```
```html
<scritp src="https://unpkg.com/Gerador-CPF-e-CNPJ-valido@1.1.0/dist/bundle.js"></script>
<scritp src="https://unpkg.com/cpf_and_cnpj-generator@1.1.1/dist/bundle.js"></script>
```

### Installation
Expand All @@ -42,25 +42,25 @@ After installing the package, you can use it in your JavaScript project:
// Using import
import generator from 'cpf_and_cnpj-generator';

console.log(generator.gnerateCnpj());
console.log(generator.generateCnpj());
console.log(generator.generateCpf());

// Or
import { gnerateCnpj, generateCpf } from 'cpf_and_cnpj-generator';
import { generateCnpj, generateCpf } from 'cpf_and_cnpj-generator';

console.log(gnerateCnpj());
console.log(generateCnpj());
console.log(generateCpf());

// Using require
const generator = require('cpf_and_cnpj-generator');

console.log('CPF generated:', generator.gnerateCnpj());
console.log('CPF generated:', generator.generateCnpj());
console.log('CNPJ generated:', generator.generateCpf());

// Or
const { generateCpf, gnerateCnpj } = require('cpf_and_cnpj-generator');
const { generateCpf, generateCnpj } = require('cpf_and_cnpj-generator');

console.log('CPF generated:', gnerateCnpj());
console.log('CPF generated:', generateCnpj());
console.log('CNPJ generated:', generateCpf());
```

Expand All @@ -80,10 +80,10 @@ https://gabriel-logan.github.io/Gerador-CPF-e-CNPJ-valido

unpkg:
```bash
https://unpkg.com/[email protected].0/dist/bundle.js
https://unpkg.com/[email protected].1/dist/bundle.js
```
```html
<scritp src="https://unpkg.com/[email protected].0/dist/bundle.js"></script>
<scritp src="https://unpkg.com/[email protected].1/dist/bundle.js"></script>
```

## Instalação
Expand All @@ -100,25 +100,25 @@ Após instalar o pacote, você pode utilizá-lo em seu projeto JavaScript:
// Usando import
import gerador from 'cpf_and_cnpj-generator';

console.log(gerador.gnerateCnpj());
console.log(gerador.generateCnpj());
console.log(gerador.generateCpf());

// Ou
import { gnerateCnpj, generateCpf } from 'cpf_and_cnpj-generator';
import { generateCnpj, generateCpf } from 'cpf_and_cnpj-generator';

console.log(gnerateCnpj());
console.log(generateCnpj());
console.log(generateCpf());

// Usando require
const gerador = require('cpf_and_cnpj-generator');

console.log('CPF Gerado:', gerador.gnerateCnpj());
console.log('CPF Gerado:', gerador.generateCnpj());
console.log('CNPJ Gerado:', gerador.generateCpf());

// Ou
const { generateCpf, gnerateCnpj } = require('cpf_and_cnpj-generator');
const { generateCpf, generateCnpj } = require('cpf_and_cnpj-generator');

console.log('CPF Gerado:', gnerateCnpj());
console.log('CPF Gerado:', generateCnpj());
console.log('CNPJ Gerado:', generateCpf());
```

Expand Down
12 changes: 6 additions & 6 deletions docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@ <h2>Como Usar</h2>
<pre><code>// Usando import
import gerador from 'cpf_and_cnpj-generator';

console.log(gerador.gnerateCnpj());
console.log(gerador.generateCnpj());
console.log(gerador.generateCpf());

// Ou
import { gnerateCnpj, generateCpf } from 'cpf_and_cnpj-generator';
import { generateCnpj, generateCpf } from 'cpf_and_cnpj-generator';

console.log(gnerateCnpj());
console.log(generateCnpj());
console.log(generateCpf());

// Usando require
const gerador = require('cpf_and_cnpj-generator');

console.log('CPF Gerado:', gerador.gnerateCnpj());
console.log('CPF Gerado:', gerador.generateCnpj());
console.log('CNPJ Gerado:', gerador.generateCpf());

// Ou
const { generateCpf, gnerateCnpj } = require('cpf_and_cnpj-generator');
const { generateCpf, generateCnpj } = require('cpf_and_cnpj-generator');

console.log('CPF Gerado:', gnerateCnpj());
console.log('CPF Gerado:', generateCnpj());
console.log('CNPJ Gerado:', generateCpf());
</code></pre>

Expand Down
12 changes: 6 additions & 6 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@ <h2>Como Usar</h2>
<pre><code>// Usando import
import gerador from 'cpf_and_cnpj-generator';

console.log(gerador.gnerateCnpj());
console.log(gerador.generateCnpj());
console.log(gerador.generateCpf());

// Ou
import { gnerateCnpj, generateCpf } from 'cpf_and_cnpj-generator';
import { generateCnpj, generateCpf } from 'cpf_and_cnpj-generator';

console.log(gnerateCnpj());
console.log(generateCnpj());
console.log(generateCpf());

// Usando require
const gerador = require('cpf_and_cnpj-generator');

console.log('CPF Gerado:', gerador.gnerateCnpj());
console.log('CPF Gerado:', gerador.generateCnpj());
console.log('CNPJ Gerado:', gerador.generateCpf());

// Ou
const { generateCpf, gnerateCnpj } = require('cpf_and_cnpj-generator');
const { generateCpf, generateCnpj } = require('cpf_and_cnpj-generator');

console.log('CPF Gerado:', gnerateCnpj());
console.log('CPF Gerado:', generateCnpj());
console.log('CNPJ Gerado:', generateCpf());
</code></pre>

Expand Down
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export = {
* @returns {string} - Returns a valid CNPJ
* @description - Made by: Logan
*/
gnerateCnpj: cnpjGenerator,
generateCnpj: cnpjGenerator,

/**
* Generates a valid CPF (Brazilian identification number).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cpf_and_cnpj-generator",
"version": "1.1.0",
"version": "1.1.1",
"description": "This repository contains a JavaScript code that generates a valid Brazilian CPF (Cadastro de Pessoas Físicas). CPF is a unique identification number assigned to individuals in Brazil. The code ensures that the generated CPF numbers follow the required validation rules and algorithms.",
"main": "dist/index.js",
"types": "types/index.d.ts",
Expand Down
5 changes: 0 additions & 5 deletions src/cnpjGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ function calculateSecondVerifier(cnpjBase: number[], firstVerifier: number) {
return remainder < 2 ? 0 : 11 - remainder;
}

/**
* Made by: Logan
* Function to generate a valid CNPJ
* @returns {string} - Returns a valid CNPJ
*/
function generateValidCNPJ(): string {
const cnpjBase: number[] = generateCNPJBase();
const firstVerifier: number = calculateFirstVerifier(cnpjBase);
Expand Down
5 changes: 0 additions & 5 deletions src/cpfGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* Generates a valid CPF (Brazilian identification number).
*
* @returns {string} - Returns a valid CPF
*/
function geraEValida(): string {
// Função que executa todo código.
const cpfStored: string[] = [];
Expand Down

0 comments on commit fb80dd3

Please sign in to comment.