umt 2.10.0 → 2.11.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.
Files changed (75) hide show
  1. package/README.md +3 -2
  2. package/module/Array/dualPivotQuickSort.js +4 -3
  3. package/module/Array/dualPivotQuickSort.js.map +1 -1
  4. package/module/Array/insertionSort.js +4 -10
  5. package/module/Array/insertionSort.js.map +1 -1
  6. package/module/Array/quickSort.js +4 -3
  7. package/module/Array/quickSort.js.map +1 -1
  8. package/module/Array/sortingHelpers/applyInsertionSortIfNeeded.js +2 -2
  9. package/module/Array/sortingHelpers/applyInsertionSortIfNeeded.js.map +1 -1
  10. package/module/Array/sortingHelpers/insertionSortRange.d.ts +5 -0
  11. package/module/Array/sortingHelpers/insertionSortRange.js +15 -0
  12. package/module/Array/sortingHelpers/insertionSortRange.js.map +1 -0
  13. package/module/Array/timSort.js +7 -5
  14. package/module/Array/timSort.js.map +1 -1
  15. package/module/Array/ultraNumberSort.js +16 -16
  16. package/module/Array/ultraNumberSort.js.map +1 -1
  17. package/module/Color/hexaToRgba.d.ts +1 -1
  18. package/module/Color/hexaToRgba.js +1 -1
  19. package/module/Crypto/decodeBase58.js +4 -4
  20. package/module/Crypto/decodeBase58.js.map +1 -1
  21. package/module/Crypto/encodeBase58.js +4 -4
  22. package/module/Crypto/encodeBase58.js.map +1 -1
  23. package/module/Math/mode.js +2 -1
  24. package/module/Math/mode.js.map +1 -1
  25. package/module/Math/solveEquation.js +1 -1
  26. package/module/Math/solveEquation.js.map +1 -1
  27. package/module/String/fuzzySearch.js +2 -1
  28. package/module/String/fuzzySearch.js.map +1 -1
  29. package/module/String/reverseString.js +1 -1
  30. package/module/String/reverseString.js.map +1 -1
  31. package/module/Validate/index.d.ts +1 -0
  32. package/module/Validate/index.js +1 -0
  33. package/module/Validate/index.js.map +1 -1
  34. package/module/Validate/parseEmail.d.ts +14 -0
  35. package/module/Validate/parseEmail.js +24 -0
  36. package/module/Validate/parseEmail.js.map +1 -0
  37. package/module/Validate/string/index.d.ts +1 -1
  38. package/module/Validate/string/index.js +1 -1
  39. package/module/Validate/string/index.js.map +1 -1
  40. package/module/Validate/string/uuid.js +1 -1
  41. package/module/Validate/string/uuid.js.map +1 -1
  42. package/module/Validate/string/{email.d.ts → validateEmail.d.ts} +2 -1
  43. package/module/Validate/string/validateEmail.js +23 -0
  44. package/module/Validate/string/validateEmail.js.map +1 -0
  45. package/module/es5/Array/dualPivotQuickSort.js +10 -3
  46. package/module/es5/Array/insertionSort.js +10 -10
  47. package/module/es5/Array/quickSort.js +10 -3
  48. package/module/es5/Array/sortingHelpers/applyInsertionSortIfNeeded.js +2 -2
  49. package/module/es5/Array/sortingHelpers/insertionSortRange.d.ts +5 -0
  50. package/module/es5/Array/sortingHelpers/insertionSortRange.js +20 -0
  51. package/module/es5/Array/timSort.js +13 -5
  52. package/module/es5/Array/ultraNumberSort.js +22 -18
  53. package/module/es5/Color/hexaToRgba.d.ts +1 -1
  54. package/module/es5/Color/hexaToRgba.js +1 -1
  55. package/module/es5/Crypto/decodeBase58.js +4 -4
  56. package/module/es5/Crypto/encodeBase58.js +4 -4
  57. package/module/es5/Math/mode.js +2 -3
  58. package/module/es5/Math/solveEquation.js +1 -1
  59. package/module/es5/String/formatString/index.js +1 -1
  60. package/module/es5/String/fuzzySearch.js +2 -1
  61. package/module/es5/String/reverseString.js +1 -1
  62. package/module/es5/Validate/index.d.ts +1 -0
  63. package/module/es5/Validate/index.js +11 -0
  64. package/module/es5/Validate/parseEmail.d.ts +14 -0
  65. package/module/es5/Validate/parseEmail.js +48 -0
  66. package/module/es5/Validate/string/index.d.ts +1 -1
  67. package/module/es5/Validate/string/index.js +4 -4
  68. package/module/es5/Validate/string/uuid.js +3 -1
  69. package/module/es5/Validate/string/{email.d.ts → validateEmail.d.ts} +2 -1
  70. package/module/es5/Validate/string/validateEmail.js +31 -0
  71. package/module/es5/tsconfig.tsbuildinfo +1 -1
  72. package/package.json +98 -17
  73. package/module/Validate/string/email.js +0 -45
  74. package/module/Validate/string/email.js.map +0 -1
  75. package/module/es5/Validate/string/email.js +0 -62
package/package.json CHANGED
@@ -6,33 +6,34 @@
6
6
  "description": "UMT Main Package is written in TypeScript and is a collection of useful functions for various tasks.",
7
7
  "devDependencies": {
8
8
  "@babel/cli": "7.28.3",
9
- "@babel/core": "7.28.3",
10
- "@babel/preset-env": "7.28.3",
11
- "@babel/preset-typescript": "7.27.1",
12
- "@biomejs/biome": "2.2.0",
13
- "@swc/core": "1.13.5",
9
+ "@babel/core": "7.28.5",
10
+ "@babel/preset-env": "7.28.5",
11
+ "@babel/preset-typescript": "7.28.5",
12
+ "@biomejs/biome": "2.3.4",
13
+ "@swc/core": "1.15.1",
14
14
  "@swc/jest": "0.2.39",
15
- "@types/bun": "1.2.20",
15
+ "@types/bun": "1.3.2",
16
16
  "@types/jest": "30.0.0",
17
17
  "@types/lodash": "4.17.20",
18
- "@types/node": "24.3.0",
19
- "@typescript-eslint/eslint-plugin": "8.40.0",
20
- "@typescript-eslint/parser": "8.46.0",
21
- "bun-types": "1.2.20",
22
- "dependency-cruiser": "17.0.2",
23
- "es-toolkit": "1.39.10",
24
- "eslint": "9.33.0",
18
+ "@types/node": "24.10.0",
19
+ "@typescript-eslint/eslint-plugin": "8.46.3",
20
+ "@typescript-eslint/parser": "8.46.3",
21
+ "bun-types": "1.3.2",
22
+ "dependency-cruiser": "17.2.0",
23
+ "es-toolkit": "1.41.0",
24
+ "eslint": "9.39.1",
25
+ "eslint-plugin-baseline-js": "^0.4.0",
25
26
  "eslint-plugin-import": "2.32.0",
26
- "eslint-plugin-unicorn": "60.0.0",
27
+ "eslint-plugin-unicorn": "62.0.0",
27
28
  "fast-sort": "3.4.1",
28
29
  "gh-pages": "6.3.0",
29
30
  "jest": "30.2.0",
30
31
  "lodash": "4.17.21",
31
32
  "mitata": "1.0.34",
32
- "ts-jest": "29.4.1",
33
+ "ts-jest": "29.4.5",
33
34
  "ts-node": "10.9.2",
34
35
  "tsc-alias": "1.8.16",
35
- "typedoc": "0.28.10",
36
+ "typedoc": "0.28.14",
36
37
  "typescript": "5.9.3"
37
38
  },
38
39
  "directories": {
@@ -44,6 +45,86 @@
44
45
  ".": {
45
46
  "import": "./module/index.js",
46
47
  "types": "./module/index.d.ts"
48
+ },
49
+ "./Advance": {
50
+ "import": "./module/Advance/index.js",
51
+ "types": "./module/Advance/index.d.ts"
52
+ },
53
+ "./Array": {
54
+ "import": "./module/Array/index.js",
55
+ "types": "./module/Array/index.d.ts"
56
+ },
57
+ "./Color": {
58
+ "import": "./module/Color/index.js",
59
+ "types": "./module/Color/index.d.ts"
60
+ },
61
+ "./Consts": {
62
+ "import": "./module/Consts/index.js",
63
+ "types": "./module/Consts/index.d.ts"
64
+ },
65
+ "./Crypto": {
66
+ "import": "./module/Crypto/index.js",
67
+ "types": "./module/Crypto/index.d.ts"
68
+ },
69
+ "./DataStructure": {
70
+ "import": "./module/DataStructure/index.js",
71
+ "types": "./module/DataStructure/index.d.ts"
72
+ },
73
+ "./Date": {
74
+ "import": "./module/Date/index.js",
75
+ "types": "./module/Date/index.d.ts"
76
+ },
77
+ "./Error": {
78
+ "import": "./module/Error/index.js",
79
+ "types": "./module/Error/index.d.ts"
80
+ },
81
+ "./Function": {
82
+ "import": "./module/Function/index.js",
83
+ "types": "./module/Function/index.d.ts"
84
+ },
85
+ "./IP": {
86
+ "import": "./module/IP/index.js",
87
+ "types": "./module/IP/index.d.ts"
88
+ },
89
+ "./Math": {
90
+ "import": "./module/Math/index.js",
91
+ "types": "./module/Math/index.d.ts"
92
+ },
93
+ "./Object": {
94
+ "import": "./module/Object/index.js",
95
+ "types": "./module/Object/index.d.ts"
96
+ },
97
+ "./Simple": {
98
+ "import": "./module/Simple/index.js",
99
+ "types": "./module/Simple/index.d.ts"
100
+ },
101
+ "./String": {
102
+ "import": "./module/String/index.js",
103
+ "types": "./module/String/index.d.ts"
104
+ },
105
+ "./Time": {
106
+ "import": "./module/Time/index.js",
107
+ "types": "./module/Time/index.d.ts"
108
+ },
109
+ "./Tool": {
110
+ "import": "./module/Tool/index.js",
111
+ "types": "./module/Tool/index.d.ts"
112
+ },
113
+ "./types": {
114
+ "import": "./module/types/index.js",
115
+ "types": "./module/types/index.d.ts"
116
+ },
117
+ "./UA": {
118
+ "import": "./module/UA/index.js",
119
+ "types": "./module/UA/index.d.ts"
120
+ },
121
+ "./Unit": {
122
+ "import": "./module/Unit/index.js",
123
+ "types": "./module/Unit/index.d.ts"
124
+ },
125
+ "./Validate": {
126
+ "import": "./module/Validate/index.js",
127
+ "types": "./module/Validate/index.d.ts"
47
128
  }
48
129
  },
49
130
  "files": [
@@ -81,5 +162,5 @@
81
162
  },
82
163
  "type": "module",
83
164
  "types": "module/index.d.ts",
84
- "version": "2.10.0"
165
+ "version": "2.11.0"
85
166
  }
@@ -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
- };