umt 2.6.0 → 2.8.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 (121) hide show
  1. package/README.md +25 -0
  2. package/module/Crypto/decodeBase32.d.ts +7 -0
  3. package/module/Crypto/decodeBase32.js +27 -0
  4. package/module/Crypto/decodeBase32.js.map +1 -0
  5. package/module/Crypto/decodeBase32ToString.d.ts +7 -0
  6. package/module/Crypto/decodeBase32ToString.js +11 -0
  7. package/module/Crypto/decodeBase32ToString.js.map +1 -0
  8. package/module/Crypto/decodeBase58.d.ts +7 -0
  9. package/module/Crypto/decodeBase58.js +34 -0
  10. package/module/Crypto/decodeBase58.js.map +1 -0
  11. package/module/Crypto/decodeBase58ToString.d.ts +7 -0
  12. package/module/Crypto/decodeBase58ToString.js +11 -0
  13. package/module/Crypto/decodeBase58ToString.js.map +1 -0
  14. package/module/Crypto/encodeBase32.d.ts +7 -0
  15. package/module/Crypto/encodeBase32.js +28 -0
  16. package/module/Crypto/encodeBase32.js.map +1 -0
  17. package/module/Crypto/encodeBase58.d.ts +7 -0
  18. package/module/Crypto/encodeBase58.js +29 -0
  19. package/module/Crypto/encodeBase58.js.map +1 -0
  20. package/module/Crypto/index.d.ts +6 -0
  21. package/module/Crypto/index.js +7 -0
  22. package/module/Crypto/index.js.map +1 -0
  23. package/module/DataStructure/index.d.ts +1 -0
  24. package/module/DataStructure/index.js +2 -0
  25. package/module/DataStructure/index.js.map +1 -0
  26. package/module/DataStructure/priorityQueue.d.ts +241 -0
  27. package/module/DataStructure/priorityQueue.js +327 -0
  28. package/module/DataStructure/priorityQueue.js.map +1 -0
  29. package/module/Math/correlationCoefficient.d.ts +11 -0
  30. package/module/Math/correlationCoefficient.js +40 -0
  31. package/module/Math/correlationCoefficient.js.map +1 -0
  32. package/module/Math/index.d.ts +3 -0
  33. package/module/Math/index.js +3 -0
  34. package/module/Math/index.js.map +1 -1
  35. package/module/Math/mode.d.ts +10 -0
  36. package/module/Math/mode.js +31 -0
  37. package/module/Math/mode.js.map +1 -0
  38. package/module/Math/percentile.d.ts +11 -0
  39. package/module/Math/percentile.js +31 -0
  40. package/module/Math/percentile.js.map +1 -0
  41. package/module/Math/solveEquation.js +1 -1
  42. package/module/Math/solveEquation.js.map +1 -1
  43. package/module/String/fuzzySearch.d.ts +14 -0
  44. package/module/String/fuzzySearch.js +27 -0
  45. package/module/String/fuzzySearch.js.map +1 -0
  46. package/module/String/index.d.ts +4 -0
  47. package/module/String/index.js +4 -0
  48. package/module/String/index.js.map +1 -1
  49. package/module/String/reverseString.js +1 -1
  50. package/module/String/reverseString.js.map +1 -1
  51. package/module/String/slugify.d.ts +10 -0
  52. package/module/String/slugify.js +21 -0
  53. package/module/String/slugify.js.map +1 -0
  54. package/module/String/truncate.d.ts +12 -0
  55. package/module/String/truncate.js +21 -0
  56. package/module/String/truncate.js.map +1 -0
  57. package/module/String/unescapeHtml.d.ts +17 -0
  58. package/module/String/unescapeHtml.js +45 -0
  59. package/module/String/unescapeHtml.js.map +1 -0
  60. package/module/Validate/index.d.ts +1 -0
  61. package/module/Validate/index.js +1 -0
  62. package/module/Validate/index.js.map +1 -1
  63. package/module/Validate/isDeepEqual.d.ts +28 -0
  64. package/module/Validate/isDeepEqual.js +148 -0
  65. package/module/Validate/isDeepEqual.js.map +1 -0
  66. package/module/Validate/isNode.js +3 -2
  67. package/module/Validate/isNode.js.map +1 -1
  68. package/module/Validate/string/email.js +8 -0
  69. package/module/Validate/string/email.js.map +1 -1
  70. package/module/es5/Crypto/decodeBase32.d.ts +7 -0
  71. package/module/es5/Crypto/decodeBase32.js +44 -0
  72. package/module/es5/Crypto/decodeBase32ToString.d.ts +7 -0
  73. package/module/es5/Crypto/decodeBase32ToString.js +16 -0
  74. package/module/es5/Crypto/decodeBase58.d.ts +7 -0
  75. package/module/es5/Crypto/decodeBase58.js +63 -0
  76. package/module/es5/Crypto/decodeBase58ToString.d.ts +7 -0
  77. package/module/es5/Crypto/decodeBase58ToString.js +16 -0
  78. package/module/es5/Crypto/encodeBase32.d.ts +7 -0
  79. package/module/es5/Crypto/encodeBase32.js +45 -0
  80. package/module/es5/Crypto/encodeBase58.d.ts +7 -0
  81. package/module/es5/Crypto/encodeBase58.js +55 -0
  82. package/module/es5/Crypto/index.d.ts +6 -0
  83. package/module/es5/Crypto/index.js +71 -0
  84. package/module/es5/DataStructure/index.d.ts +1 -0
  85. package/module/es5/DataStructure/index.js +16 -0
  86. package/module/es5/DataStructure/priorityQueue.d.ts +241 -0
  87. package/module/es5/DataStructure/priorityQueue.js +405 -0
  88. package/module/es5/Error/retry.js +2 -2
  89. package/module/es5/Math/correlationCoefficient.d.ts +11 -0
  90. package/module/es5/Math/correlationCoefficient.js +63 -0
  91. package/module/es5/Math/index.d.ts +3 -0
  92. package/module/es5/Math/index.js +33 -0
  93. package/module/es5/Math/mode.d.ts +10 -0
  94. package/module/es5/Math/mode.js +67 -0
  95. package/module/es5/Math/percentile.d.ts +11 -0
  96. package/module/es5/Math/percentile.js +42 -0
  97. package/module/es5/Math/solveEquation.js +1 -1
  98. package/module/es5/String/fuzzySearch.d.ts +14 -0
  99. package/module/es5/String/fuzzySearch.js +50 -0
  100. package/module/es5/String/index.d.ts +4 -0
  101. package/module/es5/String/index.js +44 -0
  102. package/module/es5/String/reverseString.js +1 -1
  103. package/module/es5/String/slugify.d.ts +10 -0
  104. package/module/es5/String/slugify.js +18 -0
  105. package/module/es5/String/truncate.d.ts +12 -0
  106. package/module/es5/String/truncate.js +27 -0
  107. package/module/es5/String/unescapeHtml.d.ts +17 -0
  108. package/module/es5/String/unescapeHtml.js +51 -0
  109. package/module/es5/Validate/index.d.ts +1 -0
  110. package/module/es5/Validate/index.js +11 -0
  111. package/module/es5/Validate/isDeepEqual.d.ts +28 -0
  112. package/module/es5/Validate/isDeepEqual.js +232 -0
  113. package/module/es5/Validate/isNode.js +5 -2
  114. package/module/es5/Validate/string/email.js +10 -0
  115. package/module/es5/index.d.ts +2 -0
  116. package/module/es5/index.js +22 -0
  117. package/module/es5/tsconfig.tsbuildinfo +1 -1
  118. package/module/index.d.ts +2 -0
  119. package/module/index.js +2 -0
  120. package/module/index.js.map +1 -1
  121. package/package.json +31 -31
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.percentile = void 0;
7
+ var _quickSort = require("@/Array/quickSort");
8
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
9
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+ 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; } }
11
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
12
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
13
+ 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; }
14
+ /**
15
+ * Calculate the nth percentile of values in an array
16
+ * @param array - Array of numbers
17
+ * @param percentile - Percentile value (0-100)
18
+ * @returns The percentile value
19
+ * @example
20
+ * percentile([1, 2, 3, 4, 5], 50); // 3 (50th percentile - median)
21
+ * percentile([1, 2, 3, 4, 5], 25); // 2 (25th percentile)
22
+ * percentile([1, 2, 3, 4, 5], 75); // 4 (75th percentile)
23
+ */
24
+ var percentile = exports.percentile = function percentile(array, _percentile) {
25
+ if (array.length === 0) {
26
+ return Number.NaN;
27
+ }
28
+ if (_percentile < 0 || _percentile > 100) {
29
+ throw new Error("Percentile must be between 0 and 100");
30
+ }
31
+ var sortedArray = (0, _quickSort.quickSort)(_toConsumableArray(array));
32
+ var index = _percentile / 100 * (sortedArray.length - 1);
33
+ var lowerIndex = Math.floor(index);
34
+ var upperIndex = Math.ceil(index);
35
+ if (lowerIndex === upperIndex) {
36
+ return sortedArray[lowerIndex];
37
+ }
38
+ var lowerValue = sortedArray[lowerIndex];
39
+ var upperValue = sortedArray[upperIndex];
40
+ var weight = index - lowerIndex;
41
+ return lowerValue + (upperValue - lowerValue) * weight;
42
+ };
@@ -70,7 +70,7 @@ var solveEquation = exports.solveEquation = function solveEquation(coefficients,
70
70
  }
71
71
 
72
72
  // Return the solution vector with values rounded to 1 decimal place
73
- return solution.reverse().map(function (value) {
73
+ return solution.toReversed().map(function (value) {
74
74
  return (0, _roundOf.roundOf)(value, 1);
75
75
  });
76
76
  };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Perform fuzzy string matching on an array of strings
3
+ * @param query - The search query
4
+ * @param items - Array of strings to search in
5
+ * @param threshold - Similarity threshold (0-1) for matching (default: 0.6)
6
+ * @returns Array of matching items with their similarity scores, sorted by best match
7
+ * @example
8
+ * fuzzySearch("hello", ["hello", "world", "helo", "help"]);
9
+ * // [{ item: "hello", score: 1 }, { item: "helo", score: 0.8 }, { item: "help", score: 0.6 }]
10
+ */
11
+ export declare const fuzzySearch: (query: string, items: string[], threshold?: number) => Array<{
12
+ item: string;
13
+ score: number;
14
+ }>;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.fuzzySearch = void 0;
7
+ var _levenshteinDistance = require("./levenshteinDistance");
8
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
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
+ /**
12
+ * Perform fuzzy string matching on an array of strings
13
+ * @param query - The search query
14
+ * @param items - Array of strings to search in
15
+ * @param threshold - Similarity threshold (0-1) for matching (default: 0.6)
16
+ * @returns Array of matching items with their similarity scores, sorted by best match
17
+ * @example
18
+ * fuzzySearch("hello", ["hello", "world", "helo", "help"]);
19
+ * // [{ item: "hello", score: 1 }, { item: "helo", score: 0.8 }, { item: "help", score: 0.6 }]
20
+ */
21
+ var fuzzySearch = exports.fuzzySearch = function fuzzySearch(query, items) {
22
+ var threshold = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.6;
23
+ if (query.length === 0) {
24
+ return [];
25
+ }
26
+ var results = [];
27
+ var _iterator = _createForOfIteratorHelper(items),
28
+ _step;
29
+ try {
30
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
31
+ var item = _step.value;
32
+ var distance = (0, _levenshteinDistance.levenshteinDistance)(query.toLowerCase(), item.toLowerCase());
33
+ var maxLength = Math.max(query.length, item.length);
34
+ var score = 1 - distance / maxLength;
35
+ if (score >= threshold) {
36
+ results.push({
37
+ item: item,
38
+ score: score
39
+ });
40
+ }
41
+ }
42
+ } catch (err) {
43
+ _iterator.e(err);
44
+ } finally {
45
+ _iterator.f();
46
+ }
47
+ return results.sort(function (a, b) {
48
+ return b.score - a.score;
49
+ });
50
+ };
@@ -3,6 +3,7 @@ export * from "./deleteSpaces";
3
3
  export * from "./escapeHtml";
4
4
  export * from "./formatString";
5
5
  export * from "./fromBase64";
6
+ export * from "./fuzzySearch";
6
7
  export * from "./hasNoLetters";
7
8
  export * from "./kebabCase";
8
9
  export * from "./levenshteinDistance";
@@ -11,9 +12,12 @@ export * from "./padStart";
11
12
  export * from "./randomString";
12
13
  export * from "./randomStringInitialization";
13
14
  export * from "./reverseString";
15
+ export * from "./slugify";
14
16
  export * from "./stringSimilarity";
15
17
  export * from "./toBase64";
16
18
  export * from "./toHalfWidth";
17
19
  export * from "./trimCharacters";
18
20
  export * from "./trimEndCharacters";
19
21
  export * from "./trimStartCharacters";
22
+ export * from "./truncate";
23
+ export * from "./unescapeHtml";
@@ -58,6 +58,17 @@ Object.keys(_fromBase).forEach(function (key) {
58
58
  }
59
59
  });
60
60
  });
61
+ var _fuzzySearch = require("./fuzzySearch");
62
+ Object.keys(_fuzzySearch).forEach(function (key) {
63
+ if (key === "default" || key === "__esModule") return;
64
+ if (key in exports && exports[key] === _fuzzySearch[key]) return;
65
+ Object.defineProperty(exports, key, {
66
+ enumerable: true,
67
+ get: function get() {
68
+ return _fuzzySearch[key];
69
+ }
70
+ });
71
+ });
61
72
  var _hasNoLetters = require("./hasNoLetters");
62
73
  Object.keys(_hasNoLetters).forEach(function (key) {
63
74
  if (key === "default" || key === "__esModule") return;
@@ -146,6 +157,17 @@ Object.keys(_reverseString).forEach(function (key) {
146
157
  }
147
158
  });
148
159
  });
160
+ var _slugify = require("./slugify");
161
+ Object.keys(_slugify).forEach(function (key) {
162
+ if (key === "default" || key === "__esModule") return;
163
+ if (key in exports && exports[key] === _slugify[key]) return;
164
+ Object.defineProperty(exports, key, {
165
+ enumerable: true,
166
+ get: function get() {
167
+ return _slugify[key];
168
+ }
169
+ });
170
+ });
149
171
  var _stringSimilarity = require("./stringSimilarity");
150
172
  Object.keys(_stringSimilarity).forEach(function (key) {
151
173
  if (key === "default" || key === "__esModule") return;
@@ -211,4 +233,26 @@ Object.keys(_trimStartCharacters).forEach(function (key) {
211
233
  return _trimStartCharacters[key];
212
234
  }
213
235
  });
236
+ });
237
+ var _truncate = require("./truncate");
238
+ Object.keys(_truncate).forEach(function (key) {
239
+ if (key === "default" || key === "__esModule") return;
240
+ if (key in exports && exports[key] === _truncate[key]) return;
241
+ Object.defineProperty(exports, key, {
242
+ enumerable: true,
243
+ get: function get() {
244
+ return _truncate[key];
245
+ }
246
+ });
247
+ });
248
+ var _unescapeHtml = require("./unescapeHtml");
249
+ Object.keys(_unescapeHtml).forEach(function (key) {
250
+ if (key === "default" || key === "__esModule") return;
251
+ if (key in exports && exports[key] === _unescapeHtml[key]) return;
252
+ Object.defineProperty(exports, key, {
253
+ enumerable: true,
254
+ get: function get() {
255
+ return _unescapeHtml[key];
256
+ }
257
+ });
214
258
  });
@@ -11,5 +11,5 @@ exports.reverseString = void 0;
11
11
  * @example reverseString("Hello"); // "olleH"
12
12
  */
13
13
  var reverseString = exports.reverseString = function reverseString(_char) {
14
- return _char.split("").reverse().join("");
14
+ return _char.split("").toReversed().join("");
15
15
  };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Convert a string to a URL-friendly slug
3
+ * @param str - The string to convert
4
+ * @returns The slugified string
5
+ * @example
6
+ * slugify("Hello World!"); // "hello-world"
7
+ * slugify("This is a Test"); // "this-is-a-test"
8
+ * slugify("Japanese: こんにちは"); // "japanese"
9
+ */
10
+ export declare const slugify: (string_: string) => string;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.slugify = void 0;
7
+ /**
8
+ * Convert a string to a URL-friendly slug
9
+ * @param str - The string to convert
10
+ * @returns The slugified string
11
+ * @example
12
+ * slugify("Hello World!"); // "hello-world"
13
+ * slugify("This is a Test"); // "this-is-a-test"
14
+ * slugify("Japanese: こんにちは"); // "japanese"
15
+ */
16
+ var slugify = exports.slugify = function slugify(string_) {
17
+ return string_.normalize("NFD").replaceAll(/[\u0300-\u036F]/g, "").toLowerCase().replaceAll(/[^\w\s-]/g, "-").replaceAll(/\s+/g, "-").replaceAll(/_+/g, "-").replaceAll(/-+/g, "-").replaceAll(/^-+|-+$/g, "");
18
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Truncate a string to a specified length
3
+ * @param str - The string to truncate
4
+ * @param length - The maximum length
5
+ * @param suffix - The suffix to add when truncating (default: "...")
6
+ * @returns The truncated string
7
+ * @example
8
+ * truncate("Hello World", 5); // "Hello..."
9
+ * truncate("Hello World", 5, "~"); // "Hello~"
10
+ * truncate("Hello", 10); // "Hello"
11
+ */
12
+ export declare const truncate: (string_: string, length: number, suffix?: string) => string;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.truncate = void 0;
7
+ /**
8
+ * Truncate a string to a specified length
9
+ * @param str - The string to truncate
10
+ * @param length - The maximum length
11
+ * @param suffix - The suffix to add when truncating (default: "...")
12
+ * @returns The truncated string
13
+ * @example
14
+ * truncate("Hello World", 5); // "Hello..."
15
+ * truncate("Hello World", 5, "~"); // "Hello~"
16
+ * truncate("Hello", 10); // "Hello"
17
+ */
18
+ var truncate = exports.truncate = function truncate(string_, length) {
19
+ var suffix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "...";
20
+ if (length < 0) {
21
+ throw new Error("Length must be non-negative");
22
+ }
23
+ if (string_.length <= length) {
24
+ return string_;
25
+ }
26
+ return string_.slice(0, length) + suffix;
27
+ };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Unescapes HTML entities in a string
3
+ * @param string_ - The string to unescape
4
+ * @returns The unescaped string with HTML entities converted back to their original characters
5
+ * @example
6
+ * ```typescript
7
+ * unescapeHtml("&lt;script&gt;alert(&quot;Hello&quot;);&lt;/script&gt;");
8
+ * // Returns: "<script>alert("Hello");</script>"
9
+ *
10
+ * unescapeHtml("Tom &amp; Jerry");
11
+ * // Returns: "Tom & Jerry"
12
+ *
13
+ * unescapeHtml("5 &lt; 10 &amp;&amp; 10 &gt; 5");
14
+ * // Returns: "5 < 10 && 10 > 5"
15
+ * ```
16
+ */
17
+ export declare const unescapeHtml: (string_: string) => string;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.unescapeHtml = void 0;
7
+ /**
8
+ * HTML entities map for unescaping
9
+ */
10
+ var htmlUnescapeMap = {
11
+ "&amp;": "&",
12
+ "&lt;": "<",
13
+ "&gt;": ">",
14
+ "&quot;": '"',
15
+ "&#39;": "'",
16
+ "&#x27;": "'",
17
+ "&#x2F;": "/",
18
+ "&#x60;": "`",
19
+ "&#x3D;": "="
20
+ };
21
+
22
+ /**
23
+ * Unescapes HTML entities in a string
24
+ * @param string_ - The string to unescape
25
+ * @returns The unescaped string with HTML entities converted back to their original characters
26
+ * @example
27
+ * ```typescript
28
+ * unescapeHtml("&lt;script&gt;alert(&quot;Hello&quot;);&lt;/script&gt;");
29
+ * // Returns: "<script>alert("Hello");</script>"
30
+ *
31
+ * unescapeHtml("Tom &amp; Jerry");
32
+ * // Returns: "Tom & Jerry"
33
+ *
34
+ * unescapeHtml("5 &lt; 10 &amp;&amp; 10 &gt; 5");
35
+ * // Returns: "5 < 10 && 10 > 5"
36
+ * ```
37
+ */
38
+ var unescapeHtml = exports.unescapeHtml = function unescapeHtml(string_) {
39
+ var entityRegex = /&(?:amp|lt|gt|quot|#39|#x27|#x2F|#x60|#x3D);|&#(\d*);|&#x([0-9a-fA-F]*);/g;
40
+ return string_.replaceAll(entityRegex, function (match, dec, hex) {
41
+ if (dec !== undefined) {
42
+ var codePoint = Number.parseInt(dec, 10);
43
+ return Number.isNaN(codePoint) ? match : String.fromCodePoint(codePoint);
44
+ }
45
+ if (hex !== undefined) {
46
+ var _codePoint = Number.parseInt(hex, 16);
47
+ return Number.isNaN(_codePoint) ? match : String.fromCodePoint(_codePoint);
48
+ }
49
+ return htmlUnescapeMap[match];
50
+ });
51
+ };
@@ -3,6 +3,7 @@ export * from "./boolean";
3
3
  export * from "./number";
4
4
  export * from "./object";
5
5
  export * from "./string";
6
+ export * from "./isDeepEqual";
6
7
  export * from "./isArray";
7
8
  export * from "./isBrowser";
8
9
  export * from "./isBun";
@@ -58,6 +58,17 @@ Object.keys(_string).forEach(function (key) {
58
58
  }
59
59
  });
60
60
  });
61
+ var _isDeepEqual = require("./isDeepEqual");
62
+ Object.keys(_isDeepEqual).forEach(function (key) {
63
+ if (key === "default" || key === "__esModule") return;
64
+ if (key in exports && exports[key] === _isDeepEqual[key]) return;
65
+ Object.defineProperty(exports, key, {
66
+ enumerable: true,
67
+ get: function get() {
68
+ return _isDeepEqual[key];
69
+ }
70
+ });
71
+ });
61
72
  var _isArray = require("./isArray");
62
73
  Object.keys(_isArray).forEach(function (key) {
63
74
  if (key === "default" || key === "__esModule") return;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Options for isDeepEqual comparison
3
+ */
4
+ export interface IsDeepEqualOptions {
5
+ /**
6
+ * Whether to ignore array order when comparing arrays
7
+ * @default true
8
+ */
9
+ strictOrder?: boolean;
10
+ }
11
+ /**
12
+ * Performs a deep equality comparison between two values
13
+ *
14
+ * @param a - First value to compare
15
+ * @param b - Second value to compare
16
+ * @param options - Comparison options
17
+ * @returns true if values are deeply equal, false otherwise
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * isDeepEqual({ a: 1, b: [2, 3] }, { b: [2, 3], a: 1 }); // true
22
+ * isDeepEqual([1, 2, 3], [3, 2, 1]); // false
23
+ * isDeepEqual([1, 2, 3], [3, 2, 1], { strictOrder: false }); // true
24
+ * isDeepEqual(new Set([1, 2]), new Set([2, 1])); // true
25
+ * isDeepEqual(new Map([['a', 1]]), new Map([['a', 1]])); // true
26
+ * ```
27
+ */
28
+ export declare function isDeepEqual(a: unknown, b: unknown, options?: IsDeepEqualOptions): boolean;
@@ -0,0 +1,232 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isDeepEqual = isDeepEqual;
7
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
8
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
10
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
11
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
12
+ 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."); }
13
+ 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; } }
14
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
15
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
16
+ 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; } }
17
+ 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; }
18
+ 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); }
19
+ /**
20
+ * Options for isDeepEqual comparison
21
+ */
22
+
23
+ /**
24
+ * Performs a deep equality comparison between two values
25
+ *
26
+ * @param a - First value to compare
27
+ * @param b - Second value to compare
28
+ * @param options - Comparison options
29
+ * @returns true if values are deeply equal, false otherwise
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * isDeepEqual({ a: 1, b: [2, 3] }, { b: [2, 3], a: 1 }); // true
34
+ * isDeepEqual([1, 2, 3], [3, 2, 1]); // false
35
+ * isDeepEqual([1, 2, 3], [3, 2, 1], { strictOrder: false }); // true
36
+ * isDeepEqual(new Set([1, 2]), new Set([2, 1])); // true
37
+ * isDeepEqual(new Map([['a', 1]]), new Map([['a', 1]])); // true
38
+ * ```
39
+ */
40
+ function isDeepEqual(a, b) {
41
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
42
+ var _options$strictOrder = options.strictOrder,
43
+ strictOrder = _options$strictOrder === void 0 ? true : _options$strictOrder;
44
+ var visited = new WeakSet();
45
+ function compare(x, y) {
46
+ if (Object.is(x, y)) {
47
+ return true;
48
+ }
49
+ if (x == null || y == null) {
50
+ return false;
51
+ }
52
+ if (_typeof(x) !== _typeof(y)) {
53
+ return false;
54
+ }
55
+ if (_typeof(x) !== "object" || _typeof(y) !== "object") {
56
+ return false;
57
+ }
58
+ if (visited.has(x) || visited.has(y)) {
59
+ return true;
60
+ }
61
+ visited.add(x);
62
+ visited.add(y);
63
+ var ctorX = x.constructor;
64
+ var ctorY = y.constructor;
65
+ if (ctorX !== ctorY) {
66
+ return false;
67
+ }
68
+ if (x instanceof Date && y instanceof Date) {
69
+ return x.getTime() === y.getTime();
70
+ }
71
+ if (x instanceof RegExp && y instanceof RegExp) {
72
+ return x.toString() === y.toString();
73
+ }
74
+ if (Array.isArray(x) && Array.isArray(y)) {
75
+ if (x.length !== y.length) {
76
+ return false;
77
+ }
78
+ if (strictOrder) {
79
+ var _iterator = _createForOfIteratorHelper(x.entries()),
80
+ _step;
81
+ try {
82
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
83
+ var _step$value = _slicedToArray(_step.value, 2),
84
+ index = _step$value[0],
85
+ element = _step$value[1];
86
+ if (!compare(element, y[index])) {
87
+ return false;
88
+ }
89
+ }
90
+ } catch (err) {
91
+ _iterator.e(err);
92
+ } finally {
93
+ _iterator.f();
94
+ }
95
+ } else {
96
+ var yCopy = _toConsumableArray(y);
97
+ var _iterator2 = _createForOfIteratorHelper(x),
98
+ _step2;
99
+ try {
100
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
101
+ var itemX = _step2.value;
102
+ var found = false;
103
+ for (var _index = 0; _index < yCopy.length; _index++) {
104
+ if (compare(itemX, yCopy[_index])) {
105
+ yCopy.splice(_index, 1);
106
+ found = true;
107
+ break;
108
+ }
109
+ }
110
+ if (!found) {
111
+ return false;
112
+ }
113
+ }
114
+ } catch (err) {
115
+ _iterator2.e(err);
116
+ } finally {
117
+ _iterator2.f();
118
+ }
119
+ return yCopy.length === 0;
120
+ }
121
+ return true;
122
+ }
123
+ if (x instanceof Set && y instanceof Set) {
124
+ if (x.size !== y.size) {
125
+ return false;
126
+ }
127
+ var _iterator3 = _createForOfIteratorHelper(x),
128
+ _step3;
129
+ try {
130
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
131
+ var item = _step3.value;
132
+ var _found = false;
133
+ var _iterator4 = _createForOfIteratorHelper(y),
134
+ _step4;
135
+ try {
136
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
137
+ var otherItem = _step4.value;
138
+ if (compare(item, otherItem)) {
139
+ _found = true;
140
+ break;
141
+ }
142
+ }
143
+ } catch (err) {
144
+ _iterator4.e(err);
145
+ } finally {
146
+ _iterator4.f();
147
+ }
148
+ if (!_found) {
149
+ return false;
150
+ }
151
+ }
152
+ } catch (err) {
153
+ _iterator3.e(err);
154
+ } finally {
155
+ _iterator3.f();
156
+ }
157
+ return true;
158
+ }
159
+ if (x instanceof Map && y instanceof Map) {
160
+ if (x.size !== y.size) {
161
+ return false;
162
+ }
163
+ var _iterator5 = _createForOfIteratorHelper(x),
164
+ _step5;
165
+ try {
166
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
167
+ var _step5$value = _slicedToArray(_step5.value, 2),
168
+ key = _step5$value[0],
169
+ value = _step5$value[1];
170
+ var _found2 = false;
171
+ var _iterator6 = _createForOfIteratorHelper(y),
172
+ _step6;
173
+ try {
174
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
175
+ var _step6$value = _slicedToArray(_step6.value, 2),
176
+ otherKey = _step6$value[0],
177
+ otherValue = _step6$value[1];
178
+ if (compare(key, otherKey) && compare(value, otherValue)) {
179
+ _found2 = true;
180
+ break;
181
+ }
182
+ }
183
+ } catch (err) {
184
+ _iterator6.e(err);
185
+ } finally {
186
+ _iterator6.f();
187
+ }
188
+ if (!_found2) {
189
+ return false;
190
+ }
191
+ }
192
+ } catch (err) {
193
+ _iterator5.e(err);
194
+ } finally {
195
+ _iterator5.f();
196
+ }
197
+ return true;
198
+ }
199
+ if (ArrayBuffer.isView(x) && ArrayBuffer.isView(y)) {
200
+ var xArray = x;
201
+ var yArray = y;
202
+ if (xArray.byteLength !== yArray.byteLength) {
203
+ return false;
204
+ }
205
+ for (var _index2 = 0; _index2 < xArray.byteLength; _index2++) {
206
+ if (xArray[_index2] !== yArray[_index2]) {
207
+ return false;
208
+ }
209
+ }
210
+ return true;
211
+ }
212
+ var keysX = Object.keys(x);
213
+ var keysY = Object.keys(y);
214
+ if (keysX.length !== keysY.length) {
215
+ return false;
216
+ }
217
+ for (var _i = 0, _keysX = keysX; _i < _keysX.length; _i++) {
218
+ var _key = _keysX[_i];
219
+ if (!(_key in y)) {
220
+ return false;
221
+ }
222
+ }
223
+ for (var _i2 = 0, _keysX2 = keysX; _i2 < _keysX2.length; _i2++) {
224
+ var _key2 = _keysX2[_i2];
225
+ if (!compare(x[_key2], y[_key2])) {
226
+ return false;
227
+ }
228
+ }
229
+ return true;
230
+ }
231
+ return compare(a, b);
232
+ }
@@ -4,13 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.isNode = void 0;
7
+ var _nodeProcess = _interopRequireDefault(require("node:process"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ // biome-ignore lint/correctness/noNodejsModules: ignore
10
+
7
11
  /**
8
12
  * Determines if the current environment is Node.js
9
13
  */
10
14
  var isNode = exports.isNode = function isNode() {
11
15
  try {
12
- // biome-ignore lint/nursery/noProcessGlobal: ignore
13
- return typeof process !== "undefined" && typeof require !== "undefined";
16
+ return _nodeProcess["default"] !== undefined && typeof require !== "undefined";
14
17
  } catch (_unused) {
15
18
  return false;
16
19
  }