Skip to content

Commit

Permalink
bugs fixeds
Browse files Browse the repository at this point in the history
  • Loading branch information
Flaviano-Rodrigues committed Jan 12, 2023
1 parent 856fe8c commit 37c00ef
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules
src
package-lock.json
tsconfig.json
tsconfig.json
.github
.eslintrc.json
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flaformatter",
"version": "2.0.2",
"version": "2.0.3",
"description": "A formatter to easily your code",
"homepage": "https://github.com/Flaviano-Rodrigues/flaformatter",
"repository": {
Expand All @@ -13,7 +13,7 @@
"scripts": {
"test": "node test.js",
"build": "tsc --build && npm run minify",
"minify": "esbuild dist/index.js --minify --outfile=dist/index.js --bundle --target=es2016 --allow-overwrite",
"minify": "esbuild dist/index.js --minify --outfile=dist/index.js --allow-overwrite",
"lint": "eslint ."
},
"prepublish": "npm run build",
Expand Down
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ interface e {
}
}

const flaformatter = (e: e, type: string, setMax = false, callback = null): void => {
const flaformatter = (
e: e,
type: 'letters' | 'rg' | 'cpf' | 'cnpj' | 'cpf/cnpj' | 'telefone' | 'int' | 'celular' | 'data' | 'cep' | 'money' | 'card',
setMax = false,
callback = null
): void => {
// retira os caracteres indesejados...
let val = type === 'letters' ? e.target.value.replace(/[^a-zA-Z]/g, '') : e.target.value.replace(/[^\d]/g, '')

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"module": "ESNext",
"rootDir": "./src",
"declaration": true,
"outDir": "./dist",
Expand Down

0 comments on commit 37c00ef

Please sign in to comment.