Skip to content

Commit 783acbc

Browse files
committed
bump: 2.1.9
reducing final bundle size and fixing error from version 2.1.7
1 parent 600f882 commit 783acbc

10 files changed

+737
-32
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ BackupCopia
99
jest.config.js
1010
*.js
1111
*.mjs
12+
*.html
13+
*.cjs

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ todo.txt
55
teste.html
66
dist
77
/types/
8+
test.js
9+
test.mjs
10+
test.html
11+
test.cjs

.npmignore

+2
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,5 @@ gitpush.exe
5353
jestTestFile.js
5454
.github/
5555
dist/types/
56+
CONTRIBUTING.md
57+
test.*

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,27 @@ Feel free to find bugs and report them to me. Your feedback is highly appreciate
1818
jsDelivr:
1919

2020
```bash
21-
https://cdn.jsdelivr.net/npm/[email protected].8/dist/bundle.min.js
21+
https://cdn.jsdelivr.net/npm/[email protected].9/dist/index.min.js
2222
```
2323

2424
```html
25-
<script src="https://cdn.jsdelivr.net/npm/[email protected].8/dist/bundle.min.js"></script>
25+
<script src="https://cdn.jsdelivr.net/npm/[email protected].9/dist/index.min.js"></script>
2626
```
2727

2828
unpkg:
2929

3030
```bash
31-
https://unpkg.com/[email protected].8/dist/bundle.js
31+
https://unpkg.com/[email protected].9/dist/index.js
3232
```
3333

3434
```html
35-
<script src="https://unpkg.com/[email protected].8/dist/bundle.js"></script>
35+
<script src="https://unpkg.com/[email protected].9/dist/index.js"></script>
3636
```
3737

3838
### Example of use with CDN
3939

4040
```html
41-
<script src="https://cdn.jsdelivr.net/npm/[email protected].8/dist/bundle.min.js"></script>
41+
<script src="https://cdn.jsdelivr.net/npm/[email protected].9/dist/index.min.js"></script>
4242
<script>
4343
const emailResult = isEmail("123456");
4444
const cpfResult = cpfIsValid("123456");

index.ts

+37
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,41 @@ export {
7171
isValidTxt,
7272
};
7373

74+
export default {
75+
cpfIsValid,
76+
cnpjIsValid,
77+
isEmail,
78+
validateEmail,
79+
isCEP,
80+
validateUsername,
81+
validatePassword,
82+
getOnlyEmail,
83+
isCreditCardValid,
84+
identifyFlagCard,
85+
isMACAddress,
86+
isAscii,
87+
isBase64,
88+
isDate,
89+
isDecimal,
90+
isEmpty,
91+
isMD5,
92+
isPort,
93+
isPostalCode,
94+
isTime,
95+
validatePassportNumber,
96+
validateBRPhoneNumber,
97+
validateUSPhoneNumber,
98+
validatePhoneNumber,
99+
isNumber,
100+
passwordStrengthTester,
101+
validateName,
102+
validateSurname,
103+
validateTextarea,
104+
isValidImage,
105+
isValidAudio,
106+
isValidPdf,
107+
isValidVideo,
108+
isValidTxt,
109+
};
110+
74111
export type { ValidateFunctions, IsValidFunctions };

package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
{
22
"name": "multiform-validator",
3-
"version": "2.1.8",
4-
"description": "Javascript library made to validate, several form fields, such as: email, phone, password, cpf etc.",
3+
"version": "2.1.9",
4+
"description": "Javascript library made to validate, several form fields, such as: email, images, phone, password, cpf etc.",
55
"main": "./dist/index.js",
66
"types": "./types/index.d.ts",
7-
"unpkg": "./dist/bundle.js",
7+
"module": "./dist/index.mjs",
8+
"unpkg": "./dist/index.js",
89
"scripts": {
910
"test": "jest --coverage",
1011
"test:file": "jest tests/src/isDecimal.test --watch",
1112
"test:watch": "jest --watch",
1213
"build:types": "tsc -p tsconfig.types.json",
13-
"build:src": "tsc",
14+
"build:src": "tsup index.ts --format esm",
1415
"build:browser": "webpack",
1516
"build": "yarn build:types && yarn build:src && yarn build:browser",
1617
"lint": "eslint . --ext .ts",
@@ -57,6 +58,7 @@
5758
"Breno A"
5859
],
5960
"devDependencies": {
61+
"@swc/core": "^1.7.2",
6062
"@types/jest": "^29.5.12",
6163
"@types/mocha": "^10.0.6",
6264
"@types/node": "^20.5.1",
@@ -70,6 +72,7 @@
7072
"ts-jest": "^29.1.1",
7173
"ts-loader": "^9.5.1",
7274
"ts-node": "^10.9.2",
75+
"tsup": "^8.2.3",
7376
"typescript": "^5.4.2",
7477
"webpack": "^5.91.0",
7578
"webpack-cli": "^5.1.4"

test.mjs

-7
This file was deleted.

tsconfig.types.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"compilerOptions": {
44
"declaration": true,
55
"declarationDir": "./types",
6-
"removeComments": false
6+
"removeComments": false,
7+
"emitDeclarationOnly": true
78
}
89
}

webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const commonjsWebpackConfig = {
44
mode: "production", // production mode
55
entry: "./index.ts", // entry point of your application
66
output: {
7-
filename: "bundle.js", // output file name
7+
filename: "index.js", // output file name
88
path: path.resolve(__dirname, "dist"), // output folder
99
libraryTarget: "umd", // this allows your module to be used via require() and as a global
1010
globalObject: "this", // this ensures that 'this' is 'window' in a browser environment

0 commit comments

Comments
 (0)