umt 2.10.1 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/module/Advance/rangeAdvance.d.ts +1 -1
- package/module/Advance/rangeAdvance.js.map +1 -1
- package/module/Array/checkFlagAlignment.js +3 -0
- package/module/Array/checkFlagAlignment.js.map +1 -1
- package/module/Array/compact.js.map +1 -1
- package/module/Array/dualPivotQuickSort.js +4 -3
- package/module/Array/dualPivotQuickSort.js.map +1 -1
- package/module/Array/getArraysCommon.js +33 -12
- package/module/Array/getArraysCommon.js.map +1 -1
- package/module/Array/groupBy.js +1 -1
- package/module/Array/insertionSort.js +4 -10
- package/module/Array/insertionSort.js.map +1 -1
- package/module/Array/quickSort.js +4 -3
- package/module/Array/quickSort.js.map +1 -1
- package/module/Array/range.js +1 -1
- package/module/Array/range.js.map +1 -1
- package/module/Array/sortingHelpers/applyInsertionSortIfNeeded.js +2 -2
- package/module/Array/sortingHelpers/applyInsertionSortIfNeeded.js.map +1 -1
- package/module/Array/sortingHelpers/insertionSortRange.d.ts +5 -0
- package/module/Array/sortingHelpers/insertionSortRange.js +15 -0
- package/module/Array/sortingHelpers/insertionSortRange.js.map +1 -0
- package/module/Array/timSort.js +7 -5
- package/module/Array/timSort.js.map +1 -1
- package/module/Array/ultraNumberSort.js +18 -18
- package/module/Array/ultraNumberSort.js.map +1 -1
- package/module/Color/hexaToRgba.d.ts +1 -1
- package/module/Color/hexaToRgba.js +1 -1
- package/module/Consts/clock.d.ts +1 -1
- package/module/Consts/clock.js.map +1 -1
- package/module/Crypto/decodeBase58.js +4 -4
- package/module/Crypto/decodeBase58.js.map +1 -1
- package/module/Crypto/encodeBase58.js +4 -4
- package/module/Crypto/encodeBase58.js.map +1 -1
- package/module/DataStructure/priorityQueue.d.ts +4 -4
- package/module/DataStructure/priorityQueue.js +3 -2
- package/module/DataStructure/priorityQueue.js.map +1 -1
- package/module/Date/dayOfWeek.js +1 -1
- package/module/Date/format.js +1 -1
- package/module/IP/ipToBinaryString.js +1 -1
- package/module/IP/ipToBinaryString.js.map +1 -1
- package/module/IP/subnetMaskToCidr.js +1 -1
- package/module/IP/subnetMaskToCidr.js.map +1 -1
- package/module/Math/calculator/core.js +15 -5
- package/module/Math/calculator/core.js.map +1 -1
- package/module/Math/gcd.js +5 -2
- package/module/Math/gcd.js.map +1 -1
- package/module/Math/mathConverter.js +1 -1
- package/module/Math/mathConverter.js.map +1 -1
- package/module/Math/mode.js +3 -2
- package/module/Math/mode.js.map +1 -1
- package/module/Math/nCr.js +4 -1
- package/module/Math/nCr.js.map +1 -1
- package/module/Math/nPr.js +4 -1
- package/module/Math/nPr.js.map +1 -1
- package/module/Math/primeFactorization.js +5 -1
- package/module/Math/primeFactorization.js.map +1 -1
- package/module/Math/reduce.js +4 -1
- package/module/Math/reduce.js.map +1 -1
- package/module/Math/solveEquation.js +1 -1
- package/module/Math/solveEquation.js.map +1 -1
- package/module/Math/uuidv7.js +11 -14
- package/module/Math/uuidv7.js.map +1 -1
- package/module/Object/mergeDeep.js.map +1 -1
- package/module/Object/omit.js +1 -0
- package/module/Object/omit.js.map +1 -1
- package/module/Object/pickDeep.js +1 -1
- package/module/String/formatString/applyFormatter.js +1 -1
- package/module/String/formatString/applyFormatter.js.map +1 -1
- package/module/String/formatString/getValue.js +1 -1
- package/module/String/formatString/getValue.js.map +1 -1
- package/module/String/fromBase64.js +2 -1
- package/module/String/fromBase64.js.map +1 -1
- package/module/String/fuzzySearch.d.ts +2 -2
- package/module/String/fuzzySearch.js +2 -1
- package/module/String/fuzzySearch.js.map +1 -1
- package/module/String/levenshteinDistance.d.ts +2 -2
- package/module/String/levenshteinDistance.js +28 -18
- package/module/String/levenshteinDistance.js.map +1 -1
- package/module/String/padStart.d.ts +0 -1
- package/module/String/padStart.js +2 -6
- package/module/String/padStart.js.map +1 -1
- package/module/String/reverseString.js +1 -1
- package/module/String/reverseString.js.map +1 -1
- package/module/Tool/index.d.ts +1 -0
- package/module/Tool/index.js +1 -0
- package/module/Tool/index.js.map +1 -1
- package/module/Tool/unwrap.d.ts +9 -0
- package/module/Tool/unwrap.js +15 -0
- package/module/Tool/unwrap.js.map +1 -0
- package/module/Validate/array/core.js +1 -1
- package/module/Validate/core/index.js +2 -2
- package/module/Validate/index.d.ts +1 -0
- package/module/Validate/index.js +1 -0
- package/module/Validate/index.js.map +1 -1
- package/module/Validate/isDeepEqual.js.map +1 -1
- package/module/Validate/object/core.js +1 -1
- package/module/Validate/parseEmail.d.ts +14 -0
- package/module/Validate/parseEmail.js +24 -0
- package/module/Validate/parseEmail.js.map +1 -0
- package/module/Validate/string/index.d.ts +1 -1
- package/module/Validate/string/index.js +1 -1
- package/module/Validate/string/index.js.map +1 -1
- package/module/Validate/string/uuid.js +10 -11
- package/module/Validate/string/uuid.js.map +1 -1
- package/module/Validate/string/{email.d.ts → validateEmail.d.ts} +2 -1
- package/module/Validate/string/validateEmail.js +23 -0
- package/module/Validate/string/validateEmail.js.map +1 -0
- package/module/es5/Advance/rangeAdvance.d.ts +1 -1
- package/module/es5/Array/checkFlagAlignment.js +3 -0
- package/module/es5/Array/dualPivotQuickSort.js +10 -3
- package/module/es5/Array/getArraysCommon.js +45 -19
- package/module/es5/Array/groupBy.js +2 -1
- package/module/es5/Array/insertionSort.js +10 -10
- package/module/es5/Array/quickSort.js +10 -3
- package/module/es5/Array/range.js +1 -1
- package/module/es5/Array/sortingHelpers/applyInsertionSortIfNeeded.js +2 -2
- package/module/es5/Array/sortingHelpers/insertionSortRange.d.ts +5 -0
- package/module/es5/Array/sortingHelpers/insertionSortRange.js +20 -0
- package/module/es5/Array/timSort.js +13 -5
- package/module/es5/Array/ultraNumberSort.js +38 -34
- package/module/es5/Color/hexaToRgba.d.ts +1 -1
- package/module/es5/Color/hexaToRgba.js +1 -1
- package/module/es5/Consts/clock.d.ts +1 -1
- package/module/es5/Crypto/decodeBase58.js +4 -4
- package/module/es5/Crypto/encodeBase58.js +4 -4
- package/module/es5/DataStructure/priorityQueue.d.ts +4 -4
- package/module/es5/DataStructure/priorityQueue.js +3 -2
- package/module/es5/Date/dayOfWeek.js +2 -1
- package/module/es5/Date/format.js +1 -1
- package/module/es5/IP/ipToBinaryString.js +1 -1
- package/module/es5/IP/subnetMaskToCidr.js +1 -1
- package/module/es5/Math/calculator/core.js +15 -5
- package/module/es5/Math/gcd.js +5 -2
- package/module/es5/Math/mathConverter.js +1 -1
- package/module/es5/Math/mode.js +4 -4
- package/module/es5/Math/nCr.js +4 -1
- package/module/es5/Math/nPr.js +4 -1
- package/module/es5/Math/primeFactorization.js +8 -1
- package/module/es5/Math/reduce.js +8 -1
- package/module/es5/Math/solveEquation.js +1 -1
- package/module/es5/Math/uuidv7.js +13 -14
- package/module/es5/Object/omit.js +1 -0
- package/module/es5/Object/pickDeep.js +2 -1
- package/module/es5/String/formatString/applyFormatter.js +1 -1
- package/module/es5/String/formatString/getValue.js +1 -1
- package/module/es5/String/formatString/index.js +1 -1
- package/module/es5/String/fromBase64.js +2 -1
- package/module/es5/String/fuzzySearch.d.ts +2 -2
- package/module/es5/String/fuzzySearch.js +2 -1
- package/module/es5/String/hasNoLetters.js +1 -1
- package/module/es5/String/levenshteinDistance.d.ts +2 -2
- package/module/es5/String/levenshteinDistance.js +33 -30
- package/module/es5/String/padStart.d.ts +0 -1
- package/module/es5/String/padStart.js +2 -7
- package/module/es5/String/reverseString.js +1 -1
- package/module/es5/Tool/index.d.ts +1 -0
- package/module/es5/Tool/index.js +11 -0
- package/module/es5/Tool/unwrap.d.ts +9 -0
- package/module/es5/Tool/unwrap.js +20 -0
- package/module/es5/Validate/array/core.js +1 -1
- package/module/es5/Validate/core/index.js +3 -2
- package/module/es5/Validate/index.d.ts +1 -0
- package/module/es5/Validate/index.js +11 -0
- package/module/es5/Validate/object/core.js +1 -1
- package/module/es5/Validate/parseEmail.d.ts +14 -0
- package/module/es5/Validate/parseEmail.js +48 -0
- package/module/es5/Validate/string/index.d.ts +1 -1
- package/module/es5/Validate/string/index.js +4 -4
- package/module/es5/Validate/string/uuid.js +7 -4
- package/module/es5/Validate/string/{email.d.ts → validateEmail.d.ts} +2 -1
- package/module/es5/Validate/string/validateEmail.js +31 -0
- package/module/es5/tsconfig.tsbuildinfo +1 -1
- package/package.json +70 -43
- package/module/Validate/string/email.js +0 -45
- package/module/Validate/string/email.js.map +0 -1
- package/module/es5/Validate/string/email.js +0 -62
package/package.json
CHANGED
|
@@ -5,35 +5,39 @@
|
|
|
5
5
|
},
|
|
6
6
|
"description": "UMT Main Package is written in TypeScript and is a collection of useful functions for various tasks.",
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"@babel/cli": "7.28.
|
|
9
|
-
"@babel/core": "7.28.
|
|
10
|
-
"@babel/preset-env": "7.28.
|
|
11
|
-
"@babel/preset-typescript": "7.
|
|
12
|
-
"@biomejs/biome": "2.
|
|
13
|
-
"@
|
|
8
|
+
"@babel/cli": "7.28.6",
|
|
9
|
+
"@babel/core": "7.28.6",
|
|
10
|
+
"@babel/preset-env": "7.28.6",
|
|
11
|
+
"@babel/preset-typescript": "7.28.5",
|
|
12
|
+
"@biomejs/biome": "2.3.12",
|
|
13
|
+
"@codecov/bundle-analyzer": "1.9.1",
|
|
14
|
+
"@swc/core": "1.15.10",
|
|
14
15
|
"@swc/jest": "0.2.39",
|
|
15
|
-
"@types/bun": "1.
|
|
16
|
+
"@types/bun": "1.3.6",
|
|
16
17
|
"@types/jest": "30.0.0",
|
|
17
|
-
"@types/lodash": "4.17.
|
|
18
|
-
"@types/node": "
|
|
19
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
20
|
-
"@typescript-eslint/parser": "8.
|
|
21
|
-
"bun-types": "1.
|
|
22
|
-
"dependency-cruiser": "17.
|
|
23
|
-
"es-toolkit": "1.
|
|
24
|
-
"eslint": "9.
|
|
18
|
+
"@types/lodash": "4.17.23",
|
|
19
|
+
"@types/node": "25.0.10",
|
|
20
|
+
"@typescript-eslint/eslint-plugin": "8.53.1",
|
|
21
|
+
"@typescript-eslint/parser": "8.53.1",
|
|
22
|
+
"bun-types": "1.3.6",
|
|
23
|
+
"dependency-cruiser": "17.3.7",
|
|
24
|
+
"es-toolkit": "1.44.0",
|
|
25
|
+
"eslint": "9.39.2",
|
|
26
|
+
"eslint-plugin-baseline-js": "0.4.2",
|
|
25
27
|
"eslint-plugin-import": "2.32.0",
|
|
26
|
-
"eslint-plugin-unicorn": "
|
|
28
|
+
"eslint-plugin-unicorn": "62.0.0",
|
|
27
29
|
"fast-sort": "3.4.1",
|
|
28
30
|
"gh-pages": "6.3.0",
|
|
29
31
|
"jest": "30.2.0",
|
|
30
|
-
"
|
|
32
|
+
"jest-junit": "16.0.0",
|
|
33
|
+
"lodash": "4.17.23",
|
|
31
34
|
"mitata": "1.0.34",
|
|
32
|
-
"ts-jest": "29.4.
|
|
35
|
+
"ts-jest": "29.4.6",
|
|
33
36
|
"ts-node": "10.9.2",
|
|
34
37
|
"tsc-alias": "1.8.16",
|
|
35
|
-
"typedoc": "0.28.
|
|
36
|
-
"typescript": "5.9.3"
|
|
38
|
+
"typedoc": "0.28.16",
|
|
39
|
+
"typescript": "5.9.3",
|
|
40
|
+
"typescript-eslint": "8.53.1"
|
|
37
41
|
},
|
|
38
42
|
"directories": {
|
|
39
43
|
"doc": "doc",
|
|
@@ -42,88 +46,109 @@
|
|
|
42
46
|
},
|
|
43
47
|
"exports": {
|
|
44
48
|
".": {
|
|
49
|
+
"types": "./module/index.d.ts",
|
|
45
50
|
"import": "./module/index.js",
|
|
46
|
-
"
|
|
51
|
+
"default": "./module/index.js"
|
|
47
52
|
},
|
|
48
53
|
"./Advance": {
|
|
54
|
+
"types": "./module/Advance/index.d.ts",
|
|
49
55
|
"import": "./module/Advance/index.js",
|
|
50
|
-
"
|
|
56
|
+
"default": "./module/Advance/index.js"
|
|
51
57
|
},
|
|
52
58
|
"./Array": {
|
|
59
|
+
"types": "./module/Array/index.d.ts",
|
|
53
60
|
"import": "./module/Array/index.js",
|
|
54
|
-
"
|
|
61
|
+
"default": "./module/Array/index.js"
|
|
55
62
|
},
|
|
56
63
|
"./Color": {
|
|
64
|
+
"types": "./module/Color/index.d.ts",
|
|
57
65
|
"import": "./module/Color/index.js",
|
|
58
|
-
"
|
|
66
|
+
"default": "./module/Color/index.js"
|
|
59
67
|
},
|
|
60
68
|
"./Consts": {
|
|
69
|
+
"types": "./module/Consts/index.d.ts",
|
|
61
70
|
"import": "./module/Consts/index.js",
|
|
62
|
-
"
|
|
71
|
+
"default": "./module/Consts/index.js"
|
|
63
72
|
},
|
|
64
73
|
"./Crypto": {
|
|
74
|
+
"types": "./module/Crypto/index.d.ts",
|
|
65
75
|
"import": "./module/Crypto/index.js",
|
|
66
|
-
"
|
|
76
|
+
"default": "./module/Crypto/index.js"
|
|
67
77
|
},
|
|
68
78
|
"./DataStructure": {
|
|
79
|
+
"types": "./module/DataStructure/index.d.ts",
|
|
69
80
|
"import": "./module/DataStructure/index.js",
|
|
70
|
-
"
|
|
81
|
+
"default": "./module/DataStructure/index.js"
|
|
71
82
|
},
|
|
72
83
|
"./Date": {
|
|
84
|
+
"types": "./module/Date/index.d.ts",
|
|
73
85
|
"import": "./module/Date/index.js",
|
|
74
|
-
"
|
|
86
|
+
"default": "./module/Date/index.js"
|
|
75
87
|
},
|
|
76
88
|
"./Error": {
|
|
89
|
+
"types": "./module/Error/index.d.ts",
|
|
77
90
|
"import": "./module/Error/index.js",
|
|
78
|
-
"
|
|
91
|
+
"default": "./module/Error/index.js"
|
|
79
92
|
},
|
|
80
93
|
"./Function": {
|
|
94
|
+
"types": "./module/Function/index.d.ts",
|
|
81
95
|
"import": "./module/Function/index.js",
|
|
82
|
-
"
|
|
96
|
+
"default": "./module/Function/index.js"
|
|
83
97
|
},
|
|
84
98
|
"./IP": {
|
|
99
|
+
"types": "./module/IP/index.d.ts",
|
|
85
100
|
"import": "./module/IP/index.js",
|
|
86
|
-
"
|
|
101
|
+
"default": "./module/IP/index.js"
|
|
87
102
|
},
|
|
88
103
|
"./Math": {
|
|
104
|
+
"types": "./module/Math/index.d.ts",
|
|
89
105
|
"import": "./module/Math/index.js",
|
|
90
|
-
"
|
|
106
|
+
"default": "./module/Math/index.js"
|
|
91
107
|
},
|
|
92
108
|
"./Object": {
|
|
109
|
+
"types": "./module/Object/index.d.ts",
|
|
93
110
|
"import": "./module/Object/index.js",
|
|
94
|
-
"
|
|
111
|
+
"default": "./module/Object/index.js"
|
|
95
112
|
},
|
|
96
113
|
"./Simple": {
|
|
114
|
+
"types": "./module/Simple/index.d.ts",
|
|
97
115
|
"import": "./module/Simple/index.js",
|
|
98
|
-
"
|
|
116
|
+
"default": "./module/Simple/index.js"
|
|
99
117
|
},
|
|
100
118
|
"./String": {
|
|
119
|
+
"types": "./module/String/index.d.ts",
|
|
101
120
|
"import": "./module/String/index.js",
|
|
102
|
-
"
|
|
121
|
+
"default": "./module/String/index.js"
|
|
103
122
|
},
|
|
104
123
|
"./Time": {
|
|
124
|
+
"types": "./module/Time/index.d.ts",
|
|
105
125
|
"import": "./module/Time/index.js",
|
|
106
|
-
"
|
|
126
|
+
"default": "./module/Time/index.js"
|
|
107
127
|
},
|
|
108
128
|
"./Tool": {
|
|
129
|
+
"types": "./module/Tool/index.d.ts",
|
|
109
130
|
"import": "./module/Tool/index.js",
|
|
110
|
-
"
|
|
131
|
+
"default": "./module/Tool/index.js"
|
|
111
132
|
},
|
|
112
133
|
"./types": {
|
|
134
|
+
"types": "./module/types/index.d.ts",
|
|
113
135
|
"import": "./module/types/index.js",
|
|
114
|
-
"
|
|
136
|
+
"default": "./module/types/index.js"
|
|
115
137
|
},
|
|
116
138
|
"./UA": {
|
|
139
|
+
"types": "./module/UA/index.d.ts",
|
|
117
140
|
"import": "./module/UA/index.js",
|
|
118
|
-
"
|
|
141
|
+
"default": "./module/UA/index.js"
|
|
119
142
|
},
|
|
120
143
|
"./Unit": {
|
|
144
|
+
"types": "./module/Unit/index.d.ts",
|
|
121
145
|
"import": "./module/Unit/index.js",
|
|
122
|
-
"
|
|
146
|
+
"default": "./module/Unit/index.js"
|
|
123
147
|
},
|
|
124
148
|
"./Validate": {
|
|
149
|
+
"types": "./module/Validate/index.d.ts",
|
|
125
150
|
"import": "./module/Validate/index.js",
|
|
126
|
-
"
|
|
151
|
+
"default": "./module/Validate/index.js"
|
|
127
152
|
}
|
|
128
153
|
},
|
|
129
154
|
"files": [
|
|
@@ -136,6 +161,7 @@
|
|
|
136
161
|
"keywords": [],
|
|
137
162
|
"license": "MIT",
|
|
138
163
|
"main": "module/index.js",
|
|
164
|
+
"module": "module/index.js",
|
|
139
165
|
"name": "umt",
|
|
140
166
|
"repository": {
|
|
141
167
|
"type": "git",
|
|
@@ -157,9 +183,10 @@
|
|
|
157
183
|
"lint:ci": "bun run eslint && biome ci . && tsc",
|
|
158
184
|
"test": "jest",
|
|
159
185
|
"test-debug": "cd test && tsc",
|
|
160
|
-
"ts-node": "bun run build && ts-node --project tmp/tsconfig.json tmp/src/index.ts"
|
|
186
|
+
"ts-node": "bun run build && ts-node --project tmp/tsconfig.json tmp/src/index.ts",
|
|
187
|
+
"prepublishOnly": "bun run lint:ci && bun run build:clean:full"
|
|
161
188
|
},
|
|
162
189
|
"type": "module",
|
|
163
190
|
"types": "module/index.d.ts",
|
|
164
|
-
"version": "2.
|
|
191
|
+
"version": "2.12.0"
|
|
165
192
|
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* String validation module for email addresses
|
|
3
|
-
* Provides validation functionality for checking if a string is a valid email address
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Creates a validator for checking if a string is a valid email address
|
|
7
|
-
* @param {string} [message] - Custom error message for validation failure
|
|
8
|
-
* @returns {ValidateReturnType<string>} - Validator for email addresses
|
|
9
|
-
*/
|
|
10
|
-
export const email = (message) => {
|
|
11
|
-
// Regular expression for email address validation
|
|
12
|
-
const emailRegex = /^[a-zA-Z0-9]([a-zA-Z0-9._+-]*[a-zA-Z0-9])?@[a-zA-Z0-9]([a-zA-Z0-9.-]*[a-zA-Z0-9])?\.[a-zA-Z]{2,}$/;
|
|
13
|
-
return {
|
|
14
|
-
type: "string",
|
|
15
|
-
message,
|
|
16
|
-
validate: (value) => {
|
|
17
|
-
// RFC 5322 length limitations
|
|
18
|
-
if (value.length > 998) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
// Check for consecutive dots
|
|
22
|
-
if (value.includes("..")) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
// Check for leading/trailing dots in local part
|
|
26
|
-
const [localPart, domainPart] = value.split("@");
|
|
27
|
-
if (!(localPart && domainPart)) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
// RFC 5321 length limits: local part max 64 chars, domain part max 253 chars
|
|
31
|
-
if (localPart.length > 64 || domainPart.length > 253) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
if (localPart.startsWith(".") || localPart.endsWith(".")) {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
if (domainPart.startsWith(".") || domainPart.endsWith(".")) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
// Use regex for final validation
|
|
41
|
-
return emailRegex.test(value);
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=email.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../../src/Validate/string/email.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,OAAgB,EAA8B,EAAE;IACpE,kDAAkD;IAClD,MAAM,UAAU,GACd,mGAAmG,CAAC;IACtG,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO;QACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,8BAA8B;YAC9B,IAAI,KAAK,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;gBACvB,OAAO,KAAK,CAAC;YACf,CAAC;YAED,6BAA6B;YAC7B,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBACzB,OAAO,KAAK,CAAC;YACf,CAAC;YACD,gDAAgD;YAChD,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACjD,IAAI,CAAC,CAAC,SAAS,IAAI,UAAU,CAAC,EAAE,CAAC;gBAC/B,OAAO,KAAK,CAAC;YACf,CAAC;YAED,6EAA6E;YAC7E,IAAI,SAAS,CAAC,MAAM,GAAG,EAAE,IAAI,UAAU,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;gBACrD,OAAO,KAAK,CAAC;YACf,CAAC;YAED,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACzD,OAAO,KAAK,CAAC;YACf,CAAC;YACD,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC3D,OAAO,KAAK,CAAC;YACf,CAAC;YACD,iCAAiC;YACjC,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.email = void 0;
|
|
7
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
8
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
10
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
11
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
|
-
/**
|
|
14
|
-
* String validation module for email addresses
|
|
15
|
-
* Provides validation functionality for checking if a string is a valid email address
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Creates a validator for checking if a string is a valid email address
|
|
20
|
-
* @param {string} [message] - Custom error message for validation failure
|
|
21
|
-
* @returns {ValidateReturnType<string>} - Validator for email addresses
|
|
22
|
-
*/
|
|
23
|
-
var email = exports.email = function email(message) {
|
|
24
|
-
// Regular expression for email address validation
|
|
25
|
-
var emailRegex = /^[a-zA-Z0-9]([a-zA-Z0-9._+-]*[a-zA-Z0-9])?@[a-zA-Z0-9]([a-zA-Z0-9.-]*[a-zA-Z0-9])?\.[a-zA-Z]{2,}$/;
|
|
26
|
-
return {
|
|
27
|
-
type: "string",
|
|
28
|
-
message: message,
|
|
29
|
-
validate: function validate(value) {
|
|
30
|
-
// RFC 5322 length limitations
|
|
31
|
-
if (value.length > 998) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Check for consecutive dots
|
|
36
|
-
if (value.includes("..")) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
// Check for leading/trailing dots in local part
|
|
40
|
-
var _value$split = value.split("@"),
|
|
41
|
-
_value$split2 = _slicedToArray(_value$split, 2),
|
|
42
|
-
localPart = _value$split2[0],
|
|
43
|
-
domainPart = _value$split2[1];
|
|
44
|
-
if (!(localPart && domainPart)) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// RFC 5321 length limits: local part max 64 chars, domain part max 253 chars
|
|
49
|
-
if (localPart.length > 64 || domainPart.length > 253) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
if (localPart.startsWith(".") || localPart.endsWith(".")) {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
if (domainPart.startsWith(".") || domainPart.endsWith(".")) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
// Use regex for final validation
|
|
59
|
-
return emailRegex.test(value);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
};
|