umt 2.10.1 → 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.
- package/README.md +3 -2
- package/module/Array/dualPivotQuickSort.js +4 -3
- package/module/Array/dualPivotQuickSort.js.map +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/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 +16 -16
- 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/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/Math/mode.js +2 -1
- package/module/Math/mode.js.map +1 -1
- package/module/Math/solveEquation.js +1 -1
- package/module/Math/solveEquation.js.map +1 -1
- package/module/String/fuzzySearch.js +2 -1
- package/module/String/fuzzySearch.js.map +1 -1
- package/module/String/reverseString.js +1 -1
- package/module/String/reverseString.js.map +1 -1
- 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/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 +1 -1
- 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/Array/dualPivotQuickSort.js +10 -3
- package/module/es5/Array/insertionSort.js +10 -10
- package/module/es5/Array/quickSort.js +10 -3
- 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 +22 -18
- package/module/es5/Color/hexaToRgba.d.ts +1 -1
- package/module/es5/Color/hexaToRgba.js +1 -1
- package/module/es5/Crypto/decodeBase58.js +4 -4
- package/module/es5/Crypto/encodeBase58.js +4 -4
- package/module/es5/Math/mode.js +2 -3
- package/module/es5/Math/solveEquation.js +1 -1
- package/module/es5/String/formatString/index.js +1 -1
- package/module/es5/String/fuzzySearch.js +2 -1
- package/module/es5/String/hasNoLetters.js +1 -1
- package/module/es5/String/reverseString.js +1 -1
- package/module/es5/Validate/index.d.ts +1 -0
- package/module/es5/Validate/index.js +11 -0
- 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 +3 -1
- 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 +18 -17
- 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
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.parseEmail = void 0;
|
|
8
|
+
function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new BabelRegExp(e, void 0, r); }; var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { var o = RegExp(e, t); return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); } function buildGroups(e, t) { var p = r.get(t); return Object.keys(p).reduce(function (r, t) { var o = p[t]; if ("number" == typeof o) r[t] = e[o];else { for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; r[t] = e[o[i]]; } return r; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { var t = e.exec.call(this, r); if (t) { t.groups = buildGroups(t, this); var p = t.indices; p && (p.groups = buildGroups(p, this)); } return t; }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { if ("string" == typeof p) { var o = r.get(this); return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)(>|$)/g, function (e, r, t) { if ("" === t) return e; var p = o[r]; return Array.isArray(p) ? "$" + p.join("$") : "number" == typeof p ? "$" + p : ""; })); } if ("function" == typeof p) { var i = this; return e[Symbol.replace].call(this, t, function () { var e = arguments; return "object" != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); }); } return e[Symbol.replace].call(this, t, p); }, _wrapRegExp.apply(this, arguments); }
|
|
9
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
10
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
11
|
+
var EMAIL_PATTERNS = {
|
|
12
|
+
basic: /*#__PURE__*/_wrapRegExp(/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+)@([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/, {
|
|
13
|
+
local: 1,
|
|
14
|
+
domain: 2
|
|
15
|
+
}),
|
|
16
|
+
rfc822: /*#__PURE__*/_wrapRegExp(/^(?:\s|\((?:[^()\\]|\\[\s\S])*(?:\((?:[^()\\]|\\[\s\S])*\)(?:[^()\\]|\\[\s\S])*)*\))*("(?:[^"\\]|\\[\s\S]){0,62}"|[a-zA-Z0-9!#$%&'*/=?^_`{|}~-]{1,64}(?:\.[a-zA-Z0-9!#$%&'*/=?^_`{|}~-]+)*)(?:\s|\((?:[^()\\]|\\[\s\S])*(?:\((?:[^()\\]|\\[\s\S])*\)(?:[^()\\]|\\[\s\S])*)*\))*@(?:\s|\((?:[^()\\]|\\[\s\S])*(?:\((?:[^()\\]|\\[\s\S])*\)(?:[^()\\]|\\[\s\S])*)*\))*([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)(?:\s|\((?:[^()\\]|\\[\s\S])*(?:\((?:[^()\\]|\\[\s\S])*\)(?:[^()\\]|\\[\s\S])*)*\))*$/, {
|
|
17
|
+
local: 1,
|
|
18
|
+
domain: 2
|
|
19
|
+
}),
|
|
20
|
+
rfc2822: /*#__PURE__*/_wrapRegExp(/^(?=.{1,998}$)(?!.*\.\.)([a-zA-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s\S]){0,62}")+|[a-zA-Z0-9!#$%&'*/=?^_`{|}~+-]{1,64}(?:(?:\s|\((?:[^()\\]|\\[\s\S])*(?:\((?:[^()\\]|\\[\s\S])*\)(?:[^()\\]|\\[\s\S])*)*\))*\.(?:\s|\((?:[^()\\]|\\[\s\S])*(?:\((?:[^()\\]|\\[\s\S])*\)(?:[^()\\]|\\[\s\S])*)*\))*[a-zA-Z0-9!#$%&'*/=?^_`{|}~+-]{1,64})*)(?:\s|\((?:[^()\\]|\\[\s\S])*(?:\((?:[^()\\]|\\[\s\S])*\)(?:[^()\\]|\\[\s\S])*)*\))*@(?:\s|\((?:[^()\\]|\\[\s\S])*(?:\((?:[^()\\]|\\[\s\S])*\)(?:[^()\\]|\\[\s\S])*)*\))*([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:(?:\s|\((?:[^()\\]|\\[\s\S])*(?:\((?:[^()\\]|\\[\s\S])*\)(?:[^()\\]|\\[\s\S])*)*\))*\.(?:\s|\((?:[^()\\]|\\[\s\S])*(?:\((?:[^()\\]|\\[\s\S])*\)(?:[^()\\]|\\[\s\S])*)*\))*[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+|\[(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3}|IPv6:[0-9a-fA-F:]+)\])(?:\s|\((?:[^()\\]|\\[\s\S])*(?:\((?:[^()\\]|\\[\s\S])*\)(?:[^()\\]|\\[\s\S])*)*\))*$/, {
|
|
29
|
+
local: 1,
|
|
30
|
+
domain: 2
|
|
31
|
+
})
|
|
32
|
+
};
|
|
33
|
+
var parseEmail = exports.parseEmail = function parseEmail(_ref) {
|
|
34
|
+
var email = _ref.email,
|
|
35
|
+
options = _ref.options;
|
|
36
|
+
var level = options.level;
|
|
37
|
+
var pattern = EMAIL_PATTERNS[level];
|
|
38
|
+
var match = pattern.exec(email);
|
|
39
|
+
return {
|
|
40
|
+
valid: match !== null,
|
|
41
|
+
parts: match !== null && match !== void 0 && match.groups ? {
|
|
42
|
+
// biome-ignore lint/complexity/useLiteralKeys: Literal keys are used for group names
|
|
43
|
+
local: match.groups["local"],
|
|
44
|
+
// biome-ignore lint/complexity/useLiteralKeys: Literal keys are used for group names
|
|
45
|
+
domain: match.groups["domain"]
|
|
46
|
+
} : undefined
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -14,14 +14,14 @@ Object.keys(_core).forEach(function (key) {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
-
var
|
|
18
|
-
Object.keys(
|
|
17
|
+
var _validateEmail = require("./validateEmail");
|
|
18
|
+
Object.keys(_validateEmail).forEach(function (key) {
|
|
19
19
|
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] ===
|
|
20
|
+
if (key in exports && exports[key] === _validateEmail[key]) return;
|
|
21
21
|
Object.defineProperty(exports, key, {
|
|
22
22
|
enumerable: true,
|
|
23
23
|
get: function get() {
|
|
24
|
-
return
|
|
24
|
+
return _validateEmail[key];
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
});
|
|
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.uuid = void 0;
|
|
7
|
+
var _templateObject;
|
|
8
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
7
9
|
/**
|
|
8
10
|
* String validation module for UUID strings
|
|
9
11
|
* Provides validation functionality for checking if a string is a valid UUID
|
|
@@ -24,7 +26,7 @@ var uuid = exports.uuid = function uuid() {
|
|
|
24
26
|
validate: function validate(value) {
|
|
25
27
|
return versions.some(function (version) {
|
|
26
28
|
// Regular expression for specific UUID version
|
|
27
|
-
var versionRegex = new RegExp("^[\\da-f]{8}-?[\\da-f]{4}-?"
|
|
29
|
+
var versionRegex = new RegExp(String.raw(_templateObject || (_templateObject = _taggedTemplateLiteral(["^[da-f]{8}-?[da-f]{4}-?", "[da-f]{3}-?[89ab][da-f]{3}-?[da-f]{12}$"], ["^[\\da-f]{8}-?[\\da-f]{4}-?", "[\\da-f]{3}-?[89ab][\\da-f]{3}-?[\\da-f]{12}$"])), version), "i");
|
|
28
30
|
return versionRegex.test(value);
|
|
29
31
|
});
|
|
30
32
|
}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* String validation module for email addresses
|
|
3
3
|
* Provides validation functionality for checking if a string is a valid email address
|
|
4
4
|
*/
|
|
5
|
+
import { type ParseEmailOptions } from "@/Validate/parseEmail";
|
|
5
6
|
import type { ValidateReturnType } from "@/Validate/type";
|
|
6
7
|
/**
|
|
7
8
|
* Creates a validator for checking if a string is a valid email address
|
|
8
9
|
* @param {string} [message] - Custom error message for validation failure
|
|
9
10
|
* @returns {ValidateReturnType<string>} - Validator for email addresses
|
|
10
11
|
*/
|
|
11
|
-
export declare const
|
|
12
|
+
export declare const validateEmail: (message?: string, options?: ParseEmailOptions) => ValidateReturnType<string>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.validateEmail = void 0;
|
|
7
|
+
var _parseEmail = require("@/Validate/parseEmail");
|
|
8
|
+
/**
|
|
9
|
+
* String validation module for email addresses
|
|
10
|
+
* Provides validation functionality for checking if a string is a valid email address
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Creates a validator for checking if a string is a valid email address
|
|
15
|
+
* @param {string} [message] - Custom error message for validation failure
|
|
16
|
+
* @returns {ValidateReturnType<string>} - Validator for email addresses
|
|
17
|
+
*/
|
|
18
|
+
var validateEmail = exports.validateEmail = function validateEmail(message, options) {
|
|
19
|
+
return {
|
|
20
|
+
type: "string",
|
|
21
|
+
message: message,
|
|
22
|
+
validate: function validate(value) {
|
|
23
|
+
return (0, _parseEmail.parseEmail)({
|
|
24
|
+
email: value,
|
|
25
|
+
options: options || {
|
|
26
|
+
level: "basic"
|
|
27
|
+
}
|
|
28
|
+
}).valid;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
};
|