umt 2.5.0 → 2.7.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 (368) hide show
  1. package/README.md +36 -0
  2. package/module/Array/generateNumberArray.js +13 -7
  3. package/module/Array/generateNumberArray.js.map +1 -1
  4. package/module/Array/getArraysCommon.js +21 -3
  5. package/module/Array/getArraysCommon.js.map +1 -1
  6. package/module/Array/groupBy.js +1 -1
  7. package/module/Array/groupBy.js.map +1 -1
  8. package/module/Array/index.d.ts +2 -0
  9. package/module/Array/index.js +2 -0
  10. package/module/Array/index.js.map +1 -1
  11. package/module/Array/ultraNumberSort.js +2 -2
  12. package/module/Array/ultraNumberSort.js.map +1 -1
  13. package/module/Array/uniqBy.d.ts +7 -0
  14. package/module/Array/uniqBy.js +19 -0
  15. package/module/Array/uniqBy.js.map +1 -0
  16. package/module/Array/unique.d.ts +6 -0
  17. package/module/Array/unique.js +9 -0
  18. package/module/Array/unique.js.map +1 -0
  19. package/module/Color/rgbaToHsla.js +1 -1
  20. package/module/Color/rgbaToHsla.js.map +1 -1
  21. package/module/Crypto/decodeBase32.d.ts +7 -0
  22. package/module/Crypto/decodeBase32.js +27 -0
  23. package/module/Crypto/decodeBase32.js.map +1 -0
  24. package/module/Crypto/decodeBase32ToString.d.ts +7 -0
  25. package/module/Crypto/decodeBase32ToString.js +11 -0
  26. package/module/Crypto/decodeBase32ToString.js.map +1 -0
  27. package/module/Crypto/decodeBase58.d.ts +7 -0
  28. package/module/Crypto/decodeBase58.js +34 -0
  29. package/module/Crypto/decodeBase58.js.map +1 -0
  30. package/module/Crypto/decodeBase58ToString.d.ts +7 -0
  31. package/module/Crypto/decodeBase58ToString.js +11 -0
  32. package/module/Crypto/decodeBase58ToString.js.map +1 -0
  33. package/module/Crypto/encodeBase32.d.ts +7 -0
  34. package/module/Crypto/encodeBase32.js +28 -0
  35. package/module/Crypto/encodeBase32.js.map +1 -0
  36. package/module/Crypto/encodeBase58.d.ts +7 -0
  37. package/module/Crypto/encodeBase58.js +29 -0
  38. package/module/Crypto/encodeBase58.js.map +1 -0
  39. package/module/Crypto/index.d.ts +6 -0
  40. package/module/Crypto/index.js +7 -0
  41. package/module/Crypto/index.js.map +1 -0
  42. package/module/DataStructure/index.d.ts +1 -0
  43. package/module/DataStructure/index.js +2 -0
  44. package/module/DataStructure/index.js.map +1 -0
  45. package/module/DataStructure/priorityQueue.d.ts +241 -0
  46. package/module/DataStructure/priorityQueue.js +327 -0
  47. package/module/DataStructure/priorityQueue.js.map +1 -0
  48. package/module/Date/birthday.js +14 -6
  49. package/module/Date/birthday.js.map +1 -1
  50. package/module/Date/isLeapYear.js +3 -0
  51. package/module/Date/isLeapYear.js.map +1 -1
  52. package/module/Error/index.d.ts +1 -0
  53. package/module/Error/index.js +1 -0
  54. package/module/Error/index.js.map +1 -1
  55. package/module/Error/retry.d.ts +37 -0
  56. package/module/Error/retry.js +47 -0
  57. package/module/Error/retry.js.map +1 -0
  58. package/module/IP/getIpClass.js +1 -1
  59. package/module/IP/getIpClass.js.map +1 -1
  60. package/module/IP/getNetworkAddress.js +2 -2
  61. package/module/IP/getNetworkAddress.js.map +1 -1
  62. package/module/IP/ipToBinaryString.js +2 -2
  63. package/module/IP/ipToBinaryString.js.map +1 -1
  64. package/module/IP/subnetMaskToCidr.js +1 -1
  65. package/module/IP/subnetMaskToCidr.js.map +1 -1
  66. package/module/Math/calculator/core.js +21 -13
  67. package/module/Math/calculator/core.js.map +1 -1
  68. package/module/Math/calculator/literalExpression.js +19 -7
  69. package/module/Math/calculator/literalExpression.js.map +1 -1
  70. package/module/Math/correlationCoefficient.d.ts +11 -0
  71. package/module/Math/correlationCoefficient.js +40 -0
  72. package/module/Math/correlationCoefficient.js.map +1 -0
  73. package/module/Math/division.js +3 -3
  74. package/module/Math/division.js.map +1 -1
  75. package/module/Math/gcd.js +26 -4
  76. package/module/Math/gcd.js.map +1 -1
  77. package/module/Math/index.d.ts +3 -0
  78. package/module/Math/index.js +3 -0
  79. package/module/Math/index.js.map +1 -1
  80. package/module/Math/mode.d.ts +10 -0
  81. package/module/Math/mode.js +31 -0
  82. package/module/Math/mode.js.map +1 -0
  83. package/module/Math/percentile.d.ts +11 -0
  84. package/module/Math/percentile.js +31 -0
  85. package/module/Math/percentile.js.map +1 -0
  86. package/module/Math/standardDeviation.js +4 -2
  87. package/module/Math/standardDeviation.js.map +1 -1
  88. package/module/Object/has.js +1 -2
  89. package/module/Object/has.js.map +1 -1
  90. package/module/Object/index.d.ts +4 -0
  91. package/module/Object/index.js +4 -0
  92. package/module/Object/index.js.map +1 -1
  93. package/module/Object/isEmpty.d.ts +6 -0
  94. package/module/Object/isEmpty.js +20 -0
  95. package/module/Object/isEmpty.js.map +1 -0
  96. package/module/Object/merge.d.ts +8 -0
  97. package/module/Object/merge.js +10 -0
  98. package/module/Object/merge.js.map +1 -0
  99. package/module/Object/mergeDeep.d.ts +8 -0
  100. package/module/Object/mergeDeep.js +37 -0
  101. package/module/Object/mergeDeep.js.map +1 -0
  102. package/module/Object/omit.d.ts +7 -0
  103. package/module/Object/omit.js +14 -0
  104. package/module/Object/omit.js.map +1 -0
  105. package/module/Object/pickDeep.d.ts +2 -2
  106. package/module/Object/pickDeep.js +4 -4
  107. package/module/Object/pickDeep.js.map +1 -1
  108. package/module/Simple/Date/dayOfWeekSimple.js +3 -3
  109. package/module/Simple/Date/dayOfWeekSimple.js.map +1 -1
  110. package/module/String/camelCase.d.ts +6 -0
  111. package/module/String/camelCase.js +12 -0
  112. package/module/String/camelCase.js.map +1 -0
  113. package/module/String/escapeHtml.d.ts +6 -0
  114. package/module/String/escapeHtml.js +19 -0
  115. package/module/String/escapeHtml.js.map +1 -0
  116. package/module/String/formatString/applyFormatter.d.ts +25 -0
  117. package/module/String/formatString/applyFormatter.js +71 -0
  118. package/module/String/formatString/applyFormatter.js.map +1 -0
  119. package/module/String/formatString/defaultFormatters.d.ts +24 -0
  120. package/module/String/formatString/defaultFormatters.js +59 -0
  121. package/module/String/formatString/defaultFormatters.js.map +1 -0
  122. package/module/String/formatString/detectMode.d.ts +26 -0
  123. package/module/String/formatString/detectMode.js +61 -0
  124. package/module/String/formatString/detectMode.js.map +1 -0
  125. package/module/String/formatString/getValue.d.ts +27 -0
  126. package/module/String/formatString/getValue.js +56 -0
  127. package/module/String/formatString/getValue.js.map +1 -0
  128. package/module/String/formatString/index.d.ts +91 -0
  129. package/module/String/formatString/index.js +38 -0
  130. package/module/String/formatString/index.js.map +1 -0
  131. package/module/String/fuzzySearch.d.ts +14 -0
  132. package/module/String/fuzzySearch.js +27 -0
  133. package/module/String/fuzzySearch.js.map +1 -0
  134. package/module/String/index.d.ts +9 -0
  135. package/module/String/index.js +9 -0
  136. package/module/String/index.js.map +1 -1
  137. package/module/String/kebabCase.d.ts +6 -0
  138. package/module/String/kebabCase.js +22 -0
  139. package/module/String/kebabCase.js.map +1 -0
  140. package/module/String/levenshteinDistance.d.ts +8 -0
  141. package/module/String/levenshteinDistance.js +38 -0
  142. package/module/String/levenshteinDistance.js.map +1 -0
  143. package/module/String/slugify.d.ts +10 -0
  144. package/module/String/slugify.js +21 -0
  145. package/module/String/slugify.js.map +1 -0
  146. package/module/String/stringSimilarity.d.ts +8 -0
  147. package/module/String/stringSimilarity.js +23 -0
  148. package/module/String/stringSimilarity.js.map +1 -0
  149. package/module/String/truncate.d.ts +12 -0
  150. package/module/String/truncate.js +21 -0
  151. package/module/String/truncate.js.map +1 -0
  152. package/module/String/unescapeHtml.d.ts +17 -0
  153. package/module/String/unescapeHtml.js +45 -0
  154. package/module/String/unescapeHtml.js.map +1 -0
  155. package/module/Validate/core/index.js +0 -1
  156. package/module/Validate/core/index.js.map +1 -1
  157. package/module/Validate/index.d.ts +1 -0
  158. package/module/Validate/index.js +1 -0
  159. package/module/Validate/index.js.map +1 -1
  160. package/module/Validate/isDeepEqual.d.ts +28 -0
  161. package/module/Validate/isDeepEqual.js +148 -0
  162. package/module/Validate/isDeepEqual.js.map +1 -0
  163. package/module/Validate/isDouble.js +1 -1
  164. package/module/Validate/isDouble.js.map +1 -1
  165. package/module/Validate/isNode.js +1 -0
  166. package/module/Validate/isNode.js.map +1 -1
  167. package/module/Validate/isNumber.js +1 -1
  168. package/module/Validate/isNumber.js.map +1 -1
  169. package/module/Validate/isValueNaN.js +1 -1
  170. package/module/Validate/isValueNaN.js.map +1 -1
  171. package/module/Validate/number/even.js +7 -1
  172. package/module/Validate/number/even.js.map +1 -1
  173. package/module/Validate/number/odd.js +7 -1
  174. package/module/Validate/number/odd.js.map +1 -1
  175. package/module/Validate/string/email.js +20 -2
  176. package/module/Validate/string/email.js.map +1 -1
  177. package/module/es5/Array/generateNumberArray.js +15 -9
  178. package/module/es5/Array/getArraysCommon.js +39 -4
  179. package/module/es5/Array/groupBy.js +1 -1
  180. package/module/es5/Array/index.d.ts +2 -0
  181. package/module/es5/Array/index.js +22 -0
  182. package/module/es5/Array/ultraNumberSort.js +2 -2
  183. package/module/es5/Array/uniqBy.d.ts +7 -0
  184. package/module/es5/Array/uniqBy.js +36 -0
  185. package/module/es5/Array/unique.d.ts +6 -0
  186. package/module/es5/Array/unique.js +20 -0
  187. package/module/es5/Color/rgbaToHsla.js +1 -1
  188. package/module/es5/Crypto/decodeBase32.d.ts +7 -0
  189. package/module/es5/Crypto/decodeBase32.js +44 -0
  190. package/module/es5/Crypto/decodeBase32ToString.d.ts +7 -0
  191. package/module/es5/Crypto/decodeBase32ToString.js +16 -0
  192. package/module/es5/Crypto/decodeBase58.d.ts +7 -0
  193. package/module/es5/Crypto/decodeBase58.js +63 -0
  194. package/module/es5/Crypto/decodeBase58ToString.d.ts +7 -0
  195. package/module/es5/Crypto/decodeBase58ToString.js +16 -0
  196. package/module/es5/Crypto/encodeBase32.d.ts +7 -0
  197. package/module/es5/Crypto/encodeBase32.js +45 -0
  198. package/module/es5/Crypto/encodeBase58.d.ts +7 -0
  199. package/module/es5/Crypto/encodeBase58.js +55 -0
  200. package/module/es5/Crypto/index.d.ts +6 -0
  201. package/module/es5/Crypto/index.js +71 -0
  202. package/module/es5/DataStructure/index.d.ts +1 -0
  203. package/module/es5/DataStructure/index.js +16 -0
  204. package/module/es5/DataStructure/priorityQueue.d.ts +241 -0
  205. package/module/es5/DataStructure/priorityQueue.js +405 -0
  206. package/module/es5/Date/birthday.js +17 -3
  207. package/module/es5/Date/isLeapYear.js +3 -0
  208. package/module/es5/Error/index.d.ts +1 -0
  209. package/module/es5/Error/index.js +11 -0
  210. package/module/es5/Error/retry.d.ts +37 -0
  211. package/module/es5/Error/retry.js +88 -0
  212. package/module/es5/IP/getIpClass.js +1 -1
  213. package/module/es5/IP/getNetworkAddress.js +2 -2
  214. package/module/es5/IP/ipToBinaryString.js +2 -2
  215. package/module/es5/IP/subnetMaskToCidr.js +1 -1
  216. package/module/es5/Math/calculator/core.js +17 -9
  217. package/module/es5/Math/calculator/literalExpression.js +19 -6
  218. package/module/es5/Math/correlationCoefficient.d.ts +11 -0
  219. package/module/es5/Math/correlationCoefficient.js +63 -0
  220. package/module/es5/Math/division.js +3 -3
  221. package/module/es5/Math/gcd.js +43 -5
  222. package/module/es5/Math/index.d.ts +3 -0
  223. package/module/es5/Math/index.js +33 -0
  224. package/module/es5/Math/mode.d.ts +10 -0
  225. package/module/es5/Math/mode.js +67 -0
  226. package/module/es5/Math/percentile.d.ts +11 -0
  227. package/module/es5/Math/percentile.js +42 -0
  228. package/module/es5/Math/standardDeviation.js +4 -2
  229. package/module/es5/Object/has.js +1 -1
  230. package/module/es5/Object/index.d.ts +4 -0
  231. package/module/es5/Object/index.js +44 -0
  232. package/module/es5/Object/isEmpty.d.ts +6 -0
  233. package/module/es5/Object/isEmpty.js +26 -0
  234. package/module/es5/Object/merge.d.ts +8 -0
  235. package/module/es5/Object/merge.js +18 -0
  236. package/module/es5/Object/mergeDeep.d.ts +8 -0
  237. package/module/es5/Object/mergeDeep.js +46 -0
  238. package/module/es5/Object/omit.d.ts +7 -0
  239. package/module/es5/Object/omit.js +29 -0
  240. package/module/es5/Object/pickDeep.d.ts +2 -2
  241. package/module/es5/Object/pickDeep.js +4 -4
  242. package/module/es5/Simple/Date/dayOfWeekSimple.js +3 -3
  243. package/module/es5/String/camelCase.d.ts +6 -0
  244. package/module/es5/String/camelCase.js +18 -0
  245. package/module/es5/String/escapeHtml.d.ts +6 -0
  246. package/module/es5/String/escapeHtml.js +27 -0
  247. package/module/es5/String/formatString/applyFormatter.d.ts +25 -0
  248. package/module/es5/String/formatString/applyFormatter.js +100 -0
  249. package/module/es5/String/formatString/defaultFormatters.d.ts +24 -0
  250. package/module/es5/String/formatString/defaultFormatters.js +79 -0
  251. package/module/es5/String/formatString/detectMode.d.ts +26 -0
  252. package/module/es5/String/formatString/detectMode.js +60 -0
  253. package/module/es5/String/formatString/getValue.d.ts +27 -0
  254. package/module/es5/String/formatString/getValue.js +85 -0
  255. package/module/es5/String/formatString/index.d.ts +91 -0
  256. package/module/es5/String/formatString/index.js +152 -0
  257. package/module/es5/String/fuzzySearch.d.ts +14 -0
  258. package/module/es5/String/fuzzySearch.js +50 -0
  259. package/module/es5/String/index.d.ts +9 -0
  260. package/module/es5/String/index.js +99 -0
  261. package/module/es5/String/kebabCase.d.ts +6 -0
  262. package/module/es5/String/kebabCase.js +26 -0
  263. package/module/es5/String/levenshteinDistance.d.ts +8 -0
  264. package/module/es5/String/levenshteinDistance.js +58 -0
  265. package/module/es5/String/slugify.d.ts +10 -0
  266. package/module/es5/String/slugify.js +18 -0
  267. package/module/es5/String/stringSimilarity.d.ts +8 -0
  268. package/module/es5/String/stringSimilarity.js +30 -0
  269. package/module/es5/String/truncate.d.ts +12 -0
  270. package/module/es5/String/truncate.js +27 -0
  271. package/module/es5/String/unescapeHtml.d.ts +17 -0
  272. package/module/es5/String/unescapeHtml.js +51 -0
  273. package/module/es5/Validate/core/index.js +0 -1
  274. package/module/es5/Validate/index.d.ts +1 -0
  275. package/module/es5/Validate/index.js +11 -0
  276. package/module/es5/Validate/isDeepEqual.d.ts +28 -0
  277. package/module/es5/Validate/isDeepEqual.js +232 -0
  278. package/module/es5/Validate/isDouble.js +1 -1
  279. package/module/es5/Validate/isNode.js +1 -0
  280. package/module/es5/Validate/isNumber.js +1 -1
  281. package/module/es5/Validate/isValueNaN.js +1 -1
  282. package/module/es5/Validate/number/even.js +4 -0
  283. package/module/es5/Validate/number/odd.js +4 -0
  284. package/module/es5/Validate/string/email.js +26 -1
  285. package/module/es5/index.d.ts +2 -0
  286. package/module/es5/index.js +22 -0
  287. package/module/es5/tsconfig.tsbuildinfo +1 -1
  288. package/module/es5/types/index.d.ts +1 -0
  289. package/module/es5/types/index.js +11 -0
  290. package/module/es5/types/logic/deepPartial.d.ts +37 -0
  291. package/module/es5/types/logic/deepPartial.js +5 -0
  292. package/module/es5/types/logic/deepRequired.d.ts +37 -0
  293. package/module/es5/types/logic/deepRequired.js +5 -0
  294. package/module/es5/types/logic/index.d.ts +3 -0
  295. package/module/es5/types/logic/index.js +33 -0
  296. package/module/es5/types/logic/unionToIntersection.d.ts +12 -0
  297. package/module/es5/types/logic/unionToIntersection.js +5 -0
  298. package/module/es5/types/object/index.d.ts +1 -0
  299. package/module/es5/types/object/index.js +11 -0
  300. package/module/es5/types/object/pickDeep.d.ts +13 -1
  301. package/module/es5/types/object/shallowObjectValue.d.ts +9 -0
  302. package/module/es5/types/object/shallowObjectValue.js +5 -0
  303. package/module/es5/types/string/formatString/formatData.d.ts +17 -0
  304. package/module/es5/types/string/formatString/formatData.js +5 -0
  305. package/module/es5/types/string/formatString/formatOptions.d.ts +21 -0
  306. package/module/es5/types/string/formatString/formatOptions.js +5 -0
  307. package/module/es5/types/string/formatString/formatString.d.ts +4 -0
  308. package/module/es5/types/string/formatString/formatString.js +49 -0
  309. package/module/es5/types/string/formatString/formatValue.d.ts +15 -0
  310. package/module/es5/types/string/formatString/formatValue.js +5 -0
  311. package/module/es5/types/string/formatString/formatter.d.ts +13 -0
  312. package/module/es5/types/string/formatString/formatter.js +5 -0
  313. package/module/es5/types/string/formatString/index.d.ts +5 -0
  314. package/module/es5/types/string/formatString/index.js +60 -0
  315. package/module/es5/types/string/index.d.ts +1 -0
  316. package/module/es5/types/string/index.js +16 -0
  317. package/module/index.d.ts +2 -0
  318. package/module/index.js +2 -0
  319. package/module/index.js.map +1 -1
  320. package/module/types/index.d.ts +1 -0
  321. package/module/types/index.js +1 -0
  322. package/module/types/index.js.map +1 -1
  323. package/module/types/logic/deepPartial.d.ts +37 -0
  324. package/module/types/logic/deepPartial.js +36 -0
  325. package/module/types/logic/deepPartial.js.map +1 -0
  326. package/module/types/logic/deepRequired.d.ts +37 -0
  327. package/module/types/logic/deepRequired.js +2 -0
  328. package/module/types/logic/deepRequired.js.map +1 -0
  329. package/module/types/logic/index.d.ts +3 -0
  330. package/module/types/logic/index.js +3 -0
  331. package/module/types/logic/index.js.map +1 -1
  332. package/module/types/logic/unionToIntersection.d.ts +12 -0
  333. package/module/types/logic/unionToIntersection.js +2 -0
  334. package/module/types/logic/unionToIntersection.js.map +1 -0
  335. package/module/types/object/index.d.ts +1 -0
  336. package/module/types/object/index.js +1 -0
  337. package/module/types/object/index.js.map +1 -1
  338. package/module/types/object/pickDeep.d.ts +13 -1
  339. package/module/types/object/shallowObjectValue.d.ts +9 -0
  340. package/module/types/object/shallowObjectValue.js +2 -0
  341. package/module/types/object/shallowObjectValue.js.map +1 -0
  342. package/module/types/string/formatString/formatData.d.ts +17 -0
  343. package/module/types/string/formatString/formatData.js +2 -0
  344. package/module/types/string/formatString/formatData.js.map +1 -0
  345. package/module/types/string/formatString/formatOptions.d.ts +21 -0
  346. package/module/types/string/formatString/formatOptions.js +2 -0
  347. package/module/types/string/formatString/formatOptions.js.map +1 -0
  348. package/module/types/string/formatString/formatString.d.ts +4 -0
  349. package/module/types/string/formatString/formatString.js +5 -0
  350. package/module/types/string/formatString/formatString.js.map +1 -0
  351. package/module/types/string/formatString/formatValue.d.ts +15 -0
  352. package/module/types/string/formatString/formatValue.js +2 -0
  353. package/module/types/string/formatString/formatValue.js.map +1 -0
  354. package/module/types/string/formatString/formatter.d.ts +13 -0
  355. package/module/types/string/formatString/formatter.js +2 -0
  356. package/module/types/string/formatString/formatter.js.map +1 -0
  357. package/module/types/string/formatString/index.d.ts +5 -0
  358. package/module/types/string/formatString/index.js +6 -0
  359. package/module/types/string/formatString/index.js.map +1 -0
  360. package/module/types/string/index.d.ts +1 -0
  361. package/module/types/string/index.js +2 -0
  362. package/module/types/string/index.js.map +1 -0
  363. package/package.json +40 -41
  364. package/module/String/formatString.d.ts +0 -13
  365. package/module/String/formatString.js +0 -18
  366. package/module/String/formatString.js.map +0 -1
  367. package/module/es5/String/formatString.d.ts +0 -13
  368. package/module/es5/String/formatString.js +0 -26
@@ -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("<script>alert("Hello");</script>");
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,45 @@
1
+ /**
2
+ * HTML entities map for unescaping
3
+ */
4
+ const htmlUnescapeMap = {
5
+ "&amp;": "&",
6
+ "&lt;": "<",
7
+ "&gt;": ">",
8
+ "&quot;": '"',
9
+ "&#39;": "'",
10
+ "&#x27;": "'",
11
+ "&#x2F;": "/",
12
+ "&#x60;": "`",
13
+ "&#x3D;": "=",
14
+ };
15
+ /**
16
+ * Unescapes HTML entities in a string
17
+ * @param string_ - The string to unescape
18
+ * @returns The unescaped string with HTML entities converted back to their original characters
19
+ * @example
20
+ * ```typescript
21
+ * unescapeHtml("&lt;script&gt;alert(&quot;Hello&quot;);&lt;/script&gt;");
22
+ * // Returns: "<script>alert("Hello");</script>"
23
+ *
24
+ * unescapeHtml("Tom &amp; Jerry");
25
+ * // Returns: "Tom & Jerry"
26
+ *
27
+ * unescapeHtml("5 &lt; 10 &amp;&amp; 10 &gt; 5");
28
+ * // Returns: "5 < 10 && 10 > 5"
29
+ * ```
30
+ */
31
+ export const unescapeHtml = (string_) => {
32
+ const entityRegex = /&(?:amp|lt|gt|quot|#39|#x27|#x2F|#x60|#x3D);|&#(\d*);|&#x([0-9a-fA-F]*);/g;
33
+ return string_.replaceAll(entityRegex, (match, dec, hex) => {
34
+ if (dec !== undefined) {
35
+ const codePoint = Number.parseInt(dec, 10);
36
+ return Number.isNaN(codePoint) ? match : String.fromCodePoint(codePoint);
37
+ }
38
+ if (hex !== undefined) {
39
+ const codePoint = Number.parseInt(hex, 16);
40
+ return Number.isNaN(codePoint) ? match : String.fromCodePoint(codePoint);
41
+ }
42
+ return htmlUnescapeMap[match];
43
+ });
44
+ };
45
+ //# sourceMappingURL=unescapeHtml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unescapeHtml.js","sourceRoot":"","sources":["../../src/String/unescapeHtml.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,eAAe,GAA2B;IAC9C,OAAO,EAAE,GAAG;IACZ,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,GAAG;IACX,QAAQ,EAAE,GAAG;IACb,OAAO,EAAE,GAAG;IACZ,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;CACd,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAe,EAAU,EAAE;IACtD,MAAM,WAAW,GACf,2EAA2E,CAAC;IAE9E,OAAO,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;QACzD,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YAC3C,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAC3E,CAAC;QACD,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YAC3C,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAC3E,CAAC;QACD,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -9,7 +9,6 @@
9
9
  * @returns {Function} - A validator function that accepts a value, options, and message
10
10
  */
11
11
  export const core = (type) => (value, option = [], message) => {
12
- // biome-ignore lint/suspicious/useValidTypeof: Type parameter is a string literal type from Types<T>
13
12
  if (typeof value !== type) {
14
13
  return {
15
14
  validate: false,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Validate/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,IAAI,GACf,CAAI,IAAc,EAAE,EAAE,CACtB,CACE,KAAQ,EACR,SAAY,EAAkB,EAC9B,OAAgB,EACW,EAAE;IAC7B,qGAAqG;IACrG,IAAI,OAAO,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1B,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,OAAO,IAAI,EAAE;YACtB,IAAI;SACL,CAAC;IACJ,CAAC;IACD,KAAK,MAAM,QAAQ,IAAI,MAAM,EAAE,CAAC;QAC9B,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9B,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,QAAQ,CAAC,OAAO,IAAI,EAAE;gBAC/B,IAAI;aACL,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO;QACL,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,IAAI;KACL,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Validate/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,IAAI,GACf,CAAI,IAAc,EAAE,EAAE,CACtB,CACE,KAAQ,EACR,SAAY,EAAkB,EAC9B,OAAgB,EACW,EAAE;IAC7B,IAAI,OAAO,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1B,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,OAAO,IAAI,EAAE;YACtB,IAAI;SACL,CAAC;IACJ,CAAC;IACD,KAAK,MAAM,QAAQ,IAAI,MAAM,EAAE,CAAC;QAC9B,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9B,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,QAAQ,CAAC,OAAO,IAAI,EAAE;gBAC/B,IAAI;aACL,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO;QACL,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,IAAI;KACL,CAAC;AACJ,CAAC,CAAC"}
@@ -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";
@@ -5,6 +5,7 @@ export * from "./number";
5
5
  export * from "./object";
6
6
  export * from "./string";
7
7
  // Other Validate
8
+ export * from "./isDeepEqual";
8
9
  export * from "./isArray";
9
10
  export * from "./isBrowser";
10
11
  export * from "./isBun";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Validate/index.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AAEzB,iBAAiB;AACjB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Validate/index.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AAEzB,iBAAiB;AACjB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
@@ -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,148 @@
1
+ /**
2
+ * Performs a deep equality comparison between two values
3
+ *
4
+ * @param a - First value to compare
5
+ * @param b - Second value to compare
6
+ * @param options - Comparison options
7
+ * @returns true if values are deeply equal, false otherwise
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * isDeepEqual({ a: 1, b: [2, 3] }, { b: [2, 3], a: 1 }); // true
12
+ * isDeepEqual([1, 2, 3], [3, 2, 1]); // false
13
+ * isDeepEqual([1, 2, 3], [3, 2, 1], { strictOrder: false }); // true
14
+ * isDeepEqual(new Set([1, 2]), new Set([2, 1])); // true
15
+ * isDeepEqual(new Map([['a', 1]]), new Map([['a', 1]])); // true
16
+ * ```
17
+ */
18
+ export function isDeepEqual(a, b, options = {}) {
19
+ const { strictOrder = true } = options;
20
+ const visited = new WeakSet();
21
+ function compare(x, y) {
22
+ if (Object.is(x, y)) {
23
+ return true;
24
+ }
25
+ if (x == null || y == null) {
26
+ return false;
27
+ }
28
+ if (typeof x !== typeof y) {
29
+ return false;
30
+ }
31
+ if (typeof x !== "object" || typeof y !== "object") {
32
+ return false;
33
+ }
34
+ if (visited.has(x) || visited.has(y)) {
35
+ return true;
36
+ }
37
+ visited.add(x);
38
+ visited.add(y);
39
+ const ctorX = x.constructor;
40
+ const ctorY = y.constructor;
41
+ if (ctorX !== ctorY) {
42
+ return false;
43
+ }
44
+ if (x instanceof Date && y instanceof Date) {
45
+ return x.getTime() === y.getTime();
46
+ }
47
+ if (x instanceof RegExp && y instanceof RegExp) {
48
+ return x.toString() === y.toString();
49
+ }
50
+ if (Array.isArray(x) && Array.isArray(y)) {
51
+ if (x.length !== y.length) {
52
+ return false;
53
+ }
54
+ if (strictOrder) {
55
+ for (const [index, element] of x.entries()) {
56
+ if (!compare(element, y[index])) {
57
+ return false;
58
+ }
59
+ }
60
+ }
61
+ else {
62
+ const yCopy = [...y];
63
+ for (const itemX of x) {
64
+ let found = false;
65
+ for (let index = 0; index < yCopy.length; index++) {
66
+ if (compare(itemX, yCopy[index])) {
67
+ yCopy.splice(index, 1);
68
+ found = true;
69
+ break;
70
+ }
71
+ }
72
+ if (!found) {
73
+ return false;
74
+ }
75
+ }
76
+ return yCopy.length === 0;
77
+ }
78
+ return true;
79
+ }
80
+ if (x instanceof Set && y instanceof Set) {
81
+ if (x.size !== y.size) {
82
+ return false;
83
+ }
84
+ for (const item of x) {
85
+ let found = false;
86
+ for (const otherItem of y) {
87
+ if (compare(item, otherItem)) {
88
+ found = true;
89
+ break;
90
+ }
91
+ }
92
+ if (!found) {
93
+ return false;
94
+ }
95
+ }
96
+ return true;
97
+ }
98
+ if (x instanceof Map && y instanceof Map) {
99
+ if (x.size !== y.size) {
100
+ return false;
101
+ }
102
+ for (const [key, value] of x) {
103
+ let found = false;
104
+ for (const [otherKey, otherValue] of y) {
105
+ if (compare(key, otherKey) && compare(value, otherValue)) {
106
+ found = true;
107
+ break;
108
+ }
109
+ }
110
+ if (!found) {
111
+ return false;
112
+ }
113
+ }
114
+ return true;
115
+ }
116
+ if (ArrayBuffer.isView(x) && ArrayBuffer.isView(y)) {
117
+ const xArray = x;
118
+ const yArray = y;
119
+ if (xArray.byteLength !== yArray.byteLength) {
120
+ return false;
121
+ }
122
+ for (let index = 0; index < xArray.byteLength; index++) {
123
+ if (xArray[index] !== yArray[index]) {
124
+ return false;
125
+ }
126
+ }
127
+ return true;
128
+ }
129
+ const keysX = Object.keys(x);
130
+ const keysY = Object.keys(y);
131
+ if (keysX.length !== keysY.length) {
132
+ return false;
133
+ }
134
+ for (const key of keysX) {
135
+ if (!(key in y)) {
136
+ return false;
137
+ }
138
+ }
139
+ for (const key of keysX) {
140
+ if (!compare(x[key], y[key])) {
141
+ return false;
142
+ }
143
+ }
144
+ return true;
145
+ }
146
+ return compare(a, b);
147
+ }
148
+ //# sourceMappingURL=isDeepEqual.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isDeepEqual.js","sourceRoot":"","sources":["../../src/Validate/isDeepEqual.ts"],"names":[],"mappings":"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"}
@@ -10,7 +10,7 @@
10
10
  const isDouble = (x, loose = true) => {
11
11
  if (loose) {
12
12
  return (
13
- // biome-ignore lint/suspicious/noGlobalIsFinite: <explanation>
13
+ // biome-ignore lint/suspicious/noGlobalIsFinite: ignore
14
14
  isFinite(x) &&
15
15
  !Number.isNaN(x) &&
16
16
  Number.isFinite(Number(x)) &&
@@ -1 +1 @@
1
- {"version":3,"file":"isDouble.js","sourceRoot":"","sources":["../../src/Validate/isDouble.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,QAAQ,GAAG,CACf,CAAU,EACV,QAAW,IAAS,EAC4B,EAAE;IAClD,IAAI,KAAK,EAAE,CAAC;QACV,OAAO;QACL,+DAA+D;QAC/D,QAAQ,CAAC,CAAW,CAAC;YACrB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAChB,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC1B,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAC7B,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"isDouble.js","sourceRoot":"","sources":["../../src/Validate/isDouble.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,QAAQ,GAAG,CACf,CAAU,EACV,QAAW,IAAS,EAC4B,EAAE;IAClD,IAAI,KAAK,EAAE,CAAC;QACV,OAAO;QACL,wDAAwD;QACxD,QAAQ,CAAC,CAAW,CAAC;YACrB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAChB,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC1B,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAC7B,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -3,6 +3,7 @@
3
3
  */
4
4
  export const isNode = () => {
5
5
  try {
6
+ // biome-ignore lint/nursery/noProcessGlobal: ignore
6
7
  return typeof process !== "undefined" && typeof require !== "undefined";
7
8
  }
8
9
  catch {
@@ -1 +1 @@
1
- {"version":3,"file":"isNode.js","sourceRoot":"","sources":["../../src/Validate/isNode.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE;IACzB,IAAI,CAAC;QACH,OAAO,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,OAAO,KAAK,WAAW,CAAC;IAC1E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC"}
1
+ {"version":3,"file":"isNode.js","sourceRoot":"","sources":["../../src/Validate/isNode.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE;IACzB,IAAI,CAAC;QACH,oDAAoD;QACpD,OAAO,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,OAAO,KAAK,WAAW,CAAC;IAC1E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC"}
@@ -15,7 +15,7 @@ const isNumber = (number, loose = true) => {
15
15
  return false;
16
16
  }
17
17
  return number !== null && typeof number !== "boolean" && loose
18
- ? // biome-ignore lint/suspicious/noGlobalIsFinite: <explanation>
18
+ ? // biome-ignore lint/suspicious/noGlobalIsFinite: ignore
19
19
  isFinite(number)
20
20
  : Number.isFinite(number);
21
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"isNumber.js","sourceRoot":"","sources":["../../src/Validate/isNumber.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,QAAQ,GAAG,CACf,MAAe,EACf,QAAW,IAAS,EACiC,EAAE;IACvD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,SAAS,IAAI,KAAK;QAC5D,CAAC,CAAC,+DAA+D;YAC/D,QAAQ,CAAC,MAAgB,CAAC;QAC5B,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAgB,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"isNumber.js","sourceRoot":"","sources":["../../src/Validate/isNumber.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,QAAQ,GAAG,CACf,MAAe,EACf,QAAW,IAAS,EACiC,EAAE;IACvD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,SAAS,IAAI,KAAK;QAC5D,CAAC,CAAC,wDAAwD;YACxD,QAAQ,CAAC,MAAgB,CAAC;QAC5B,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAgB,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -10,7 +10,7 @@
10
10
  * isValueNaN(parseInt("not a number")); // true
11
11
  */
12
12
  export const isValueNaN = (value, loose = false) => {
13
- // biome-ignore lint/suspicious/noGlobalIsNan: <explanation>
13
+ // biome-ignore lint/suspicious/noGlobalIsNan: ignore
14
14
  return loose ? isNaN(value) : Number.isNaN(value);
15
15
  };
16
16
  //# sourceMappingURL=isValueNaN.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isValueNaN.js","sourceRoot":"","sources":["../../src/Validate/isValueNaN.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAc,EAAE,KAAK,GAAG,KAAK,EAAW,EAAE;IACnE,4DAA4D;IAC5D,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAe,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC,CAAC"}
1
+ {"version":3,"file":"isValueNaN.js","sourceRoot":"","sources":["../../src/Validate/isValueNaN.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAc,EAAE,KAAK,GAAG,KAAK,EAAW,EAAE;IACnE,qDAAqD;IACrD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAe,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC,CAAC"}
@@ -2,6 +2,7 @@
2
2
  * Number validation module for even numbers
3
3
  * Provides validation functionality for checking if a number is even
4
4
  */
5
+ import { isDouble } from "../../Validate/isDouble";
5
6
  /**
6
7
  * Creates a validator for checking if a number is even
7
8
  * @param {string} [message] - Custom error message for validation failure
@@ -11,7 +12,12 @@ export const even = (message) => {
11
12
  return {
12
13
  type: "number",
13
14
  message,
14
- validate: (value) => value % 2 === 0,
15
+ validate: (value) => {
16
+ if (isDouble(value, false)) {
17
+ return false;
18
+ }
19
+ return value % 2 === 0;
20
+ },
15
21
  };
16
22
  };
17
23
  //# sourceMappingURL=even.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"even.js","sourceRoot":"","sources":["../../../src/Validate/number/even.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,OAAgB,EAA8B,EAAE;IACnE,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO;QACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC;KACrC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"even.js","sourceRoot":"","sources":["../../../src/Validate/number/even.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,OAAgB,EAA8B,EAAE;IACnE,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO;QACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,IAAI,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;gBAC3B,OAAO,KAAK,CAAC;YACf,CAAC;YACD,OAAO,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -1,8 +1,14 @@
1
+ import { isDouble } from "../../Validate/isDouble";
1
2
  export const odd = (message) => {
2
3
  return {
3
4
  type: "number",
4
5
  message,
5
- validate: (value) => value % 2 !== 0,
6
+ validate: (value) => {
7
+ if (isDouble(value, false)) {
8
+ return false;
9
+ }
10
+ return value % 2 !== 0;
11
+ },
6
12
  };
7
13
  };
8
14
  //# sourceMappingURL=odd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"odd.js","sourceRoot":"","sources":["../../../src/Validate/number/odd.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,OAAgB,EAA8B,EAAE;IAClE,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO;QACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC;KACrC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"odd.js","sourceRoot":"","sources":["../../../src/Validate/number/odd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG/C,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,OAAgB,EAA8B,EAAE;IAClE,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO;QACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,IAAI,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;gBAC3B,OAAO,KAAK,CAAC;YACf,CAAC;YACD,OAAO,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -9,11 +9,29 @@
9
9
  */
10
10
  export const email = (message) => {
11
11
  // Regular expression for email address validation
12
- const emailRegex = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
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
13
  return {
14
14
  type: "string",
15
15
  message,
16
- validate: (value) => emailRegex.test(value),
16
+ validate: (value) => {
17
+ // Check for consecutive dots
18
+ if (value.includes("..")) {
19
+ return false;
20
+ }
21
+ // Check for leading/trailing dots in local part
22
+ const [localPart, domainPart] = value.split("@");
23
+ if (!(localPart && domainPart)) {
24
+ return false;
25
+ }
26
+ if (localPart.startsWith(".") || localPart.endsWith(".")) {
27
+ return false;
28
+ }
29
+ if (domainPart.startsWith(".") || domainPart.endsWith(".")) {
30
+ return false;
31
+ }
32
+ // Use regex for final validation
33
+ return emailRegex.test(value);
34
+ },
17
35
  };
18
36
  };
19
37
  //# sourceMappingURL=email.js.map
@@ -1 +1 @@
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,gEAAgE,CAAC;IACnE,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO;QACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;KAC5C,CAAC;AACJ,CAAC,CAAC"}
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,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;YACD,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"}
@@ -4,6 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.generateNumberArray = void 0;
7
+ var _addition = require("@/Math/addition");
8
+ var _division = require("@/Math/division");
9
+ var _multiplication = require("@/Math/multiplication");
10
+ var _subtract = require("@/Math/subtract");
7
11
  /**
8
12
  * Generates an array of numbers with the specified length
9
13
  * @param length The length of the array
@@ -16,28 +20,30 @@ exports.generateNumberArray = void 0;
16
20
  */
17
21
  var generateNumberArray = exports.generateNumberArray = function generateNumberArray(length) {
18
22
  var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
19
- var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : length - 1;
23
+ var max = arguments.length > 2 ? arguments[2] : undefined;
20
24
  var random = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
21
- if (length <= 0) {
25
+ var actualLength = Math.floor(length);
26
+ var actualMax = max !== null && max !== void 0 ? max : actualLength - 1;
27
+ if (actualLength <= 0) {
22
28
  return [];
23
29
  }
24
- if (min > max) {
30
+ if (min > actualMax) {
25
31
  throw new Error("min should be less than or equal to max");
26
32
  }
27
- if (length === 1) {
33
+ if (actualLength === 1) {
28
34
  return [min];
29
35
  }
30
36
  if (random) {
31
37
  return Array.from({
32
- length: length
38
+ length: actualLength
33
39
  }, function () {
34
- return Math.floor(Math.random() * (max - min + 1)) + min;
40
+ return (0, _addition.addition)(Math.floor((0, _multiplication.multiplication)(Math.random(), (0, _addition.addition)((0, _subtract.subtract)(actualMax, min), 1))), min);
35
41
  });
36
42
  }
37
- var step = (max - min) / (length - 1);
43
+ var step = (0, _division.division)((0, _subtract.subtract)(actualMax, min), (0, _subtract.subtract)(actualLength, 1));
38
44
  return Array.from({
39
- length: length
45
+ length: actualLength
40
46
  }, function (_, index) {
41
- return min + index * step;
47
+ return (0, _addition.addition)(min, (0, _multiplication.multiplication)(index, step));
42
48
  });
43
49
  };
@@ -4,6 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getArraysCommon = void 0;
7
+ 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; } } }; }
8
+ 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; } }
9
+ 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; }
7
10
  /**
8
11
  * Extract common elements from multiple arrays
9
12
  * @param {T[]} array The first array
@@ -15,10 +18,42 @@ var getArraysCommon = exports.getArraysCommon = function getArraysCommon(array)
15
18
  for (var _len = arguments.length, arrays = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
16
19
  arrays[_key - 1] = arguments[_key];
17
20
  }
18
- var result = [array].concat(arrays).reduce(function (previous, current) {
19
- return previous.filter(function (item) {
20
- return current.includes(item);
21
+ if (arrays.length === 0) {
22
+ return array;
23
+ }
24
+ var result = array.filter(function (item) {
25
+ // Handle NaN specially since NaN !== NaN
26
+ if (Number.isNaN(item)) {
27
+ return arrays.every(function (currentArray) {
28
+ return currentArray.some(function (arrayItem) {
29
+ return Number.isNaN(arrayItem);
30
+ });
31
+ });
32
+ }
33
+ return arrays.every(function (currentArray) {
34
+ return currentArray.includes(item);
21
35
  });
22
36
  });
23
- return result;
37
+ var uniqueResult = [];
38
+ var _iterator = _createForOfIteratorHelper(result),
39
+ _step;
40
+ try {
41
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
42
+ var item = _step.value;
43
+ if (Number.isNaN(item)) {
44
+ if (!uniqueResult.some(function (existing) {
45
+ return Number.isNaN(existing);
46
+ })) {
47
+ uniqueResult.push(item);
48
+ }
49
+ } else if (!uniqueResult.includes(item)) {
50
+ uniqueResult.push(item);
51
+ }
52
+ }
53
+ } catch (err) {
54
+ _iterator.e(err);
55
+ } finally {
56
+ _iterator.f();
57
+ }
58
+ return uniqueResult;
24
59
  };
@@ -20,7 +20,7 @@ var groupBy = exports.groupBy = function groupBy(array, iteratee) {
20
20
  for (var index = 0; index < length; index++) {
21
21
  var value = array[index];
22
22
  var key = iteratee(value, index, array);
23
- // biome-ignore lint/suspicious/noAssignInExpressions: <explanation>
23
+ // biome-ignore lint/suspicious/noAssignInExpressions: ignore
24
24
  (result[key] || (result[key] = [])).push(value);
25
25
  }
26
26
  return result;
@@ -21,5 +21,7 @@ export * from "./shuffle2DArray";
21
21
  export * from "./sum";
22
22
  export * from "./timSort";
23
23
  export * from "./ultraNumberSort";
24
+ export * from "./uniqBy";
25
+ export * from "./unique";
24
26
  export * from "./zip";
25
27
  export * from "./zipLongest";
@@ -256,6 +256,28 @@ Object.keys(_ultraNumberSort).forEach(function (key) {
256
256
  }
257
257
  });
258
258
  });
259
+ var _uniqBy = require("./uniqBy");
260
+ Object.keys(_uniqBy).forEach(function (key) {
261
+ if (key === "default" || key === "__esModule") return;
262
+ if (key in exports && exports[key] === _uniqBy[key]) return;
263
+ Object.defineProperty(exports, key, {
264
+ enumerable: true,
265
+ get: function get() {
266
+ return _uniqBy[key];
267
+ }
268
+ });
269
+ });
270
+ var _unique = require("./unique");
271
+ Object.keys(_unique).forEach(function (key) {
272
+ if (key === "default" || key === "__esModule") return;
273
+ if (key in exports && exports[key] === _unique[key]) return;
274
+ Object.defineProperty(exports, key, {
275
+ enumerable: true,
276
+ get: function get() {
277
+ return _unique[key];
278
+ }
279
+ });
280
+ });
259
281
  var _zip = require("./zip");
260
282
  Object.keys(_zip).forEach(function (key) {
261
283
  if (key === "default" || key === "__esModule") return;
@@ -41,7 +41,7 @@ var ultraNumberSort = exports.ultraNumberSort = function ultraNumberSort(array)
41
41
  var hasNaN = false;
42
42
  for (var index = 0; index < length; index++) {
43
43
  var value = array[index];
44
- // biome-ignore lint/suspicious/noSelfCompare: <explanation>
44
+ // biome-ignore lint/suspicious/noSelfCompare: ignore
45
45
  if (value !== value) {
46
46
  hasNaN = true;
47
47
  break;
@@ -132,7 +132,7 @@ var handleNaNSort = function handleNaNSort(array, ascending) {
132
132
  try {
133
133
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
134
134
  var element = _step.value;
135
- // biome-ignore lint/suspicious/noSelfCompare: <explanation>
135
+ // biome-ignore lint/suspicious/noSelfCompare: ignore
136
136
  if (element === element) {
137
137
  valid.push(element);
138
138
  } else {
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Removes duplicate values from an array based on a selector function
3
+ * @param array - The array to process
4
+ * @param selector - Function that returns the value to compare for uniqueness
5
+ * @returns A new array with unique values based on the selector
6
+ */
7
+ export declare const uniqBy: <T extends unknown[], K>(array: T, selector: (item: T[number]) => K) => T;