Skip to content

Commit

Permalink
bump: 2.1.9
Browse files Browse the repository at this point in the history
reducing final bundle size and fixing error from version 2.1.7
  • Loading branch information
gabriel-logan committed Jul 26, 2024
1 parent 600f882 commit 783acbc
Show file tree
Hide file tree
Showing 10 changed files with 737 additions and 32 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ BackupCopia
jest.config.js
*.js
*.mjs
*.html
*.cjs
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ todo.txt
teste.html
dist
/types/
test.js
test.mjs
test.html
test.cjs
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ gitpush.exe
jestTestFile.js
.github/
dist/types/
CONTRIBUTING.md
test.*
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@ Feel free to find bugs and report them to me. Your feedback is highly appreciate
jsDelivr:

```bash
https://cdn.jsdelivr.net/npm/multiform-validator@2.1.8/dist/bundle.min.js
https://cdn.jsdelivr.net/npm/multiform-validator@2.1.9/dist/index.min.js
```

```html
<script src="https://cdn.jsdelivr.net/npm/multiform-validator@2.1.8/dist/bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/multiform-validator@2.1.9/dist/index.min.js"></script>
```

unpkg:

```bash
https://unpkg.com/multiform-validator@2.1.8/dist/bundle.js
https://unpkg.com/multiform-validator@2.1.9/dist/index.js
```

```html
<script src="https://unpkg.com/multiform-validator@2.1.8/dist/bundle.js"></script>
<script src="https://unpkg.com/multiform-validator@2.1.9/dist/index.js"></script>
```

### Example of use with CDN

```html
<script src="https://cdn.jsdelivr.net/npm/multiform-validator@2.1.8/dist/bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/multiform-validator@2.1.9/dist/index.min.js"></script>
<script>
const emailResult = isEmail("123456");
const cpfResult = cpfIsValid("123456");
Expand Down
37 changes: 37 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,41 @@ export {
isValidTxt,
};

export default {
cpfIsValid,
cnpjIsValid,
isEmail,
validateEmail,
isCEP,
validateUsername,
validatePassword,
getOnlyEmail,
isCreditCardValid,
identifyFlagCard,
isMACAddress,
isAscii,
isBase64,
isDate,
isDecimal,
isEmpty,
isMD5,
isPort,
isPostalCode,
isTime,
validatePassportNumber,
validateBRPhoneNumber,
validateUSPhoneNumber,
validatePhoneNumber,
isNumber,
passwordStrengthTester,
validateName,
validateSurname,
validateTextarea,
isValidImage,
isValidAudio,
isValidPdf,
isValidVideo,
isValidTxt,
};

export type { ValidateFunctions, IsValidFunctions };
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"name": "multiform-validator",
"version": "2.1.8",
"description": "Javascript library made to validate, several form fields, such as: email, phone, password, cpf etc.",
"version": "2.1.9",
"description": "Javascript library made to validate, several form fields, such as: email, images, phone, password, cpf etc.",
"main": "./dist/index.js",
"types": "./types/index.d.ts",
"unpkg": "./dist/bundle.js",
"module": "./dist/index.mjs",
"unpkg": "./dist/index.js",
"scripts": {
"test": "jest --coverage",
"test:file": "jest tests/src/isDecimal.test --watch",
"test:watch": "jest --watch",
"build:types": "tsc -p tsconfig.types.json",
"build:src": "tsc",
"build:src": "tsup index.ts --format esm",
"build:browser": "webpack",
"build": "yarn build:types && yarn build:src && yarn build:browser",
"lint": "eslint . --ext .ts",
Expand Down Expand Up @@ -57,6 +58,7 @@
"Breno A"
],
"devDependencies": {
"@swc/core": "^1.7.2",
"@types/jest": "^29.5.12",
"@types/mocha": "^10.0.6",
"@types/node": "^20.5.1",
Expand All @@ -70,6 +72,7 @@
"ts-jest": "^29.1.1",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"tsup": "^8.2.3",
"typescript": "^5.4.2",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
Expand Down
7 changes: 0 additions & 7 deletions test.mjs

This file was deleted.

3 changes: 2 additions & 1 deletion tsconfig.types.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"compilerOptions": {
"declaration": true,
"declarationDir": "./types",
"removeComments": false
"removeComments": false,
"emitDeclarationOnly": true
}
}
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const commonjsWebpackConfig = {
mode: "production", // production mode
entry: "./index.ts", // entry point of your application
output: {
filename: "bundle.js", // output file name
filename: "index.js", // output file name
path: path.resolve(__dirname, "dist"), // output folder
libraryTarget: "umd", // this allows your module to be used via require() and as a global
globalObject: "this", // this ensures that 'this' is 'window' in a browser environment
Expand Down
Loading

0 comments on commit 783acbc

Please sign in to comment.