umt 2.2.1 → 2.4.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 (393) hide show
  1. package/module/Array/chunk.js +5 -3
  2. package/module/Array/chunk.js.map +1 -1
  3. package/module/Array/dualPivotQuickSort.d.ts +1 -2
  4. package/module/Array/dualPivotQuickSort.js +5 -26
  5. package/module/Array/dualPivotQuickSort.js.map +1 -1
  6. package/module/Array/quickSort.js +7 -25
  7. package/module/Array/quickSort.js.map +1 -1
  8. package/module/Array/sortingHelpers/applyInsertionSortIfNeeded.d.ts +13 -0
  9. package/module/Array/sortingHelpers/applyInsertionSortIfNeeded.js +20 -0
  10. package/module/Array/sortingHelpers/applyInsertionSortIfNeeded.js.map +1 -0
  11. package/module/Array/sortingHelpers/rangeValidator.d.ts +17 -0
  12. package/module/Array/sortingHelpers/rangeValidator.js +26 -0
  13. package/module/Array/sortingHelpers/rangeValidator.js.map +1 -0
  14. package/module/Function/curry.d.ts +141 -0
  15. package/module/Function/curry.js +11 -0
  16. package/module/Function/curry.js.map +1 -0
  17. package/module/Function/index.d.ts +1 -0
  18. package/module/Function/index.js +2 -0
  19. package/module/Function/index.js.map +1 -0
  20. package/module/Tool/index.d.ts +1 -0
  21. package/module/Tool/index.js +1 -0
  22. package/module/Tool/index.js.map +1 -1
  23. package/module/Tool/pipe.d.ts +66 -0
  24. package/module/Tool/pipe.js +98 -0
  25. package/module/Tool/pipe.js.map +1 -0
  26. package/module/Validate/index.d.ts +1 -0
  27. package/module/Validate/index.js +1 -0
  28. package/module/Validate/index.js.map +1 -1
  29. package/module/Validate/isString.d.ts +9 -0
  30. package/module/Validate/isString.js +12 -0
  31. package/module/Validate/isString.js.map +1 -0
  32. package/module/Validate/object/core.d.ts +2 -6
  33. package/module/Validate/object/core.js.map +1 -1
  34. package/module/Validate/type.d.ts +1 -0
  35. package/module/es5/Array/chunk.js +5 -3
  36. package/module/es5/Array/dualPivotQuickSort.d.ts +1 -2
  37. package/module/es5/Array/dualPivotQuickSort.js +8 -28
  38. package/module/es5/Array/quickSort.js +10 -25
  39. package/module/es5/Array/sortingHelpers/applyInsertionSortIfNeeded.d.ts +13 -0
  40. package/module/es5/Array/sortingHelpers/applyInsertionSortIfNeeded.js +25 -0
  41. package/module/es5/Array/sortingHelpers/rangeValidator.d.ts +17 -0
  42. package/module/es5/Array/sortingHelpers/rangeValidator.js +35 -0
  43. package/module/es5/Function/curry.d.ts +141 -0
  44. package/module/es5/Function/curry.js +38 -0
  45. package/module/es5/Function/index.d.ts +1 -0
  46. package/module/es5/Function/index.js +16 -0
  47. package/module/es5/Tool/index.d.ts +1 -0
  48. package/module/es5/Tool/index.js +11 -0
  49. package/module/es5/Tool/pipe.d.ts +66 -0
  50. package/module/es5/Tool/pipe.js +129 -0
  51. package/module/es5/Validate/index.d.ts +1 -0
  52. package/module/es5/Validate/index.js +11 -0
  53. package/module/es5/Validate/isString.d.ts +9 -0
  54. package/module/es5/Validate/isString.js +16 -0
  55. package/module/es5/Validate/object/core.d.ts +2 -6
  56. package/module/es5/Validate/type.d.ts +1 -0
  57. package/module/es5/index.d.ts +1 -0
  58. package/module/es5/index.js +11 -0
  59. package/module/es5/tsconfig.tsbuildinfo +1 -1
  60. package/module/index.d.ts +1 -0
  61. package/module/index.js +1 -0
  62. package/module/index.js.map +1 -1
  63. package/package.json +26 -22
  64. package/module/es5/tests/integration/Array/drop-and-first.test.d.ts +0 -1
  65. package/module/es5/tests/integration/Array/drop-and-first.test.js +0 -34
  66. package/module/es5/tests/integration/Tool/parseJson-and-Validate.test.d.ts +0 -1
  67. package/module/es5/tests/integration/Tool/parseJson-and-Validate.test.js +0 -80
  68. package/module/es5/tests/unit/Advance/rangeAdvance.test.d.ts +0 -1
  69. package/module/es5/tests/unit/Advance/rangeAdvance.test.js +0 -26
  70. package/module/es5/tests/unit/Array/arraysJoin.test.d.ts +0 -1
  71. package/module/es5/tests/unit/Array/arraysJoin.test.js +0 -19
  72. package/module/es5/tests/unit/Array/binarySearch.test.d.ts +0 -1
  73. package/module/es5/tests/unit/Array/binarySearch.test.js +0 -32
  74. package/module/es5/tests/unit/Array/checkFlagAlignment.test.d.ts +0 -1
  75. package/module/es5/tests/unit/Array/checkFlagAlignment.test.js +0 -206
  76. package/module/es5/tests/unit/Array/chunk.test.d.ts +0 -1
  77. package/module/es5/tests/unit/Array/chunk.test.js +0 -51
  78. package/module/es5/tests/unit/Array/compact.test.d.ts +0 -1
  79. package/module/es5/tests/unit/Array/compact.test.js +0 -53
  80. package/module/es5/tests/unit/Array/compareFunctionDefault.test.d.ts +0 -1
  81. package/module/es5/tests/unit/Array/compareFunctionDefault.test.js +0 -29
  82. package/module/es5/tests/unit/Array/drop.test.d.ts +0 -1
  83. package/module/es5/tests/unit/Array/drop.test.js +0 -84
  84. package/module/es5/tests/unit/Array/dualPivotQuickSort.test.d.ts +0 -1
  85. package/module/es5/tests/unit/Array/dualPivotQuickSort.test.js +0 -87
  86. package/module/es5/tests/unit/Array/first.test.d.ts +0 -1
  87. package/module/es5/tests/unit/Array/first.test.js +0 -28
  88. package/module/es5/tests/unit/Array/generateNumberArray.test.d.ts +0 -1
  89. package/module/es5/tests/unit/Array/generateNumberArray.test.js +0 -34
  90. package/module/es5/tests/unit/Array/getArraysCommon.test.d.ts +0 -1
  91. package/module/es5/tests/unit/Array/getArraysCommon.test.js +0 -40
  92. package/module/es5/tests/unit/Array/getArraysDiff.test.d.ts +0 -1
  93. package/module/es5/tests/unit/Array/getArraysDiff.test.js +0 -99
  94. package/module/es5/tests/unit/Array/groupBy.test.d.ts +0 -1
  95. package/module/es5/tests/unit/Array/groupBy.test.js +0 -87
  96. package/module/es5/tests/unit/Array/insertionSort.test.d.ts +0 -1
  97. package/module/es5/tests/unit/Array/insertionSort.test.js +0 -37
  98. package/module/es5/tests/unit/Array/mergeSort.test.d.ts +0 -1
  99. package/module/es5/tests/unit/Array/mergeSort.test.js +0 -49
  100. package/module/es5/tests/unit/Array/pop.test.d.ts +0 -1
  101. package/module/es5/tests/unit/Array/pop.test.js +0 -50
  102. package/module/es5/tests/unit/Array/quickSort.test.d.ts +0 -1
  103. package/module/es5/tests/unit/Array/quickSort.test.js +0 -118
  104. package/module/es5/tests/unit/Array/randomSelect.test.d.ts +0 -1
  105. package/module/es5/tests/unit/Array/randomSelect.test.js +0 -51
  106. package/module/es5/tests/unit/Array/range.test.d.ts +0 -1
  107. package/module/es5/tests/unit/Array/range.test.js +0 -42
  108. package/module/es5/tests/unit/Array/shuffle.test.d.ts +0 -1
  109. package/module/es5/tests/unit/Array/shuffle.test.js +0 -84
  110. package/module/es5/tests/unit/Array/shuffle2DArray.test.d.ts +0 -1
  111. package/module/es5/tests/unit/Array/shuffle2DArray.test.js +0 -90
  112. package/module/es5/tests/unit/Array/sum.test.d.ts +0 -1
  113. package/module/es5/tests/unit/Array/sum.test.js +0 -44
  114. package/module/es5/tests/unit/Array/timSort.test.d.ts +0 -1
  115. package/module/es5/tests/unit/Array/timSort.test.js +0 -128
  116. package/module/es5/tests/unit/Array/zip.test.d.ts +0 -1
  117. package/module/es5/tests/unit/Array/zip.test.js +0 -69
  118. package/module/es5/tests/unit/Array/zipLongest.test.d.ts +0 -1
  119. package/module/es5/tests/unit/Array/zipLongest.test.js +0 -74
  120. package/module/es5/tests/unit/Color/cmykToRgba.test.d.ts +0 -1
  121. package/module/es5/tests/unit/Color/cmykToRgba.test.js +0 -58
  122. package/module/es5/tests/unit/Color/hexaToRgba.test.d.ts +0 -1
  123. package/module/es5/tests/unit/Color/hexaToRgba.test.js +0 -115
  124. package/module/es5/tests/unit/Color/hslaToRgba.test.d.ts +0 -1
  125. package/module/es5/tests/unit/Color/hslaToRgba.test.js +0 -141
  126. package/module/es5/tests/unit/Color/rgbaToCmyk.test.d.ts +0 -1
  127. package/module/es5/tests/unit/Color/rgbaToCmyk.test.js +0 -139
  128. package/module/es5/tests/unit/Color/rgbaToHexA.test.d.ts +0 -1
  129. package/module/es5/tests/unit/Color/rgbaToHexA.test.js +0 -114
  130. package/module/es5/tests/unit/Color/rgbaToHsla.test.d.ts +0 -1
  131. package/module/es5/tests/unit/Color/rgbaToHsla.test.js +0 -190
  132. package/module/es5/tests/unit/Consts/clock.test.d.ts +0 -1
  133. package/module/es5/tests/unit/Consts/clock.test.js +0 -71
  134. package/module/es5/tests/unit/Consts/httpClientErrorStatus.test.d.ts +0 -1
  135. package/module/es5/tests/unit/Consts/httpClientErrorStatus.test.js +0 -33
  136. package/module/es5/tests/unit/Consts/httpInformationalStatus.test.d.ts +0 -1
  137. package/module/es5/tests/unit/Consts/httpInformationalStatus.test.js +0 -13
  138. package/module/es5/tests/unit/Consts/httpRedirectionStatus.test.d.ts +0 -1
  139. package/module/es5/tests/unit/Consts/httpRedirectionStatus.test.js +0 -16
  140. package/module/es5/tests/unit/Consts/httpServerErrorStatus.test.d.ts +0 -1
  141. package/module/es5/tests/unit/Consts/httpServerErrorStatus.test.js +0 -15
  142. package/module/es5/tests/unit/Consts/httpStatus.test.d.ts +0 -1
  143. package/module/es5/tests/unit/Consts/httpStatus.test.js +0 -82
  144. package/module/es5/tests/unit/Consts/httpSuccessStatus.test.d.ts +0 -1
  145. package/module/es5/tests/unit/Consts/httpSuccessStatus.test.js +0 -16
  146. package/module/es5/tests/unit/Date/birthday.test.d.ts +0 -1
  147. package/module/es5/tests/unit/Date/birthday.test.js +0 -31
  148. package/module/es5/tests/unit/Date/dateRange.test.d.ts +0 -1
  149. package/module/es5/tests/unit/Date/dateRange.test.js +0 -40
  150. package/module/es5/tests/unit/Date/dayOfWeek.test.d.ts +0 -1
  151. package/module/es5/tests/unit/Date/dayOfWeek.test.js +0 -39
  152. package/module/es5/tests/unit/Date/deleteSpace.test.d.ts +0 -1
  153. package/module/es5/tests/unit/Date/deleteSpace.test.js +0 -35
  154. package/module/es5/tests/unit/Date/format.test.d.ts +0 -1
  155. package/module/es5/tests/unit/Date/format.test.js +0 -50
  156. package/module/es5/tests/unit/Date/getDay.test.d.ts +0 -1
  157. package/module/es5/tests/unit/Date/getDay.test.js +0 -40
  158. package/module/es5/tests/unit/Date/getTimezoneOffsetString.test.d.ts +0 -1
  159. package/module/es5/tests/unit/Date/getTimezoneOffsetString.test.js +0 -26
  160. package/module/es5/tests/unit/Date/isLeapYear.test.d.ts +0 -1
  161. package/module/es5/tests/unit/Date/isLeapYear.test.js +0 -30
  162. package/module/es5/tests/unit/Date/new.test.d.ts +0 -1
  163. package/module/es5/tests/unit/Date/new.test.js +0 -39
  164. package/module/es5/tests/unit/Date/now.test.d.ts +0 -1
  165. package/module/es5/tests/unit/Date/now.test.js +0 -42
  166. package/module/es5/tests/unit/Error/safeExecute.test.d.ts +0 -1
  167. package/module/es5/tests/unit/Error/safeExecute.test.js +0 -75
  168. package/module/es5/tests/unit/IP/cidrToLong.test.d.ts +0 -1
  169. package/module/es5/tests/unit/IP/cidrToLong.test.js +0 -32
  170. package/module/es5/tests/unit/IP/cidrToSubnetMask.test.d.ts +0 -1
  171. package/module/es5/tests/unit/IP/cidrToSubnetMask.test.js +0 -36
  172. package/module/es5/tests/unit/IP/getIpClass.test.d.ts +0 -1
  173. package/module/es5/tests/unit/IP/getIpClass.test.js +0 -36
  174. package/module/es5/tests/unit/IP/getNetworkAddress.test.d.ts +0 -1
  175. package/module/es5/tests/unit/IP/getNetworkAddress.test.js +0 -40
  176. package/module/es5/tests/unit/IP/ipToBinaryString.test.d.ts +0 -1
  177. package/module/es5/tests/unit/IP/ipToBinaryString.test.js +0 -46
  178. package/module/es5/tests/unit/IP/ipToLong.test.d.ts +0 -1
  179. package/module/es5/tests/unit/IP/ipToLong.test.js +0 -34
  180. package/module/es5/tests/unit/IP/isInRange.test.d.ts +0 -1
  181. package/module/es5/tests/unit/IP/isInRange.test.js +0 -82
  182. package/module/es5/tests/unit/IP/isPrivateIp.test.d.ts +0 -1
  183. package/module/es5/tests/unit/IP/isPrivateIp.test.js +0 -26
  184. package/module/es5/tests/unit/IP/longToIp.test.d.ts +0 -1
  185. package/module/es5/tests/unit/IP/longToIp.test.js +0 -39
  186. package/module/es5/tests/unit/IP/subnetMaskToCidr.test.d.ts +0 -1
  187. package/module/es5/tests/unit/IP/subnetMaskToCidr.test.js +0 -41
  188. package/module/es5/tests/unit/Math/addition.test.d.ts +0 -1
  189. package/module/es5/tests/unit/Math/addition.test.js +0 -79
  190. package/module/es5/tests/unit/Math/average.test.d.ts +0 -1
  191. package/module/es5/tests/unit/Math/average.test.js +0 -48
  192. package/module/es5/tests/unit/Math/bitwise.test.d.ts +0 -1
  193. package/module/es5/tests/unit/Math/bitwise.test.js +0 -62
  194. package/module/es5/tests/unit/Math/calculator/calculator.test.d.ts +0 -1
  195. package/module/es5/tests/unit/Math/calculator/calculator.test.js +0 -76
  196. package/module/es5/tests/unit/Math/calculator/calculatorInitialization.test.d.ts +0 -1
  197. package/module/es5/tests/unit/Math/calculator/calculatorInitialization.test.js +0 -21
  198. package/module/es5/tests/unit/Math/calculator/convertCurrency.test.d.ts +0 -1
  199. package/module/es5/tests/unit/Math/calculator/convertCurrency.test.js +0 -40
  200. package/module/es5/tests/unit/Math/calculator/literalExpression.test.d.ts +0 -1
  201. package/module/es5/tests/unit/Math/calculator/literalExpression.test.js +0 -51
  202. package/module/es5/tests/unit/Math/degToRad.test.d.ts +0 -1
  203. package/module/es5/tests/unit/Math/degToRad.test.js +0 -50
  204. package/module/es5/tests/unit/Math/deviationValue.test.d.ts +0 -1
  205. package/module/es5/tests/unit/Math/deviationValue.test.js +0 -30
  206. package/module/es5/tests/unit/Math/division.test.d.ts +0 -1
  207. package/module/es5/tests/unit/Math/division.test.js +0 -81
  208. package/module/es5/tests/unit/Math/factorial.test.d.ts +0 -1
  209. package/module/es5/tests/unit/Math/factorial.test.js +0 -26
  210. package/module/es5/tests/unit/Math/factorize.test.d.ts +0 -1
  211. package/module/es5/tests/unit/Math/factorize.test.js +0 -38
  212. package/module/es5/tests/unit/Math/flexibleNumberConversion.test.d.ts +0 -1
  213. package/module/es5/tests/unit/Math/flexibleNumberConversion.test.js +0 -195
  214. package/module/es5/tests/unit/Math/gcd.test.d.ts +0 -1
  215. package/module/es5/tests/unit/Math/gcd.test.js +0 -35
  216. package/module/es5/tests/unit/Math/getDecimalLength.test.d.ts +0 -1
  217. package/module/es5/tests/unit/Math/getDecimalLength.test.js +0 -44
  218. package/module/es5/tests/unit/Math/lcm.test.d.ts +0 -1
  219. package/module/es5/tests/unit/Math/lcm.test.js +0 -43
  220. package/module/es5/tests/unit/Math/linearCongruentialGenerator.test.d.ts +0 -1
  221. package/module/es5/tests/unit/Math/linearCongruentialGenerator.test.js +0 -25
  222. package/module/es5/tests/unit/Math/mathConverter.test.d.ts +0 -1
  223. package/module/es5/tests/unit/Math/mathConverter.test.js +0 -37
  224. package/module/es5/tests/unit/Math/mathSeparator.test.d.ts +0 -1
  225. package/module/es5/tests/unit/Math/mathSeparator.test.js +0 -59
  226. package/module/es5/tests/unit/Math/max.test.d.ts +0 -1
  227. package/module/es5/tests/unit/Math/max.test.js +0 -22
  228. package/module/es5/tests/unit/Math/median.test.d.ts +0 -1
  229. package/module/es5/tests/unit/Math/median.test.js +0 -17
  230. package/module/es5/tests/unit/Math/min.test.d.ts +0 -1
  231. package/module/es5/tests/unit/Math/min.test.js +0 -22
  232. package/module/es5/tests/unit/Math/multiples.test.d.ts +0 -1
  233. package/module/es5/tests/unit/Math/multiples.test.js +0 -30
  234. package/module/es5/tests/unit/Math/multiplication.test.d.ts +0 -1
  235. package/module/es5/tests/unit/Math/multiplication.test.js +0 -48
  236. package/module/es5/tests/unit/Math/nCr.test.d.ts +0 -1
  237. package/module/es5/tests/unit/Math/nCr.test.js +0 -34
  238. package/module/es5/tests/unit/Math/nHr.test.d.ts +0 -1
  239. package/module/es5/tests/unit/Math/nHr.test.js +0 -35
  240. package/module/es5/tests/unit/Math/nPr.test.d.ts +0 -1
  241. package/module/es5/tests/unit/Math/nPr.test.js +0 -38
  242. package/module/es5/tests/unit/Math/primeFactorization.test.d.ts +0 -1
  243. package/module/es5/tests/unit/Math/primeFactorization.test.js +0 -84
  244. package/module/es5/tests/unit/Math/quotient.test.d.ts +0 -1
  245. package/module/es5/tests/unit/Math/quotient.test.js +0 -36
  246. package/module/es5/tests/unit/Math/radToDeg.test.d.ts +0 -1
  247. package/module/es5/tests/unit/Math/radToDeg.test.js +0 -50
  248. package/module/es5/tests/unit/Math/random.test.d.ts +0 -1
  249. package/module/es5/tests/unit/Math/random.test.js +0 -61
  250. package/module/es5/tests/unit/Math/reduce.test.d.ts +0 -1
  251. package/module/es5/tests/unit/Math/reduce.test.js +0 -93
  252. package/module/es5/tests/unit/Math/repeatedTrial.test.d.ts +0 -1
  253. package/module/es5/tests/unit/Math/repeatedTrial.test.js +0 -39
  254. package/module/es5/tests/unit/Math/roundOf.test.d.ts +0 -1
  255. package/module/es5/tests/unit/Math/roundOf.test.js +0 -40
  256. package/module/es5/tests/unit/Math/solveEquation.test.d.ts +0 -1
  257. package/module/es5/tests/unit/Math/solveEquation.test.js +0 -24
  258. package/module/es5/tests/unit/Math/standardDeviation.test.d.ts +0 -1
  259. package/module/es5/tests/unit/Math/standardDeviation.test.js +0 -23
  260. package/module/es5/tests/unit/Math/subtract.test.d.ts +0 -1
  261. package/module/es5/tests/unit/Math/subtract.test.js +0 -46
  262. package/module/es5/tests/unit/Math/toBaseN.test.d.ts +0 -1
  263. package/module/es5/tests/unit/Math/toBaseN.test.js +0 -40
  264. package/module/es5/tests/unit/Math/toCelsius.test.d.ts +0 -1
  265. package/module/es5/tests/unit/Math/toCelsius.test.js +0 -18
  266. package/module/es5/tests/unit/Math/toKelvin.test.d.ts +0 -1
  267. package/module/es5/tests/unit/Math/toKelvin.test.js +0 -18
  268. package/module/es5/tests/unit/Math/uuidv7.test.d.ts +0 -1
  269. package/module/es5/tests/unit/Math/uuidv7.test.js +0 -33
  270. package/module/es5/tests/unit/Math/valueSwap.test.d.ts +0 -1
  271. package/module/es5/tests/unit/Math/valueSwap.test.js +0 -28
  272. package/module/es5/tests/unit/Math/xoshiro256.test.d.ts +0 -1
  273. package/module/es5/tests/unit/Math/xoshiro256.test.js +0 -33
  274. package/module/es5/tests/unit/Object/has.test.d.ts +0 -1
  275. package/module/es5/tests/unit/Object/has.test.js +0 -60
  276. package/module/es5/tests/unit/Object/keyBy.test.d.ts +0 -1
  277. package/module/es5/tests/unit/Object/keyBy.test.js +0 -120
  278. package/module/es5/tests/unit/Object/pick.test.d.ts +0 -1
  279. package/module/es5/tests/unit/Object/pick.test.js +0 -109
  280. package/module/es5/tests/unit/Object/pickDeep.test.d.ts +0 -1
  281. package/module/es5/tests/unit/Object/pickDeep.test.js +0 -222
  282. package/module/es5/tests/unit/Simple/Array/quickSortSimple.test.d.ts +0 -1
  283. package/module/es5/tests/unit/Simple/Array/quickSortSimple.test.js +0 -18
  284. package/module/es5/tests/unit/Simple/Date/dayOfWeekSimple.test.d.ts +0 -1
  285. package/module/es5/tests/unit/Simple/Date/dayOfWeekSimple.test.js +0 -58
  286. package/module/es5/tests/unit/Simple/Math/deviationValueSimple.test.d.ts +0 -1
  287. package/module/es5/tests/unit/Simple/Math/deviationValueSimple.test.js +0 -43
  288. package/module/es5/tests/unit/String/deleteSpaces.test.d.ts +0 -1
  289. package/module/es5/tests/unit/String/deleteSpaces.test.js +0 -22
  290. package/module/es5/tests/unit/String/formatString.test.d.ts +0 -1
  291. package/module/es5/tests/unit/String/formatString.test.js +0 -47
  292. package/module/es5/tests/unit/String/fromBase64.test.d.ts +0 -1
  293. package/module/es5/tests/unit/String/fromBase64.test.js +0 -37
  294. package/module/es5/tests/unit/String/hasNoLetters.test.d.ts +0 -1
  295. package/module/es5/tests/unit/String/hasNoLetters.test.js +0 -29
  296. package/module/es5/tests/unit/String/padEnd.test.d.ts +0 -1
  297. package/module/es5/tests/unit/String/padEnd.test.js +0 -22
  298. package/module/es5/tests/unit/String/padStart.test.d.ts +0 -1
  299. package/module/es5/tests/unit/String/padStart.test.js +0 -40
  300. package/module/es5/tests/unit/String/randomString.test.d.ts +0 -1
  301. package/module/es5/tests/unit/String/randomString.test.js +0 -21
  302. package/module/es5/tests/unit/String/randomStringInitialization.test.d.ts +0 -1
  303. package/module/es5/tests/unit/String/randomStringInitialization.test.js +0 -25
  304. package/module/es5/tests/unit/String/reverseString.test.d.ts +0 -1
  305. package/module/es5/tests/unit/String/reverseString.test.js +0 -35
  306. package/module/es5/tests/unit/String/toBase64.test.d.ts +0 -1
  307. package/module/es5/tests/unit/String/toBase64.test.js +0 -20
  308. package/module/es5/tests/unit/String/toHalfWidth.test.d.ts +0 -1
  309. package/module/es5/tests/unit/String/toHalfWidth.test.js +0 -16
  310. package/module/es5/tests/unit/String/trimCharacters.test.d.ts +0 -1
  311. package/module/es5/tests/unit/String/trimCharacters.test.js +0 -17
  312. package/module/es5/tests/unit/String/trimEndCharacters.test.d.ts +0 -1
  313. package/module/es5/tests/unit/String/trimEndCharacters.test.js +0 -33
  314. package/module/es5/tests/unit/String/trimStartCharacters.test.d.ts +0 -1
  315. package/module/es5/tests/unit/String/trimStartCharacters.test.js +0 -33
  316. package/module/es5/tests/unit/Time/convertTime.test.d.ts +0 -1
  317. package/module/es5/tests/unit/Time/convertTime.test.js +0 -135
  318. package/module/es5/tests/unit/Time/normalizeTimeUnit.test.d.ts +0 -1
  319. package/module/es5/tests/unit/Time/normalizeTimeUnit.test.js +0 -29
  320. package/module/es5/tests/unit/Tool/createPipeline.test.d.ts +0 -1
  321. package/module/es5/tests/unit/Tool/createPipeline.test.js +0 -184
  322. package/module/es5/tests/unit/Tool/parseJson.test.d.ts +0 -1
  323. package/module/es5/tests/unit/Tool/parseJson.test.js +0 -46
  324. package/module/es5/tests/unit/UA/extractBrowserFromUserAgent.test.d.ts +0 -1
  325. package/module/es5/tests/unit/UA/extractBrowserFromUserAgent.test.js +0 -47
  326. package/module/es5/tests/unit/UA/extractDeviceFromUserAgent.test.d.ts +0 -1
  327. package/module/es5/tests/unit/UA/extractDeviceFromUserAgent.test.js +0 -55
  328. package/module/es5/tests/unit/UA/extractOsFromUserAgent.test.d.ts +0 -1
  329. package/module/es5/tests/unit/UA/extractOsFromUserAgent.test.js +0 -57
  330. package/module/es5/tests/unit/UA/parseUserAgent.test.d.ts +0 -1
  331. package/module/es5/tests/unit/UA/parseUserAgent.test.js +0 -95
  332. package/module/es5/tests/unit/Unit/unitConverterInitialization.test.d.ts +0 -1
  333. package/module/es5/tests/unit/Unit/unitConverterInitialization.test.js +0 -40
  334. package/module/es5/tests/unit/Validate/array/core.test.d.ts +0 -1
  335. package/module/es5/tests/unit/Validate/array/core.test.js +0 -86
  336. package/module/es5/tests/unit/Validate/boolean/core.test.d.ts +0 -1
  337. package/module/es5/tests/unit/Validate/boolean/core.test.js +0 -29
  338. package/module/es5/tests/unit/Validate/core/core.test.d.ts +0 -1
  339. package/module/es5/tests/unit/Validate/core/core.test.js +0 -87
  340. package/module/es5/tests/unit/Validate/isArray.test.d.ts +0 -1
  341. package/module/es5/tests/unit/Validate/isArray.test.js +0 -36
  342. package/module/es5/tests/unit/Validate/isDictionaryObject.test.d.ts +0 -1
  343. package/module/es5/tests/unit/Validate/isDictionaryObject.test.js +0 -62
  344. package/module/es5/tests/unit/Validate/isDouble.test.d.ts +0 -1
  345. package/module/es5/tests/unit/Validate/isDouble.test.js +0 -47
  346. package/module/es5/tests/unit/Validate/isEqual.test.d.ts +0 -1
  347. package/module/es5/tests/unit/Validate/isEqual.test.js +0 -74
  348. package/module/es5/tests/unit/Validate/isNotEmpty.test.d.ts +0 -1
  349. package/module/es5/tests/unit/Validate/isNotEmpty.test.js +0 -43
  350. package/module/es5/tests/unit/Validate/isNumber.test.d.ts +0 -1
  351. package/module/es5/tests/unit/Validate/isNumber.test.js +0 -77
  352. package/module/es5/tests/unit/Validate/isPerfectSquare.test.d.ts +0 -1
  353. package/module/es5/tests/unit/Validate/isPerfectSquare.test.js +0 -27
  354. package/module/es5/tests/unit/Validate/isPrimeNumber.test.d.ts +0 -1
  355. package/module/es5/tests/unit/Validate/isPrimeNumber.test.js +0 -51
  356. package/module/es5/tests/unit/Validate/isValueNaN.test.d.ts +0 -1
  357. package/module/es5/tests/unit/Validate/isValueNaN.test.js +0 -54
  358. package/module/es5/tests/unit/Validate/number/core.test.d.ts +0 -1
  359. package/module/es5/tests/unit/Validate/number/core.test.js +0 -36
  360. package/module/es5/tests/unit/Validate/number/double.test.d.ts +0 -1
  361. package/module/es5/tests/unit/Validate/number/double.test.js +0 -23
  362. package/module/es5/tests/unit/Validate/number/even.test.d.ts +0 -1
  363. package/module/es5/tests/unit/Validate/number/even.test.js +0 -23
  364. package/module/es5/tests/unit/Validate/number/maxValue.test.d.ts +0 -1
  365. package/module/es5/tests/unit/Validate/number/maxValue.test.js +0 -20
  366. package/module/es5/tests/unit/Validate/number/minValue.test.d.ts +0 -1
  367. package/module/es5/tests/unit/Validate/number/minValue.test.js +0 -20
  368. package/module/es5/tests/unit/Validate/number/odd.test.d.ts +0 -1
  369. package/module/es5/tests/unit/Validate/number/odd.test.js +0 -23
  370. package/module/es5/tests/unit/Validate/number/prime.test.d.ts +0 -1
  371. package/module/es5/tests/unit/Validate/number/prime.test.js +0 -25
  372. package/module/es5/tests/unit/Validate/object/core.test.d.ts +0 -1
  373. package/module/es5/tests/unit/Validate/object/core.test.js +0 -79
  374. package/module/es5/tests/unit/Validate/string/core.test.d.ts +0 -1
  375. package/module/es5/tests/unit/Validate/string/core.test.js +0 -27
  376. package/module/es5/tests/unit/Validate/string/email.test.d.ts +0 -1
  377. package/module/es5/tests/unit/Validate/string/email.test.js +0 -21
  378. package/module/es5/tests/unit/Validate/string/length.test.d.ts +0 -1
  379. package/module/es5/tests/unit/Validate/string/length.test.js +0 -18
  380. package/module/es5/tests/unit/Validate/string/maxLength.test.d.ts +0 -1
  381. package/module/es5/tests/unit/Validate/string/maxLength.test.js +0 -18
  382. package/module/es5/tests/unit/Validate/string/minLength.test.d.ts +0 -1
  383. package/module/es5/tests/unit/Validate/string/minLength.test.js +0 -18
  384. package/module/es5/tests/unit/Validate/string/numberString.test.d.ts +0 -1
  385. package/module/es5/tests/unit/Validate/string/numberString.test.js +0 -22
  386. package/module/es5/tests/unit/Validate/string/regexMatch.test.d.ts +0 -1
  387. package/module/es5/tests/unit/Validate/string/regexMatch.test.js +0 -29
  388. package/module/es5/tests/unit/Validate/string/uuid.test.d.ts +0 -1
  389. package/module/es5/tests/unit/Validate/string/uuid.test.js +0 -72
  390. package/module/es5/tests/unit/types/arrayType.test.d.ts +0 -1
  391. package/module/es5/tests/unit/types/arrayType.test.js +0 -11
  392. package/module/es5/tests/unit/types/clockType.test.d.ts +0 -1
  393. package/module/es5/tests/unit/types/clockType.test.js +0 -37
@@ -15,4 +15,5 @@ export * from "./isNotEmpty";
15
15
  export * from "./isNumber";
16
16
  export * from "./isPerfectSquare";
17
17
  export * from "./isPrimeNumber";
18
+ export * from "./isString";
18
19
  export * from "./isValueNaN";
@@ -17,5 +17,6 @@ export * from "./isNotEmpty";
17
17
  export * from "./isNumber";
18
18
  export * from "./isPerfectSquare";
19
19
  export * from "./isPrimeNumber";
20
+ export * from "./isString";
20
21
  export * from "./isValueNaN";
21
22
  //# sourceMappingURL=index.js.map
@@ -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,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,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,9 @@
1
+ /**
2
+ * Determines if the value is a string
3
+ * @param {unknown} value - Value to check
4
+ * @returns boolean - True if the value is a string, false otherwise
5
+ * @example isString("test"); // true
6
+ * isString(123); // false
7
+ */
8
+ declare const isString: (value: unknown) => value is string;
9
+ export { isString };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Determines if the value is a string
3
+ * @param {unknown} value - Value to check
4
+ * @returns boolean - True if the value is a string, false otherwise
5
+ * @example isString("test"); // true
6
+ * isString(123); // false
7
+ */
8
+ const isString = (value) => {
9
+ return typeof value === "string";
10
+ };
11
+ export { isString };
12
+ //# sourceMappingURL=isString.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isString.js","sourceRoot":"","sources":["../../src/Validate/isString.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAmB,EAAE;IACnD,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * Object validation core module
3
3
  * Provides validation functionality for objects with type-specific validation rules for each property
4
4
  */
5
- import type { ValidateCoreReturnType, ValidateType } from "../../Validate/type";
5
+ import type { Types, ValidateCoreReturnType, ValidateType } from "../../Validate/type";
6
6
  /**
7
7
  * Creates an object validator with property-specific validation rules
8
8
  * @template T - Object type containing validation functions for each property
@@ -12,8 +12,4 @@ import type { ValidateCoreReturnType, ValidateType } from "../../Validate/type";
12
12
  */
13
13
  export declare const object: <T extends {
14
14
  [key: string]: (value: any) => ValidateCoreReturnType<any>;
15
- }>(option?: T, message?: string) => (value: { [key in keyof T]: ValidateType<ReturnType<T[key]>["type"]>; }) => {
16
- validate: boolean;
17
- message: string;
18
- type: { [key in keyof T]: ValidateType<ReturnType<T[key]>["type"]>; };
19
- };
15
+ }>(option?: T, message?: string) => (value: Types<{ [key in keyof T]: ValidateType<ReturnType<T[key]>["type"]>; }>) => ValidateCoreReturnType<{ [key in keyof T]: ValidateType<ReturnType<T[key]>["type"]>; }>;
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/Validate/object/core.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAGnE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAMpB,SAAY,EAAO,EACnB,OAAgB,EAChB,EAAE;IACF,OAAO,CACL,KAEC,EAKD,EAAE;QACF,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/B,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,OAAO,IAAI,EAAE;gBACtB,IAAI,EAAE,KAAK;aACZ,CAAC;QACJ,CAAC;QACD,KAAK,MAAM,QAAQ,IAAI,MAAM,EAAE,CAAC;YAC9B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;gBAChD,OAAO;oBACL,QAAQ,EAAE,KAAK;oBACf,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO;oBACxC,IAAI,EAAE,KAAK;iBACZ,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE;YACX,IAAI,EAAE,KAAK;SACZ,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/Validate/object/core.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAOnE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAMpB,SAAY,EAAO,EACnB,OAAgB,EAChB,EAAE;IACF,OAAO,CACL,KAEE,EAGD,EAAE;QACH,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/B,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,OAAO,IAAI,EAAE;gBACtB,IAAI,EAAE,KAAK;aACZ,CAAC;QACJ,CAAC;QACD,KAAK,MAAM,QAAQ,IAAI,MAAM,EAAE,CAAC;YAC9B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;gBAChD,OAAO;oBACL,QAAQ,EAAE,KAAK;oBACf,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO;oBACxC,IAAI,EAAE,KAAK;iBACZ,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE;YACX,IAAI,EAAE,KAAK;SACZ,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -33,3 +33,4 @@ export type ValidateFunctionType<T> = (value: T) => boolean;
33
33
  * @returns The corresponding TypeScript type (string, number, boolean) or the original type T
34
34
  */
35
35
  export type ValidateType<T> = T extends "string" ? string : T extends "number" ? number : T extends "boolean" ? boolean : T;
36
+ export type SchemaToInterface<T extends (value: any) => ValidateCoreReturnType<any>> = ReturnType<T>["type"];
@@ -12,9 +12,11 @@ exports.chunk = void 0;
12
12
  * @example chunk([1, 2, 3, 4, 5, 6, 7, 8, 9], 3); // [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
13
13
  */
14
14
  var chunk = exports.chunk = function chunk(array, n) {
15
- var result = [];
16
- for (var index = 0; index < array.length; index += n) {
17
- result.push(array.slice(index, index + n));
15
+ var length = array.length;
16
+ // eslint-disable-next-line unicorn/no-new-array
17
+ var result = new Array(Math.ceil(length / n));
18
+ for (var index = 0, k = 0; index < length; index += n, k++) {
19
+ result[k] = array.slice(index, index + n);
18
20
  }
19
21
  return result;
20
22
  };
@@ -1,4 +1,4 @@
1
- type CompareFunction<T> = (a: T, b: T) => number;
1
+ import type { CompareFunction } from "$/array/compareFunction";
2
2
  /**
3
3
  * Sort array using dual-pivot quicksort algorithm
4
4
  * More efficient than traditional quicksort for arrays with many duplicate values
@@ -13,4 +13,3 @@ type CompareFunction<T> = (a: T, b: T) => number;
13
13
  * dualPivotQuickSort(['banana', 'apple', 'orange']); // ['apple', 'banana', 'orange']
14
14
  */
15
15
  export declare const dualPivotQuickSort: <T>(array: T[], compareFunction?: CompareFunction<T>, startIndex?: number, endIndex?: number, insertionSortThreshold?: number) => T[];
16
- export {};
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.dualPivotQuickSort = void 0;
7
7
  var _compareFunctionDefault = require("./compareFunctionDefault");
8
+ var _applyInsertionSortIfNeeded = require("./sortingHelpers/applyInsertionSortIfNeeded");
9
+ var _rangeValidator = require("./sortingHelpers/rangeValidator");
8
10
  /**
9
11
  * Get the median of three elements in the array
10
12
  * @param array - The input array
@@ -120,25 +122,6 @@ var partition = function partition(array, low, high, compareFunction) {
120
122
  };
121
123
  };
122
124
 
123
- /**
124
- * Sort small arrays using selection sort
125
- * @param array - Array to be sorted
126
- * @param start - Starting index
127
- * @param end - Ending index
128
- * @param compareFunction - Comparison function
129
- */
130
- var insertionSort = function insertionSort(array, start, end, compareFunction) {
131
- for (var index = start + 1; index <= end; index++) {
132
- var current = array[index];
133
- var index_ = index - 1;
134
- while (index_ >= start && compareFunction(array[index_], current) > 0) {
135
- array[index_ + 1] = array[index_];
136
- index_--;
137
- }
138
- array[index_ + 1] = current;
139
- }
140
- };
141
-
142
125
  /**
143
126
  * Internal implementation of dual-pivot quicksort
144
127
  * @param array - Array to be sorted
@@ -148,9 +131,7 @@ var insertionSort = function insertionSort(array, start, end, compareFunction) {
148
131
  * @param insertionSortThreshold - Threshold for switching to insertion sort
149
132
  */
150
133
  var _sortRange = function sortRange(array, start, end, compareFunction, insertionSortThreshold) {
151
- // Use insertion sort for small arrays
152
- if (end - start + 1 <= insertionSortThreshold) {
153
- insertionSort(array, start, end, compareFunction);
134
+ if ((0, _applyInsertionSortIfNeeded.applyInsertionSortIfNeeded)(array, start, end, compareFunction, insertionSortThreshold)) {
154
135
  return;
155
136
  }
156
137
 
@@ -189,12 +170,11 @@ var dualPivotQuickSort = exports.dualPivotQuickSort = function dualPivotQuickSor
189
170
  var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
190
171
  var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : array.length - 1;
191
172
  var insertionSortThreshold = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 10;
192
- // Validate and adjust indices
193
- var validStartIndex = Math.max(0, Math.min(startIndex, array.length - 1));
194
- var validEndIndex = Math.max(validStartIndex, Math.min(endIndex, array.length - 1));
195
-
196
- // Sort array if valid range exists
197
- if (validEndIndex >= validStartIndex) {
173
+ var _validateRange = (0, _rangeValidator.validateRange)(array, startIndex, endIndex),
174
+ validStartIndex = _validateRange.startIndex,
175
+ validEndIndex = _validateRange.endIndex,
176
+ shouldSort = _validateRange.shouldSort;
177
+ if (shouldSort) {
198
178
  _sortRange(array, validStartIndex, validEndIndex, compareFunction, insertionSortThreshold);
199
179
  }
200
180
  return array;
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.quickSort = void 0;
7
7
  var _compareFunctionDefault = require("./compareFunctionDefault");
8
+ var _applyInsertionSortIfNeeded = require("./sortingHelpers/applyInsertionSortIfNeeded");
9
+ var _rangeValidator = require("./sortingHelpers/rangeValidator");
8
10
  /**
9
11
  * Finds the median value among three elements in the array
10
12
  * @param array The array containing the elements
@@ -64,25 +66,6 @@ var partition = function partition(array, low, high, compareFunction) {
64
66
  }
65
67
  };
66
68
 
67
- /**
68
- * Sorts a portion of the array using insertion sort algorithm
69
- * @param array Array to sort
70
- * @param low Starting index of the range to sort
71
- * @param high Ending index of the range to sort
72
- * @param compareFunction Function to compare elements
73
- */
74
- var insertionSort = function insertionSort(array, low, high, compareFunction) {
75
- for (var index = low + 1; index <= high; index++) {
76
- var key = array[index];
77
- var currentIndex = index - 1;
78
- while (currentIndex >= low && compareFunction(array[currentIndex], key) > 0) {
79
- array[currentIndex + 1] = array[currentIndex];
80
- currentIndex--;
81
- }
82
- array[currentIndex + 1] = key;
83
- }
84
- };
85
-
86
69
  /**
87
70
  * Internal implementation of the quicksort algorithm with tail-call optimization
88
71
  * @param array Array to sort
@@ -95,8 +78,7 @@ var _sortImpl = function sortImpl(array, lowInit, highInit, compareFunction, ins
95
78
  var low = lowInit;
96
79
  var high = highInit;
97
80
  while (low < high) {
98
- if (high - low < insertionSortThreshold) {
99
- insertionSort(array, low, high, compareFunction);
81
+ if ((0, _applyInsertionSortIfNeeded.applyInsertionSortIfNeeded)(array, low, high, compareFunction, insertionSortThreshold)) {
100
82
  return;
101
83
  }
102
84
  var pivotIndex = partition(array, low, high, compareFunction);
@@ -128,9 +110,12 @@ var quickSort = exports.quickSort = function quickSort(array) {
128
110
  var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
129
111
  var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : array.length - 1;
130
112
  var insertionSortThreshold = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 10;
131
- // Only sort within valid range
132
- var validStartIndex = Math.max(0, Math.min(startIndex, array.length - 1));
133
- var validEndIndex = Math.max(validStartIndex, Math.min(endIndex, array.length - 1));
134
- _sortImpl(array, validStartIndex, validEndIndex, compareFunction, insertionSortThreshold);
113
+ var _validateRange = (0, _rangeValidator.validateRange)(array, startIndex, endIndex),
114
+ validStartIndex = _validateRange.startIndex,
115
+ validEndIndex = _validateRange.endIndex,
116
+ shouldSort = _validateRange.shouldSort;
117
+ if (shouldSort) {
118
+ _sortImpl(array, validStartIndex, validEndIndex, compareFunction, insertionSortThreshold);
119
+ }
135
120
  return array;
136
121
  };
@@ -0,0 +1,13 @@
1
+ import type { CompareFunction } from "$/array/compareFunction";
2
+ /**
3
+ * Checks if a partition is small enough to apply insertion sort and applies it if so.
4
+ *
5
+ * @template T The type of elements in the array.
6
+ * @param {T[]} array The array containing the partition.
7
+ * @param {number} low The starting index of the partition.
8
+ * @param {number} high The ending index of the partition.
9
+ * @param {CompareFunction<T>} compareFunction The function to compare elements.
10
+ * @param {number} insertionSortThreshold The size threshold for switching to insertion sort.
11
+ * @returns {boolean} True if insertion sort was applied, false otherwise.
12
+ */
13
+ export declare const applyInsertionSortIfNeeded: <T>(array: T[], low: number, high: number, compareFunction: CompareFunction<T>, insertionSortThreshold: number) => boolean;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.applyInsertionSortIfNeeded = void 0;
7
+ var _insertionSort = require("@/Array/insertionSort");
8
+ /**
9
+ * Checks if a partition is small enough to apply insertion sort and applies it if so.
10
+ *
11
+ * @template T The type of elements in the array.
12
+ * @param {T[]} array The array containing the partition.
13
+ * @param {number} low The starting index of the partition.
14
+ * @param {number} high The ending index of the partition.
15
+ * @param {CompareFunction<T>} compareFunction The function to compare elements.
16
+ * @param {number} insertionSortThreshold The size threshold for switching to insertion sort.
17
+ * @returns {boolean} True if insertion sort was applied, false otherwise.
18
+ */
19
+ var applyInsertionSortIfNeeded = exports.applyInsertionSortIfNeeded = function applyInsertionSortIfNeeded(array, low, high, compareFunction, insertionSortThreshold) {
20
+ if (high - low + 1 <= insertionSortThreshold) {
21
+ (0, _insertionSort.insertionSort)(array, compareFunction, low, high);
22
+ return true;
23
+ }
24
+ return false;
25
+ };
@@ -0,0 +1,17 @@
1
+ export interface ValidatedSortRange {
2
+ startIndex: number;
3
+ endIndex: number;
4
+ shouldSort: boolean;
5
+ }
6
+ /**
7
+ * Validates and adjusts the start and end indices for an operation on an array.
8
+ * Ensures indices are within the bounds of the array.
9
+ *
10
+ * @template T The type of elements in the array.
11
+ * @param {T[]} array The array.
12
+ * @param {number} startIndex The desired starting index.
13
+ * @param {number} endIndex The desired ending index.
14
+ * @returns {ValidatedSortRange} An object containing the validated start index, end index,
15
+ * and a boolean indicating if the operation should proceed on the range.
16
+ */
17
+ export declare const validateRange: <T>(array: T[], startIndex: number, endIndex: number) => ValidatedSortRange;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.validateRange = void 0;
7
+ /**
8
+ * Validates and adjusts the start and end indices for an operation on an array.
9
+ * Ensures indices are within the bounds of the array.
10
+ *
11
+ * @template T The type of elements in the array.
12
+ * @param {T[]} array The array.
13
+ * @param {number} startIndex The desired starting index.
14
+ * @param {number} endIndex The desired ending index.
15
+ * @returns {ValidatedSortRange} An object containing the validated start index, end index,
16
+ * and a boolean indicating if the operation should proceed on the range.
17
+ */
18
+ var validateRange = exports.validateRange = function validateRange(array, startIndex, endIndex) {
19
+ var length = array.length;
20
+ // Handle empty arrays early
21
+ if (length === 0) {
22
+ return {
23
+ startIndex: 0,
24
+ endIndex: -1,
25
+ shouldSort: false
26
+ };
27
+ }
28
+ var validatedStartIndex = Math.max(0, Math.min(startIndex, length - 1));
29
+ var validatedEndIndex = Math.max(validatedStartIndex, Math.min(endIndex, length - 1));
30
+ return {
31
+ startIndex: validatedStartIndex,
32
+ endIndex: validatedEndIndex,
33
+ shouldSort: validatedEndIndex >= validatedStartIndex
34
+ };
35
+ };
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Curries a function.
3
+ *
4
+ * @param func - The function to curry.
5
+ * @returns The curried function.
6
+ *
7
+ * @example
8
+ * // Example with a function that adds three numbers
9
+ * const add = (a: number, b: number, c: number) => a + b + c;
10
+ * const curriedAdd = curry(add);
11
+ *
12
+ * console.log(curriedAdd(1)(2)(3)); // Output: 6
13
+ * console.log(curriedAdd(1, 2)(3)); // Output: 6
14
+ * console.log(curriedAdd(1, 2, 3)); // Output: 6
15
+ */
16
+ export declare function curry<Result>(function_: () => Result): () => Result;
17
+ export declare function curry<Argument1, Result>(function_: (argument1: Argument1) => Result): (argument1: Argument1) => Result;
18
+ export declare function curry<Argument1, Argument2, Result>(function_: (argument1: Argument1, argument2: Argument2) => Result): {
19
+ (argument1: Argument1): (argument2: Argument2) => Result;
20
+ (argument1: Argument1, argument2: Argument2): Result;
21
+ };
22
+ export declare function curry<Argument1, Argument2, Argument3, Result>(function_: (argument1: Argument1, argument2: Argument2, argument3: Argument3) => Result): {
23
+ (argument1: Argument1): {
24
+ (argument2: Argument2): (argument3: Argument3) => Result;
25
+ (argument2: Argument2, argument3: Argument3): Result;
26
+ };
27
+ (argument1: Argument1, argument2: Argument2): (argument3: Argument3) => Result;
28
+ (argument1: Argument1, argument2: Argument2, argument3: Argument3): Result;
29
+ };
30
+ export declare function curry<Argument1, Argument2, Argument3, Argument4, Result>(function_: (argument1: Argument1, argument2: Argument2, argument3: Argument3, argument4: Argument4) => Result): {
31
+ (argument1: Argument1): {
32
+ (argument2: Argument2): {
33
+ (argument3: Argument3): (argument4: Argument4) => Result;
34
+ (argument3: Argument3, argument4: Argument4): Result;
35
+ };
36
+ (argument2: Argument2, argument3: Argument3): (argument4: Argument4) => Result;
37
+ (argument2: Argument2, argument3: Argument3, argument4: Argument4): Result;
38
+ };
39
+ (argument1: Argument1, argument2: Argument2): {
40
+ (argument3: Argument3): (argument4: Argument4) => Result;
41
+ (argument3: Argument3, argument4: Argument4): Result;
42
+ };
43
+ (argument1: Argument1, argument2: Argument2, argument3: Argument3): (argument4: Argument4) => Result;
44
+ (argument1: Argument1, argument2: Argument2, argument3: Argument3, argument4: Argument4): Result;
45
+ };
46
+ export declare function curry<Argument1, Argument2, Argument3, Argument4, Argument5, Result>(function_: (argument1: Argument1, argument2: Argument2, argument3: Argument3, argument4: Argument4, argument5: Argument5) => Result): {
47
+ (argument1: Argument1): {
48
+ (argument2: Argument2): {
49
+ (argument3: Argument3): {
50
+ (argument4: Argument4): (argument5: Argument5) => Result;
51
+ (argument4: Argument4, argument5: Argument5): Result;
52
+ };
53
+ (argument3: Argument3, argument4: Argument4): (argument5: Argument5) => Result;
54
+ (argument3: Argument3, argument4: Argument4, argument5: Argument5): Result;
55
+ };
56
+ (argument2: Argument2, argument3: Argument3): {
57
+ (argument4: Argument4): (argument5: Argument5) => Result;
58
+ (argument4: Argument4, argument5: Argument5): Result;
59
+ };
60
+ (argument2: Argument2, argument3: Argument3, argument4: Argument4): (argument5: Argument5) => Result;
61
+ (argument2: Argument2, argument3: Argument3, argument4: Argument4, argument5: Argument5): Result;
62
+ };
63
+ (argument1: Argument1, argument2: Argument2): {
64
+ (argument3: Argument3): {
65
+ (argument4: Argument4): (argument5: Argument5) => Result;
66
+ (argument4: Argument4, argument5: Argument5): Result;
67
+ };
68
+ (argument3: Argument3, argument4: Argument4): (argument5: Argument5) => Result;
69
+ (argument3: Argument3, argument4: Argument4, argument5: Argument5): Result;
70
+ };
71
+ (argument1: Argument1, argument2: Argument2, argument3: Argument3): {
72
+ (argument4: Argument4): (argument5: Argument5) => Result;
73
+ (argument4: Argument4, argument5: Argument5): Result;
74
+ };
75
+ (argument1: Argument1, argument2: Argument2, argument3: Argument3, argument4: Argument4): (argument5: Argument5) => Result;
76
+ (argument1: Argument1, argument2: Argument2, argument3: Argument3, argument4: Argument4, argument5: Argument5): Result;
77
+ };
78
+ export declare function curry<Argument1, Argument2, Argument3, Argument4, Argument5, Argument6, Result>(function_: (argument1: Argument1, argument2: Argument2, argument3: Argument3, argument4: Argument4, argument5: Argument5, argument6: Argument6) => Result): {
79
+ (argument1: Argument1): {
80
+ (argument2: Argument2): {
81
+ (argument3: Argument3): {
82
+ (argument4: Argument4): {
83
+ (argument5: Argument5): (argument6: Argument6) => Result;
84
+ (argument5: Argument5, argument6: Argument6): Result;
85
+ };
86
+ (argument4: Argument4, argument5: Argument5): (argument6: Argument6) => Result;
87
+ (argument4: Argument4, argument5: Argument5, argument6: Argument6): Result;
88
+ };
89
+ (argument3: Argument3, argument4: Argument4): {
90
+ (argument5: Argument5): (argument6: Argument6) => Result;
91
+ (argument5: Argument5, argument6: Argument6): Result;
92
+ };
93
+ (argument3: Argument3, argument4: Argument4, argument5: Argument5): (argument6: Argument6) => Result;
94
+ (argument3: Argument3, argument4: Argument4, argument5: Argument5, argument6: Argument6): Result;
95
+ };
96
+ (argument2: Argument2, argument3: Argument3): {
97
+ (argument4: Argument4): {
98
+ (argument5: Argument5): (argument6: Argument6) => Result;
99
+ (argument5: Argument5, argument6: Argument6): Result;
100
+ };
101
+ (argument4: Argument4, argument5: Argument5): (argument6: Argument6) => Result;
102
+ (argument4: Argument4, argument5: Argument5, argument6: Argument6): Result;
103
+ };
104
+ (argument2: Argument2, argument3: Argument3, argument4: Argument4): {
105
+ (argument5: Argument5): (argument6: Argument6) => Result;
106
+ (argument5: Argument5, argument6: Argument6): Result;
107
+ };
108
+ (argument2: Argument2, argument3: Argument3, argument4: Argument4, argument5: Argument5): (argument6: Argument6) => Result;
109
+ (argument2: Argument2, argument3: Argument3, argument4: Argument4, argument5: Argument5, argument6: Argument6): Result;
110
+ };
111
+ (argument1: Argument1, argument2: Argument2): {
112
+ (argument3: Argument3): {
113
+ (argument4: Argument4): {
114
+ (argument5: Argument5): (argument6: Argument6) => Result;
115
+ (argument5: Argument5, argument6: Argument6): Result;
116
+ };
117
+ (argument4: Argument4, argument5: Argument5): (argument6: Argument6) => Result;
118
+ (argument4: Argument4, argument5: Argument5, argument6: Argument6): Result;
119
+ };
120
+ (argument3: Argument3, argument4: Argument4): {
121
+ (argument5: Argument5): (argument6: Argument6) => Result;
122
+ (argument5: Argument5, argument6: Argument6): Result;
123
+ };
124
+ (argument3: Argument3, argument4: Argument4, argument5: Argument5): (argument6: Argument6) => Result;
125
+ (argument3: Argument3, argument4: Argument4, argument5: Argument5, argument6: Argument6): Result;
126
+ };
127
+ (argument1: Argument1, argument2: Argument2, argument3: Argument3): {
128
+ (argument4: Argument4): {
129
+ (argument5: Argument5): (argument6: Argument6) => Result;
130
+ (argument5: Argument5, argument6: Argument6): Result;
131
+ };
132
+ (argument4: Argument4, argument5: Argument5): (argument6: Argument6) => Result;
133
+ (argument4: Argument4, argument5: Argument5, argument6: Argument6): Result;
134
+ };
135
+ (argument1: Argument1, argument2: Argument2, argument3: Argument3, argument4: Argument4): {
136
+ (argument5: Argument5): (argument6: Argument6) => Result;
137
+ (argument5: Argument5, argument6: Argument6): Result;
138
+ };
139
+ (argument1: Argument1, argument2: Argument2, argument3: Argument3, argument4: Argument4, argument5: Argument5): (argument6: Argument6) => Result;
140
+ (argument1: Argument1, argument2: Argument2, argument3: Argument3, argument4: Argument4, argument5: Argument5, argument6: Argument6): Result;
141
+ };
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.curry = curry;
7
+ /**
8
+ * Curries a function.
9
+ *
10
+ * @param func - The function to curry.
11
+ * @returns The curried function.
12
+ *
13
+ * @example
14
+ * // Example with a function that adds three numbers
15
+ * const add = (a: number, b: number, c: number) => a + b + c;
16
+ * const curriedAdd = curry(add);
17
+ *
18
+ * console.log(curriedAdd(1)(2)(3)); // Output: 6
19
+ * console.log(curriedAdd(1, 2)(3)); // Output: 6
20
+ * console.log(curriedAdd(1, 2, 3)); // Output: 6
21
+ */
22
+
23
+ function curry(function_) {
24
+ return function curried() {
25
+ for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
26
+ arguments_[_key] = arguments[_key];
27
+ }
28
+ if (arguments_.length >= function_.length) {
29
+ return function_.apply(this, arguments_);
30
+ }
31
+ return function () {
32
+ for (var _len2 = arguments.length, moreArguments = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
33
+ moreArguments[_key2] = arguments[_key2];
34
+ }
35
+ return Reflect.apply(curried, this, [].concat(arguments_, moreArguments));
36
+ };
37
+ };
38
+ }
@@ -0,0 +1 @@
1
+ export * from "./curry";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _curry = require("./curry");
7
+ Object.keys(_curry).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _curry[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _curry[key];
14
+ }
15
+ });
16
+ });
@@ -1,2 +1,3 @@
1
1
  export * from "./createPipeline";
2
2
  export * from "./parseJson";
3
+ export * from "./pipe";
@@ -24,4 +24,15 @@ Object.keys(_parseJson).forEach(function (key) {
24
24
  return _parseJson[key];
25
25
  }
26
26
  });
27
+ });
28
+ var _pipe = require("./pipe");
29
+ Object.keys(_pipe).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _pipe[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function get() {
35
+ return _pipe[key];
36
+ }
37
+ });
27
38
  });
@@ -0,0 +1,66 @@
1
+ import { type Result } from "@/Error/safeExecute";
2
+ /**
3
+ * A class to handle pipeline processing
4
+ * Allows chaining transformations in a fluent interface
5
+ * @template T Type of the current value
6
+ */
7
+ export declare class Pipe<T> {
8
+ private readonly value;
9
+ /**
10
+ * @param value Current value in the pipe
11
+ */
12
+ constructor(value: T);
13
+ /**
14
+ * Applies a transformation function and returns a new Pipe instance
15
+ * @param fn Transformation function to apply
16
+ * @returns New Pipe instance with transformed value
17
+ */
18
+ map<U>(function_: (input: T) => U): Pipe<U>;
19
+ /**
20
+ * Applies a transformation function only if the condition is met
21
+ * @param predicate Condition function
22
+ * @param fn Transformation function to apply if condition is met
23
+ * @returns New Pipe instance with conditionally transformed value
24
+ */
25
+ when<U>(predicate: (input: T) => boolean, function_: (input: T) => U): Pipe<U | T>;
26
+ /**
27
+ * Executes a side effect without changing the value
28
+ * @param fn Function to execute as a side effect
29
+ * @returns Same Pipe instance
30
+ */
31
+ tap(function_: (input: T) => void): Pipe<T>;
32
+ /**
33
+ * Strictly filters the value based on a predicate function
34
+ * Throws an error if the predicate returns false
35
+ * @param predicate Condition function that determines if value should be filtered
36
+ * @returns New Pipe instance with filtered value and narrowed type
37
+ * @throws Error if the predicate returns false
38
+ */
39
+ filterStrict<U extends T>(predicate: (input: T) => input is U): Pipe<U>;
40
+ /**
41
+ * Filters the value based on a predicate function
42
+ * Returns a default value if the predicate returns false
43
+ * @param predicate Condition function that determines if value should be filtered
44
+ * @param defaultValue Default value to use if predicate returns false
45
+ * @returns New Pipe instance with filtered value or default value
46
+ */
47
+ filterWithDefault<U extends T>(predicate: (input: T) => input is U, defaultValue: U): Pipe<U>;
48
+ /**
49
+ * Filters the value based on a predicate function
50
+ * Returns a Result type containing either the filtered value or an error
51
+ * @param predicate Condition function that determines if value should be filtered
52
+ * @returns New Pipe instance with Result containing filtered value or error
53
+ */
54
+ filterResult<U extends T>(predicate: (input: T) => input is U): Pipe<Result<U, Error>>;
55
+ /**
56
+ * Terminates the pipeline and returns the final value
57
+ * @returns Final result of the pipeline processing
58
+ */
59
+ end(): T;
60
+ }
61
+ /**
62
+ * Creates a new Pipe instance with an initial value
63
+ * @param initialValue Initial value for the pipeline
64
+ * @returns New Pipe instance
65
+ */
66
+ export declare function pipe<T>(initialValue: T): Pipe<T>;