umt 2.3.0 → 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 (362) 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/Validate/object/core.d.ts +2 -6
  15. package/module/Validate/object/core.js.map +1 -1
  16. package/module/Validate/type.d.ts +1 -0
  17. package/module/es5/Array/chunk.js +5 -3
  18. package/module/es5/Array/dualPivotQuickSort.d.ts +1 -2
  19. package/module/es5/Array/dualPivotQuickSort.js +8 -28
  20. package/module/es5/Array/quickSort.js +10 -25
  21. package/module/es5/Array/sortingHelpers/applyInsertionSortIfNeeded.d.ts +13 -0
  22. package/module/es5/Array/sortingHelpers/applyInsertionSortIfNeeded.js +25 -0
  23. package/module/es5/Array/sortingHelpers/rangeValidator.d.ts +17 -0
  24. package/module/es5/Array/sortingHelpers/rangeValidator.js +35 -0
  25. package/module/es5/Validate/object/core.d.ts +2 -6
  26. package/module/es5/Validate/type.d.ts +1 -0
  27. package/module/es5/tsconfig.tsbuildinfo +1 -1
  28. package/package.json +21 -17
  29. package/module/es5/tests/integration/Array/drop-and-first.test.d.ts +0 -1
  30. package/module/es5/tests/integration/Array/drop-and-first.test.js +0 -34
  31. package/module/es5/tests/integration/Tool/parseJson-and-Validate.test.d.ts +0 -1
  32. package/module/es5/tests/integration/Tool/parseJson-and-Validate.test.js +0 -80
  33. package/module/es5/tests/unit/Advance/rangeAdvance.test.d.ts +0 -1
  34. package/module/es5/tests/unit/Advance/rangeAdvance.test.js +0 -26
  35. package/module/es5/tests/unit/Array/arraysJoin.test.d.ts +0 -1
  36. package/module/es5/tests/unit/Array/arraysJoin.test.js +0 -19
  37. package/module/es5/tests/unit/Array/binarySearch.test.d.ts +0 -1
  38. package/module/es5/tests/unit/Array/binarySearch.test.js +0 -32
  39. package/module/es5/tests/unit/Array/checkFlagAlignment.test.d.ts +0 -1
  40. package/module/es5/tests/unit/Array/checkFlagAlignment.test.js +0 -206
  41. package/module/es5/tests/unit/Array/chunk.test.d.ts +0 -1
  42. package/module/es5/tests/unit/Array/chunk.test.js +0 -51
  43. package/module/es5/tests/unit/Array/compact.test.d.ts +0 -1
  44. package/module/es5/tests/unit/Array/compact.test.js +0 -53
  45. package/module/es5/tests/unit/Array/compareFunctionDefault.test.d.ts +0 -1
  46. package/module/es5/tests/unit/Array/compareFunctionDefault.test.js +0 -29
  47. package/module/es5/tests/unit/Array/drop.test.d.ts +0 -1
  48. package/module/es5/tests/unit/Array/drop.test.js +0 -84
  49. package/module/es5/tests/unit/Array/dualPivotQuickSort.test.d.ts +0 -1
  50. package/module/es5/tests/unit/Array/dualPivotQuickSort.test.js +0 -87
  51. package/module/es5/tests/unit/Array/first.test.d.ts +0 -1
  52. package/module/es5/tests/unit/Array/first.test.js +0 -28
  53. package/module/es5/tests/unit/Array/generateNumberArray.test.d.ts +0 -1
  54. package/module/es5/tests/unit/Array/generateNumberArray.test.js +0 -34
  55. package/module/es5/tests/unit/Array/getArraysCommon.test.d.ts +0 -1
  56. package/module/es5/tests/unit/Array/getArraysCommon.test.js +0 -40
  57. package/module/es5/tests/unit/Array/getArraysDiff.test.d.ts +0 -1
  58. package/module/es5/tests/unit/Array/getArraysDiff.test.js +0 -99
  59. package/module/es5/tests/unit/Array/groupBy.test.d.ts +0 -1
  60. package/module/es5/tests/unit/Array/groupBy.test.js +0 -87
  61. package/module/es5/tests/unit/Array/insertionSort.test.d.ts +0 -1
  62. package/module/es5/tests/unit/Array/insertionSort.test.js +0 -37
  63. package/module/es5/tests/unit/Array/mergeSort.test.d.ts +0 -1
  64. package/module/es5/tests/unit/Array/mergeSort.test.js +0 -49
  65. package/module/es5/tests/unit/Array/pop.test.d.ts +0 -1
  66. package/module/es5/tests/unit/Array/pop.test.js +0 -50
  67. package/module/es5/tests/unit/Array/quickSort.test.d.ts +0 -1
  68. package/module/es5/tests/unit/Array/quickSort.test.js +0 -118
  69. package/module/es5/tests/unit/Array/randomSelect.test.d.ts +0 -1
  70. package/module/es5/tests/unit/Array/randomSelect.test.js +0 -51
  71. package/module/es5/tests/unit/Array/range.test.d.ts +0 -1
  72. package/module/es5/tests/unit/Array/range.test.js +0 -42
  73. package/module/es5/tests/unit/Array/shuffle.test.d.ts +0 -1
  74. package/module/es5/tests/unit/Array/shuffle.test.js +0 -84
  75. package/module/es5/tests/unit/Array/shuffle2DArray.test.d.ts +0 -1
  76. package/module/es5/tests/unit/Array/shuffle2DArray.test.js +0 -90
  77. package/module/es5/tests/unit/Array/sum.test.d.ts +0 -1
  78. package/module/es5/tests/unit/Array/sum.test.js +0 -44
  79. package/module/es5/tests/unit/Array/timSort.test.d.ts +0 -1
  80. package/module/es5/tests/unit/Array/timSort.test.js +0 -128
  81. package/module/es5/tests/unit/Array/zip.test.d.ts +0 -1
  82. package/module/es5/tests/unit/Array/zip.test.js +0 -69
  83. package/module/es5/tests/unit/Array/zipLongest.test.d.ts +0 -1
  84. package/module/es5/tests/unit/Array/zipLongest.test.js +0 -74
  85. package/module/es5/tests/unit/Color/cmykToRgba.test.d.ts +0 -1
  86. package/module/es5/tests/unit/Color/cmykToRgba.test.js +0 -58
  87. package/module/es5/tests/unit/Color/hexaToRgba.test.d.ts +0 -1
  88. package/module/es5/tests/unit/Color/hexaToRgba.test.js +0 -115
  89. package/module/es5/tests/unit/Color/hslaToRgba.test.d.ts +0 -1
  90. package/module/es5/tests/unit/Color/hslaToRgba.test.js +0 -141
  91. package/module/es5/tests/unit/Color/rgbaToCmyk.test.d.ts +0 -1
  92. package/module/es5/tests/unit/Color/rgbaToCmyk.test.js +0 -139
  93. package/module/es5/tests/unit/Color/rgbaToHexA.test.d.ts +0 -1
  94. package/module/es5/tests/unit/Color/rgbaToHexA.test.js +0 -114
  95. package/module/es5/tests/unit/Color/rgbaToHsla.test.d.ts +0 -1
  96. package/module/es5/tests/unit/Color/rgbaToHsla.test.js +0 -190
  97. package/module/es5/tests/unit/Consts/clock.test.d.ts +0 -1
  98. package/module/es5/tests/unit/Consts/clock.test.js +0 -71
  99. package/module/es5/tests/unit/Consts/httpClientErrorStatus.test.d.ts +0 -1
  100. package/module/es5/tests/unit/Consts/httpClientErrorStatus.test.js +0 -33
  101. package/module/es5/tests/unit/Consts/httpInformationalStatus.test.d.ts +0 -1
  102. package/module/es5/tests/unit/Consts/httpInformationalStatus.test.js +0 -13
  103. package/module/es5/tests/unit/Consts/httpRedirectionStatus.test.d.ts +0 -1
  104. package/module/es5/tests/unit/Consts/httpRedirectionStatus.test.js +0 -16
  105. package/module/es5/tests/unit/Consts/httpServerErrorStatus.test.d.ts +0 -1
  106. package/module/es5/tests/unit/Consts/httpServerErrorStatus.test.js +0 -15
  107. package/module/es5/tests/unit/Consts/httpStatus.test.d.ts +0 -1
  108. package/module/es5/tests/unit/Consts/httpStatus.test.js +0 -82
  109. package/module/es5/tests/unit/Consts/httpSuccessStatus.test.d.ts +0 -1
  110. package/module/es5/tests/unit/Consts/httpSuccessStatus.test.js +0 -16
  111. package/module/es5/tests/unit/Date/birthday.test.d.ts +0 -1
  112. package/module/es5/tests/unit/Date/birthday.test.js +0 -31
  113. package/module/es5/tests/unit/Date/dateRange.test.d.ts +0 -1
  114. package/module/es5/tests/unit/Date/dateRange.test.js +0 -40
  115. package/module/es5/tests/unit/Date/dayOfWeek.test.d.ts +0 -1
  116. package/module/es5/tests/unit/Date/dayOfWeek.test.js +0 -39
  117. package/module/es5/tests/unit/Date/deleteSpace.test.d.ts +0 -1
  118. package/module/es5/tests/unit/Date/deleteSpace.test.js +0 -35
  119. package/module/es5/tests/unit/Date/format.test.d.ts +0 -1
  120. package/module/es5/tests/unit/Date/format.test.js +0 -50
  121. package/module/es5/tests/unit/Date/getDay.test.d.ts +0 -1
  122. package/module/es5/tests/unit/Date/getDay.test.js +0 -40
  123. package/module/es5/tests/unit/Date/getTimezoneOffsetString.test.d.ts +0 -1
  124. package/module/es5/tests/unit/Date/getTimezoneOffsetString.test.js +0 -26
  125. package/module/es5/tests/unit/Date/isLeapYear.test.d.ts +0 -1
  126. package/module/es5/tests/unit/Date/isLeapYear.test.js +0 -30
  127. package/module/es5/tests/unit/Date/new.test.d.ts +0 -1
  128. package/module/es5/tests/unit/Date/new.test.js +0 -39
  129. package/module/es5/tests/unit/Date/now.test.d.ts +0 -1
  130. package/module/es5/tests/unit/Date/now.test.js +0 -42
  131. package/module/es5/tests/unit/Error/safeExecute.test.d.ts +0 -1
  132. package/module/es5/tests/unit/Error/safeExecute.test.js +0 -75
  133. package/module/es5/tests/unit/Function/curry.test.d.ts +0 -1
  134. package/module/es5/tests/unit/Function/curry.test.js +0 -138
  135. package/module/es5/tests/unit/IP/cidrToLong.test.d.ts +0 -1
  136. package/module/es5/tests/unit/IP/cidrToLong.test.js +0 -32
  137. package/module/es5/tests/unit/IP/cidrToSubnetMask.test.d.ts +0 -1
  138. package/module/es5/tests/unit/IP/cidrToSubnetMask.test.js +0 -36
  139. package/module/es5/tests/unit/IP/getIpClass.test.d.ts +0 -1
  140. package/module/es5/tests/unit/IP/getIpClass.test.js +0 -36
  141. package/module/es5/tests/unit/IP/getNetworkAddress.test.d.ts +0 -1
  142. package/module/es5/tests/unit/IP/getNetworkAddress.test.js +0 -40
  143. package/module/es5/tests/unit/IP/ipToBinaryString.test.d.ts +0 -1
  144. package/module/es5/tests/unit/IP/ipToBinaryString.test.js +0 -46
  145. package/module/es5/tests/unit/IP/ipToLong.test.d.ts +0 -1
  146. package/module/es5/tests/unit/IP/ipToLong.test.js +0 -34
  147. package/module/es5/tests/unit/IP/isInRange.test.d.ts +0 -1
  148. package/module/es5/tests/unit/IP/isInRange.test.js +0 -82
  149. package/module/es5/tests/unit/IP/isPrivateIp.test.d.ts +0 -1
  150. package/module/es5/tests/unit/IP/isPrivateIp.test.js +0 -26
  151. package/module/es5/tests/unit/IP/longToIp.test.d.ts +0 -1
  152. package/module/es5/tests/unit/IP/longToIp.test.js +0 -39
  153. package/module/es5/tests/unit/IP/subnetMaskToCidr.test.d.ts +0 -1
  154. package/module/es5/tests/unit/IP/subnetMaskToCidr.test.js +0 -41
  155. package/module/es5/tests/unit/Math/addition.test.d.ts +0 -1
  156. package/module/es5/tests/unit/Math/addition.test.js +0 -79
  157. package/module/es5/tests/unit/Math/average.test.d.ts +0 -1
  158. package/module/es5/tests/unit/Math/average.test.js +0 -48
  159. package/module/es5/tests/unit/Math/bitwise.test.d.ts +0 -1
  160. package/module/es5/tests/unit/Math/bitwise.test.js +0 -62
  161. package/module/es5/tests/unit/Math/calculator/calculator.test.d.ts +0 -1
  162. package/module/es5/tests/unit/Math/calculator/calculator.test.js +0 -76
  163. package/module/es5/tests/unit/Math/calculator/calculatorInitialization.test.d.ts +0 -1
  164. package/module/es5/tests/unit/Math/calculator/calculatorInitialization.test.js +0 -21
  165. package/module/es5/tests/unit/Math/calculator/convertCurrency.test.d.ts +0 -1
  166. package/module/es5/tests/unit/Math/calculator/convertCurrency.test.js +0 -40
  167. package/module/es5/tests/unit/Math/calculator/literalExpression.test.d.ts +0 -1
  168. package/module/es5/tests/unit/Math/calculator/literalExpression.test.js +0 -51
  169. package/module/es5/tests/unit/Math/degToRad.test.d.ts +0 -1
  170. package/module/es5/tests/unit/Math/degToRad.test.js +0 -50
  171. package/module/es5/tests/unit/Math/deviationValue.test.d.ts +0 -1
  172. package/module/es5/tests/unit/Math/deviationValue.test.js +0 -30
  173. package/module/es5/tests/unit/Math/division.test.d.ts +0 -1
  174. package/module/es5/tests/unit/Math/division.test.js +0 -81
  175. package/module/es5/tests/unit/Math/factorial.test.d.ts +0 -1
  176. package/module/es5/tests/unit/Math/factorial.test.js +0 -26
  177. package/module/es5/tests/unit/Math/factorize.test.d.ts +0 -1
  178. package/module/es5/tests/unit/Math/factorize.test.js +0 -38
  179. package/module/es5/tests/unit/Math/flexibleNumberConversion.test.d.ts +0 -1
  180. package/module/es5/tests/unit/Math/flexibleNumberConversion.test.js +0 -195
  181. package/module/es5/tests/unit/Math/gcd.test.d.ts +0 -1
  182. package/module/es5/tests/unit/Math/gcd.test.js +0 -35
  183. package/module/es5/tests/unit/Math/getDecimalLength.test.d.ts +0 -1
  184. package/module/es5/tests/unit/Math/getDecimalLength.test.js +0 -44
  185. package/module/es5/tests/unit/Math/lcm.test.d.ts +0 -1
  186. package/module/es5/tests/unit/Math/lcm.test.js +0 -43
  187. package/module/es5/tests/unit/Math/linearCongruentialGenerator.test.d.ts +0 -1
  188. package/module/es5/tests/unit/Math/linearCongruentialGenerator.test.js +0 -25
  189. package/module/es5/tests/unit/Math/mathConverter.test.d.ts +0 -1
  190. package/module/es5/tests/unit/Math/mathConverter.test.js +0 -37
  191. package/module/es5/tests/unit/Math/mathSeparator.test.d.ts +0 -1
  192. package/module/es5/tests/unit/Math/mathSeparator.test.js +0 -59
  193. package/module/es5/tests/unit/Math/max.test.d.ts +0 -1
  194. package/module/es5/tests/unit/Math/max.test.js +0 -22
  195. package/module/es5/tests/unit/Math/median.test.d.ts +0 -1
  196. package/module/es5/tests/unit/Math/median.test.js +0 -17
  197. package/module/es5/tests/unit/Math/min.test.d.ts +0 -1
  198. package/module/es5/tests/unit/Math/min.test.js +0 -22
  199. package/module/es5/tests/unit/Math/multiples.test.d.ts +0 -1
  200. package/module/es5/tests/unit/Math/multiples.test.js +0 -30
  201. package/module/es5/tests/unit/Math/multiplication.test.d.ts +0 -1
  202. package/module/es5/tests/unit/Math/multiplication.test.js +0 -48
  203. package/module/es5/tests/unit/Math/nCr.test.d.ts +0 -1
  204. package/module/es5/tests/unit/Math/nCr.test.js +0 -34
  205. package/module/es5/tests/unit/Math/nHr.test.d.ts +0 -1
  206. package/module/es5/tests/unit/Math/nHr.test.js +0 -35
  207. package/module/es5/tests/unit/Math/nPr.test.d.ts +0 -1
  208. package/module/es5/tests/unit/Math/nPr.test.js +0 -38
  209. package/module/es5/tests/unit/Math/primeFactorization.test.d.ts +0 -1
  210. package/module/es5/tests/unit/Math/primeFactorization.test.js +0 -84
  211. package/module/es5/tests/unit/Math/quotient.test.d.ts +0 -1
  212. package/module/es5/tests/unit/Math/quotient.test.js +0 -36
  213. package/module/es5/tests/unit/Math/radToDeg.test.d.ts +0 -1
  214. package/module/es5/tests/unit/Math/radToDeg.test.js +0 -50
  215. package/module/es5/tests/unit/Math/random.test.d.ts +0 -1
  216. package/module/es5/tests/unit/Math/random.test.js +0 -61
  217. package/module/es5/tests/unit/Math/reduce.test.d.ts +0 -1
  218. package/module/es5/tests/unit/Math/reduce.test.js +0 -93
  219. package/module/es5/tests/unit/Math/repeatedTrial.test.d.ts +0 -1
  220. package/module/es5/tests/unit/Math/repeatedTrial.test.js +0 -39
  221. package/module/es5/tests/unit/Math/roundOf.test.d.ts +0 -1
  222. package/module/es5/tests/unit/Math/roundOf.test.js +0 -40
  223. package/module/es5/tests/unit/Math/solveEquation.test.d.ts +0 -1
  224. package/module/es5/tests/unit/Math/solveEquation.test.js +0 -24
  225. package/module/es5/tests/unit/Math/standardDeviation.test.d.ts +0 -1
  226. package/module/es5/tests/unit/Math/standardDeviation.test.js +0 -23
  227. package/module/es5/tests/unit/Math/subtract.test.d.ts +0 -1
  228. package/module/es5/tests/unit/Math/subtract.test.js +0 -46
  229. package/module/es5/tests/unit/Math/toBaseN.test.d.ts +0 -1
  230. package/module/es5/tests/unit/Math/toBaseN.test.js +0 -40
  231. package/module/es5/tests/unit/Math/toCelsius.test.d.ts +0 -1
  232. package/module/es5/tests/unit/Math/toCelsius.test.js +0 -18
  233. package/module/es5/tests/unit/Math/toKelvin.test.d.ts +0 -1
  234. package/module/es5/tests/unit/Math/toKelvin.test.js +0 -18
  235. package/module/es5/tests/unit/Math/uuidv7.test.d.ts +0 -1
  236. package/module/es5/tests/unit/Math/uuidv7.test.js +0 -33
  237. package/module/es5/tests/unit/Math/valueSwap.test.d.ts +0 -1
  238. package/module/es5/tests/unit/Math/valueSwap.test.js +0 -28
  239. package/module/es5/tests/unit/Math/xoshiro256.test.d.ts +0 -1
  240. package/module/es5/tests/unit/Math/xoshiro256.test.js +0 -33
  241. package/module/es5/tests/unit/Object/has.test.d.ts +0 -1
  242. package/module/es5/tests/unit/Object/has.test.js +0 -60
  243. package/module/es5/tests/unit/Object/keyBy.test.d.ts +0 -1
  244. package/module/es5/tests/unit/Object/keyBy.test.js +0 -120
  245. package/module/es5/tests/unit/Object/pick.test.d.ts +0 -1
  246. package/module/es5/tests/unit/Object/pick.test.js +0 -109
  247. package/module/es5/tests/unit/Object/pickDeep.test.d.ts +0 -1
  248. package/module/es5/tests/unit/Object/pickDeep.test.js +0 -222
  249. package/module/es5/tests/unit/Simple/Array/quickSortSimple.test.d.ts +0 -1
  250. package/module/es5/tests/unit/Simple/Array/quickSortSimple.test.js +0 -18
  251. package/module/es5/tests/unit/Simple/Date/dayOfWeekSimple.test.d.ts +0 -1
  252. package/module/es5/tests/unit/Simple/Date/dayOfWeekSimple.test.js +0 -58
  253. package/module/es5/tests/unit/Simple/Math/deviationValueSimple.test.d.ts +0 -1
  254. package/module/es5/tests/unit/Simple/Math/deviationValueSimple.test.js +0 -43
  255. package/module/es5/tests/unit/String/deleteSpaces.test.d.ts +0 -1
  256. package/module/es5/tests/unit/String/deleteSpaces.test.js +0 -22
  257. package/module/es5/tests/unit/String/formatString.test.d.ts +0 -1
  258. package/module/es5/tests/unit/String/formatString.test.js +0 -47
  259. package/module/es5/tests/unit/String/fromBase64.test.d.ts +0 -1
  260. package/module/es5/tests/unit/String/fromBase64.test.js +0 -37
  261. package/module/es5/tests/unit/String/hasNoLetters.test.d.ts +0 -1
  262. package/module/es5/tests/unit/String/hasNoLetters.test.js +0 -29
  263. package/module/es5/tests/unit/String/padEnd.test.d.ts +0 -1
  264. package/module/es5/tests/unit/String/padEnd.test.js +0 -22
  265. package/module/es5/tests/unit/String/padStart.test.d.ts +0 -1
  266. package/module/es5/tests/unit/String/padStart.test.js +0 -40
  267. package/module/es5/tests/unit/String/randomString.test.d.ts +0 -1
  268. package/module/es5/tests/unit/String/randomString.test.js +0 -21
  269. package/module/es5/tests/unit/String/randomStringInitialization.test.d.ts +0 -1
  270. package/module/es5/tests/unit/String/randomStringInitialization.test.js +0 -25
  271. package/module/es5/tests/unit/String/reverseString.test.d.ts +0 -1
  272. package/module/es5/tests/unit/String/reverseString.test.js +0 -35
  273. package/module/es5/tests/unit/String/toBase64.test.d.ts +0 -1
  274. package/module/es5/tests/unit/String/toBase64.test.js +0 -20
  275. package/module/es5/tests/unit/String/toHalfWidth.test.d.ts +0 -1
  276. package/module/es5/tests/unit/String/toHalfWidth.test.js +0 -16
  277. package/module/es5/tests/unit/String/trimCharacters.test.d.ts +0 -1
  278. package/module/es5/tests/unit/String/trimCharacters.test.js +0 -17
  279. package/module/es5/tests/unit/String/trimEndCharacters.test.d.ts +0 -1
  280. package/module/es5/tests/unit/String/trimEndCharacters.test.js +0 -33
  281. package/module/es5/tests/unit/String/trimStartCharacters.test.d.ts +0 -1
  282. package/module/es5/tests/unit/String/trimStartCharacters.test.js +0 -33
  283. package/module/es5/tests/unit/Time/convertTime.test.d.ts +0 -1
  284. package/module/es5/tests/unit/Time/convertTime.test.js +0 -135
  285. package/module/es5/tests/unit/Time/normalizeTimeUnit.test.d.ts +0 -1
  286. package/module/es5/tests/unit/Time/normalizeTimeUnit.test.js +0 -29
  287. package/module/es5/tests/unit/Tool/createPipeline.test.d.ts +0 -1
  288. package/module/es5/tests/unit/Tool/createPipeline.test.js +0 -184
  289. package/module/es5/tests/unit/Tool/parseJson.test.d.ts +0 -1
  290. package/module/es5/tests/unit/Tool/parseJson.test.js +0 -46
  291. package/module/es5/tests/unit/Tool/pipe.test.d.ts +0 -1
  292. package/module/es5/tests/unit/Tool/pipe.test.js +0 -445
  293. package/module/es5/tests/unit/UA/extractBrowserFromUserAgent.test.d.ts +0 -1
  294. package/module/es5/tests/unit/UA/extractBrowserFromUserAgent.test.js +0 -47
  295. package/module/es5/tests/unit/UA/extractDeviceFromUserAgent.test.d.ts +0 -1
  296. package/module/es5/tests/unit/UA/extractDeviceFromUserAgent.test.js +0 -55
  297. package/module/es5/tests/unit/UA/extractOsFromUserAgent.test.d.ts +0 -1
  298. package/module/es5/tests/unit/UA/extractOsFromUserAgent.test.js +0 -57
  299. package/module/es5/tests/unit/UA/parseUserAgent.test.d.ts +0 -1
  300. package/module/es5/tests/unit/UA/parseUserAgent.test.js +0 -95
  301. package/module/es5/tests/unit/Unit/unitConverterInitialization.test.d.ts +0 -1
  302. package/module/es5/tests/unit/Unit/unitConverterInitialization.test.js +0 -40
  303. package/module/es5/tests/unit/Validate/array/core.test.d.ts +0 -1
  304. package/module/es5/tests/unit/Validate/array/core.test.js +0 -86
  305. package/module/es5/tests/unit/Validate/boolean/core.test.d.ts +0 -1
  306. package/module/es5/tests/unit/Validate/boolean/core.test.js +0 -29
  307. package/module/es5/tests/unit/Validate/core/core.test.d.ts +0 -1
  308. package/module/es5/tests/unit/Validate/core/core.test.js +0 -87
  309. package/module/es5/tests/unit/Validate/isArray.test.d.ts +0 -1
  310. package/module/es5/tests/unit/Validate/isArray.test.js +0 -36
  311. package/module/es5/tests/unit/Validate/isDictionaryObject.test.d.ts +0 -1
  312. package/module/es5/tests/unit/Validate/isDictionaryObject.test.js +0 -62
  313. package/module/es5/tests/unit/Validate/isDouble.test.d.ts +0 -1
  314. package/module/es5/tests/unit/Validate/isDouble.test.js +0 -47
  315. package/module/es5/tests/unit/Validate/isEqual.test.d.ts +0 -1
  316. package/module/es5/tests/unit/Validate/isEqual.test.js +0 -74
  317. package/module/es5/tests/unit/Validate/isNotEmpty.test.d.ts +0 -1
  318. package/module/es5/tests/unit/Validate/isNotEmpty.test.js +0 -43
  319. package/module/es5/tests/unit/Validate/isNumber.test.d.ts +0 -1
  320. package/module/es5/tests/unit/Validate/isNumber.test.js +0 -77
  321. package/module/es5/tests/unit/Validate/isPerfectSquare.test.d.ts +0 -1
  322. package/module/es5/tests/unit/Validate/isPerfectSquare.test.js +0 -27
  323. package/module/es5/tests/unit/Validate/isPrimeNumber.test.d.ts +0 -1
  324. package/module/es5/tests/unit/Validate/isPrimeNumber.test.js +0 -51
  325. package/module/es5/tests/unit/Validate/isValueNaN.test.d.ts +0 -1
  326. package/module/es5/tests/unit/Validate/isValueNaN.test.js +0 -54
  327. package/module/es5/tests/unit/Validate/number/core.test.d.ts +0 -1
  328. package/module/es5/tests/unit/Validate/number/core.test.js +0 -36
  329. package/module/es5/tests/unit/Validate/number/double.test.d.ts +0 -1
  330. package/module/es5/tests/unit/Validate/number/double.test.js +0 -23
  331. package/module/es5/tests/unit/Validate/number/even.test.d.ts +0 -1
  332. package/module/es5/tests/unit/Validate/number/even.test.js +0 -23
  333. package/module/es5/tests/unit/Validate/number/maxValue.test.d.ts +0 -1
  334. package/module/es5/tests/unit/Validate/number/maxValue.test.js +0 -20
  335. package/module/es5/tests/unit/Validate/number/minValue.test.d.ts +0 -1
  336. package/module/es5/tests/unit/Validate/number/minValue.test.js +0 -20
  337. package/module/es5/tests/unit/Validate/number/odd.test.d.ts +0 -1
  338. package/module/es5/tests/unit/Validate/number/odd.test.js +0 -23
  339. package/module/es5/tests/unit/Validate/number/prime.test.d.ts +0 -1
  340. package/module/es5/tests/unit/Validate/number/prime.test.js +0 -25
  341. package/module/es5/tests/unit/Validate/object/core.test.d.ts +0 -1
  342. package/module/es5/tests/unit/Validate/object/core.test.js +0 -79
  343. package/module/es5/tests/unit/Validate/string/core.test.d.ts +0 -1
  344. package/module/es5/tests/unit/Validate/string/core.test.js +0 -27
  345. package/module/es5/tests/unit/Validate/string/email.test.d.ts +0 -1
  346. package/module/es5/tests/unit/Validate/string/email.test.js +0 -21
  347. package/module/es5/tests/unit/Validate/string/length.test.d.ts +0 -1
  348. package/module/es5/tests/unit/Validate/string/length.test.js +0 -18
  349. package/module/es5/tests/unit/Validate/string/maxLength.test.d.ts +0 -1
  350. package/module/es5/tests/unit/Validate/string/maxLength.test.js +0 -18
  351. package/module/es5/tests/unit/Validate/string/minLength.test.d.ts +0 -1
  352. package/module/es5/tests/unit/Validate/string/minLength.test.js +0 -18
  353. package/module/es5/tests/unit/Validate/string/numberString.test.d.ts +0 -1
  354. package/module/es5/tests/unit/Validate/string/numberString.test.js +0 -22
  355. package/module/es5/tests/unit/Validate/string/regexMatch.test.d.ts +0 -1
  356. package/module/es5/tests/unit/Validate/string/regexMatch.test.js +0 -29
  357. package/module/es5/tests/unit/Validate/string/uuid.test.d.ts +0 -1
  358. package/module/es5/tests/unit/Validate/string/uuid.test.js +0 -72
  359. package/module/es5/tests/unit/types/arrayType.test.d.ts +0 -1
  360. package/module/es5/tests/unit/types/arrayType.test.js +0 -11
  361. package/module/es5/tests/unit/types/clockType.test.d.ts +0 -1
  362. package/module/es5/tests/unit/types/clockType.test.js +0 -37
@@ -1,118 +0,0 @@
1
- "use strict";
2
-
3
- var _quickSort = require("@/Array/quickSort");
4
- describe("quickSort", function () {
5
- it("should return an empty array when sorting an empty array", function () {
6
- expect((0, _quickSort.quickSort)([])).toEqual([]);
7
- });
8
- it("should return the same array when it's already sorted", function () {
9
- expect((0, _quickSort.quickSort)([1, 2, 3, 4, 5])).toEqual([1, 2, 3, 4, 5]);
10
- });
11
- it("should correctly sort a reverse-sorted array", function () {
12
- expect((0, _quickSort.quickSort)([5, 4, 3, 2, 1])).toEqual([1, 2, 3, 4, 5]);
13
- });
14
- it("should correctly sort a random array", function () {
15
- expect((0, _quickSort.quickSort)([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5])).toEqual([1, 1, 2, 3, 3, 4, 5, 5, 5, 6, 9]);
16
- });
17
- it("should correctly sort an array with duplicate elements", function () {
18
- expect((0, _quickSort.quickSort)([3, 3, 3, 2, 1, 1, 4, 4, 5])).toEqual([1, 1, 2, 3, 3, 3, 4, 4, 5]);
19
- });
20
- it("should correctly sort an array with large number of elements", function () {
21
- var largeArray = Array.from({
22
- length: 10000
23
- }, function () {
24
- return Math.floor(Math.random() * 10000);
25
- });
26
- var sortedArray = [].concat(largeArray).sort(function (a, b) {
27
- return a - b;
28
- });
29
- expect((0, _quickSort.quickSort)(largeArray)).toEqual(sortedArray);
30
- });
31
- it("should correctly sort an array with negative numbers", function () {
32
- expect((0, _quickSort.quickSort)([5, -1, 3, 2, 4, -5, 1, -2, 0])).toEqual([-5, -2, -1, 0, 1, 2, 3, 4, 5]);
33
- });
34
- it("should sort array in descending order", function () {
35
- expect((0, _quickSort.quickSort)([1, 2, 3, 4, 5], function (a, b) {
36
- return b - a;
37
- })).toEqual([5, 4, 3, 2, 1]);
38
- });
39
- it("should sort a portion of the array", function () {
40
- expect((0, _quickSort.quickSort)([3, 1, 4, 1, 5], undefined, 1, 3)).toEqual([3, 1, 1, 4, 5]);
41
- });
42
- it("should return single-element array unchanged", function () {
43
- expect((0, _quickSort.quickSort)([1])).toEqual([1]);
44
- });
45
- it("should handle compareFunction throwing an error", function () {
46
- var throwCompare = function throwCompare() {
47
- throw new Error("Error during comparison");
48
- };
49
- expect(function () {
50
- return (0, _quickSort.quickSort)([3, 1, 4], throwCompare);
51
- }).toThrow("Error during comparison");
52
- });
53
- describe("median of three cases", function () {
54
- it("should handle all elements equal", function () {
55
- expect((0, _quickSort.quickSort)([5, 5, 5, 5, 5])).toEqual([5, 5, 5, 5, 5]);
56
- });
57
- it("should handle three-element arrays in all orders", function () {
58
- expect((0, _quickSort.quickSort)([1, 2, 3])).toEqual([1, 2, 3]); // a < b < c
59
- expect((0, _quickSort.quickSort)([1, 3, 2])).toEqual([1, 2, 3]); // a < c < b
60
- expect((0, _quickSort.quickSort)([2, 1, 3])).toEqual([1, 2, 3]); // b < a < c
61
- expect((0, _quickSort.quickSort)([2, 3, 1])).toEqual([1, 2, 3]); // b < c < a
62
- expect((0, _quickSort.quickSort)([3, 1, 2])).toEqual([1, 2, 3]); // c < a < b
63
- expect((0, _quickSort.quickSort)([3, 2, 1])).toEqual([1, 2, 3]); // c < b < a
64
- });
65
- });
66
- describe("insertion sort threshold cases", function () {
67
- it("should handle arrays at threshold size", function () {
68
- var arr = Array.from({
69
- length: 10
70
- }, function (_, i) {
71
- return 10 - i;
72
- });
73
- expect((0, _quickSort.quickSort)(arr)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
74
- });
75
- it("should handle arrays below threshold size", function () {
76
- var arr = Array.from({
77
- length: 5
78
- }, function (_, i) {
79
- return 5 - i;
80
- });
81
- expect((0, _quickSort.quickSort)(arr)).toEqual([1, 2, 3, 4, 5]);
82
- });
83
- it("should handle custom threshold", function () {
84
- var arr = Array.from({
85
- length: 20
86
- }, function (_, i) {
87
- return 20 - i;
88
- });
89
- expect((0, _quickSort.quickSort)(arr, undefined, 0, arr.length - 1, 5)).toEqual(Array.from({
90
- length: 20
91
- }, function (_, i) {
92
- return i + 1;
93
- }));
94
- });
95
- });
96
- describe("boundary conditions", function () {
97
- it("should handle invalid index ranges", function () {
98
- // Out of bounds indices should be clamped to valid range
99
- expect((0, _quickSort.quickSort)([3, 1, 4, 1, 5], undefined, -1, 10)).toEqual([1, 1, 3, 4, 5]);
100
- expect((0, _quickSort.quickSort)([3, 1, 4, 1, 5], undefined, 10, -1)).toEqual([3, 1, 4, 1, 5]);
101
-
102
- // When startIndex > endIndex, array should remain unchanged
103
- var arr = [3, 1, 4, 1, 5];
104
- expect((0, _quickSort.quickSort)([].concat(arr), undefined, 3, 1)).toEqual(arr);
105
-
106
- // Sorting empty range should not change array
107
- expect((0, _quickSort.quickSort)([].concat(arr), undefined, 2, 2)).toEqual(arr);
108
- });
109
- it("should handle two-element arrays", function () {
110
- expect((0, _quickSort.quickSort)([2, 1])).toEqual([1, 2]);
111
- expect((0, _quickSort.quickSort)([1, 2])).toEqual([1, 2]);
112
- });
113
- it("should handle arrays with all same value except one", function () {
114
- expect((0, _quickSort.quickSort)([1, 1, 1, 0, 1])).toEqual([0, 1, 1, 1, 1]);
115
- expect((0, _quickSort.quickSort)([1, 1, 1, 2, 1])).toEqual([1, 1, 1, 1, 2]);
116
- });
117
- });
118
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,51 +0,0 @@
1
- "use strict";
2
-
3
- var _randomSelect = require("@/Array/randomSelect");
4
- describe("randomSelect", function () {
5
- it("should randomly select the specified number of elements", function () {
6
- var array = [1, 2, 3, 4, 5];
7
- var result = (0, _randomSelect.randomSelect)(array, 2);
8
- expect(result).toHaveLength(2);
9
- result.forEach(function (item) {
10
- expect(array).toContain(item);
11
- });
12
- });
13
- it("should return elements equal to array length when count exceeds array length", function () {
14
- var array = [1, 2, 3];
15
- var result = (0, _randomSelect.randomSelect)(array, 5);
16
- expect(result).toHaveLength(3);
17
- result.forEach(function (item) {
18
- expect(array).toContain(item);
19
- });
20
- });
21
- it("should return an empty array when given an empty array", function () {
22
- var result = (0, _randomSelect.randomSelect)([], 3);
23
- expect(result).toEqual([]);
24
- });
25
- it("should return specified count with duplicates when allowDuplicates is true", function () {
26
- var array = [1, 2, 3];
27
- var result = (0, _randomSelect.randomSelect)(array, 5, true);
28
- expect(result).toHaveLength(5);
29
- result.forEach(function (item) {
30
- expect(array).toContain(item);
31
- });
32
- });
33
- it("should return specified count without duplicates when allowDuplicates is false", function () {
34
- var array = [1, 2, 3, 4, 5];
35
- var result = (0, _randomSelect.randomSelect)(array, 3, false);
36
- expect(result).toHaveLength(3);
37
- result.forEach(function (item) {
38
- expect(array).toContain(item);
39
- });
40
- });
41
- it("should return an empty array when count is negative", function () {
42
- var array = [1, 2, 3, 4, 5];
43
- var result = (0, _randomSelect.randomSelect)(array, -1);
44
- expect(result).toEqual([]);
45
- });
46
- it("should return an empty array when count is zero", function () {
47
- var array = [1, 2, 3, 4, 5];
48
- var result = (0, _randomSelect.randomSelect)(array, 0);
49
- expect(result).toEqual([]);
50
- });
51
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,42 +0,0 @@
1
- "use strict";
2
-
3
- var _range = require("@/Array/range");
4
- describe("range", function () {
5
- test("should generate an array of consecutive numbers from -5 to 5", function () {
6
- var result = (0, _range.range)(-5, 5);
7
- expect(result).toEqual([-5, -4, -3, -2, -1, 0, 1, 2, 3, 4]);
8
- });
9
- test("should generate an array of consecutive numbers from 1 to 10", function () {
10
- var result = (0, _range.range)(1, 10);
11
- expect(result).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9]);
12
- });
13
- test("should return an empty array when start equals end", function () {
14
- expect((0, _range.range)(0, 0)).toEqual([]);
15
- expect((0, _range.range)(5, 5)).toEqual([]);
16
- });
17
- test("should generate an array of consecutive numbers from 0 to start", function () {
18
- var result = (0, _range.range)(5);
19
- expect(result).toEqual([0, 1, 2, 3, 4]);
20
- });
21
- test("should generate an array with specified step", function () {
22
- expect((0, _range.range)(0, 10, 2)).toEqual([0, 2, 4, 6, 8]);
23
- expect((0, _range.range)(0, 5, 0.5)).toEqual([0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5]);
24
- });
25
- test("should handle negative step", function () {
26
- expect((0, _range.range)(5, 0, -1)).toEqual([5, 4, 3, 2, 1]);
27
- expect((0, _range.range)(0, -5, -1)).toEqual([0, -1, -2, -3, -4]);
28
- expect((0, _range.range)(10, 5, -2)).toEqual([10, 8, 6]);
29
- });
30
- test("should handle step of zero", function () {
31
- expect((0, _range.range)(0, 5, 0)).toEqual([]); // Avoid infinite loop
32
- });
33
- test("should handle start greater than end", function () {
34
- expect((0, _range.range)(10, 5)).toEqual([]); // Returns empty array when start > end
35
- });
36
- test("should handle floating point steps", function () {
37
- expect((0, _range.range)(0, 1, 0.2)).toEqual([0, 0.2, 0.4, 0.6, 0.8]);
38
- });
39
- test("should handle single step from 0 to start", function () {
40
- expect((0, _range.range)(3, undefined, 2)).toEqual([0, 2]);
41
- });
42
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,84 +0,0 @@
1
- "use strict";
2
-
3
- var _shuffle = require("@/Array/shuffle");
4
- describe("shuffle function", function () {
5
- it("should shuffle array elements", function () {
6
- var array = [1, 2, 3, 4, 5];
7
- var shuffledArray = (0, _shuffle.shuffle)(array);
8
- expect(shuffledArray).not.toEqual(array);
9
- expect(shuffledArray.sort()).toEqual(array.sort());
10
- });
11
- it("should return empty array unchanged", function () {
12
- var array = [];
13
- var shuffledArray = (0, _shuffle.shuffle)(array);
14
- expect(shuffledArray).toEqual(array);
15
- });
16
- it("should maintain the same length after shuffling", function () {
17
- var array = [1, 2, 3, 4, 5];
18
- var shuffledArray = (0, _shuffle.shuffle)(array);
19
- expect(shuffledArray.length).toBe(array.length);
20
- });
21
- it("should shuffle array with mixed strings and numbers", function () {
22
- var array = [1, "2", 3, "4", 5];
23
- var shuffledArray = (0, _shuffle.shuffle)(array);
24
- expect(shuffledArray).not.toEqual(array);
25
- expect(shuffledArray.sort()).toEqual(array.sort());
26
- });
27
- it("should shuffle large arrays", function () {
28
- var array = Array.from({
29
- length: 1000
30
- }, function (_, index) {
31
- return index;
32
- });
33
- var shuffledArray = (0, _shuffle.shuffle)(array);
34
- expect(shuffledArray).not.toEqual(array);
35
- expect(shuffledArray.sort()).toEqual(array.sort());
36
- });
37
- it("should return single-element array unchanged", function () {
38
- var array = [1];
39
- var shuffledArray = (0, _shuffle.shuffle)(array);
40
- expect(shuffledArray).toEqual(array);
41
- });
42
- it("should maintain frequency of duplicate elements", function () {
43
- var array = [1, 1, 2, 2, 3, 3];
44
- var shuffledArray = (0, _shuffle.shuffle)(array);
45
- var countElements = function countElements(arr) {
46
- return arr.reduce(function (acc, curr) {
47
- acc[curr] = (acc[curr] || 0) + 1;
48
- return acc;
49
- }, {});
50
- };
51
- expect(countElements(shuffledArray)).toEqual(countElements(array));
52
- });
53
- it("should handle array of objects", function () {
54
- var array = [{
55
- id: 1,
56
- value: "one"
57
- }, {
58
- id: 2,
59
- value: "two"
60
- }, {
61
- id: 3,
62
- value: "three"
63
- }, {
64
- id: 4,
65
- value: "four"
66
- }, {
67
- id: 5,
68
- value: "five"
69
- }];
70
- var shuffledArray = (0, _shuffle.shuffle)(array);
71
- expect(shuffledArray).not.toEqual(array);
72
- expect(shuffledArray.map(function (obj) {
73
- return obj.id;
74
- }).sort()).toEqual(array.map(function (obj) {
75
- return obj.id;
76
- }).sort());
77
- });
78
- it("should not modify the original array", function () {
79
- var array = [1, 2, 3, 4, 5];
80
- var originalArray = [].concat(array);
81
- (0, _shuffle.shuffle)(array);
82
- expect(array).toEqual(originalArray);
83
- });
84
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,90 +0,0 @@
1
- "use strict";
2
-
3
- var _shuffle2DArray = require("@/Array/shuffle2DArray");
4
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
5
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
- 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; } }
7
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
8
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
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; }
10
- describe("shuffle2DArray function", function () {
11
- it("should handle single-element 2D array", function () {
12
- var array = [[1]];
13
- var shuffledArray = (0, _shuffle2DArray.shuffle2DArray)(array);
14
- expect(shuffledArray).toEqual(array);
15
- });
16
- it("should return empty 2D array unchanged", function () {
17
- var array = [];
18
- var shuffledArray = (0, _shuffle2DArray.shuffle2DArray)(array);
19
- expect(shuffledArray).toEqual(array);
20
- });
21
- it("should return array with empty subarrays unchanged", function () {
22
- var array = [[], [], []];
23
- var shuffledArray = (0, _shuffle2DArray.shuffle2DArray)(array);
24
- expect(shuffledArray).toEqual(array);
25
- });
26
- it("should maintain the same length of 2D array and subarrays after shuffling", function () {
27
- var array = [[1, 2], [3, 4], [5, 6]];
28
- var shuffledArray = (0, _shuffle2DArray.shuffle2DArray)(array);
29
- expect(shuffledArray.length).toBe(array.length);
30
- shuffledArray.forEach(function (subArray, index) {
31
- expect(subArray.length).toBe(array[index].length);
32
- });
33
- });
34
- it("should shuffle 2D array with mixed types", function () {
35
- var array = [[1, "2"], ["3", 4], [5, "6"]];
36
- var shuffledArray = (0, _shuffle2DArray.shuffle2DArray)(array);
37
- // Check if the entire array is shuffled
38
- expect(shuffledArray.map(function (subArray) {
39
- return subArray.sort();
40
- })).not.toEqual(array.map(function (subArray) {
41
- return subArray.sort();
42
- }));
43
- });
44
- it("should shuffle large 2D arrays", function () {
45
- var array = Array.from({
46
- length: 1000
47
- }, function (_, index) {
48
- return [index, index + 1];
49
- });
50
- var shuffledArray = (0, _shuffle2DArray.shuffle2DArray)(array);
51
- // Check if the entire array is shuffled
52
- expect(shuffledArray.map(function (subArray) {
53
- return subArray.sort();
54
- })).not.toEqual(array.map(function (subArray) {
55
- return subArray.sort();
56
- }));
57
- });
58
- it("should handle subarrays of different lengths", function () {
59
- var array = [[1], [2, 3], [4, 5, 6]];
60
- var shuffledArray = (0, _shuffle2DArray.shuffle2DArray)(array);
61
- expect(shuffledArray.length).toBe(array.length);
62
- shuffledArray.forEach(function (subArray, index) {
63
- expect(subArray.length).toBe(array[index].length);
64
- });
65
- // Verify the total number of elements remains the same
66
- var flatOriginal = array.flat();
67
- var flatShuffled = shuffledArray.flat();
68
- expect(flatShuffled.sort()).toEqual(flatOriginal.sort());
69
- });
70
- it("should not modify the original array", function () {
71
- var array = [[1, 2], [3, 4], [5, 6]];
72
- var originalArray = array.map(function (subArray) {
73
- return _toConsumableArray(subArray);
74
- });
75
- (0, _shuffle2DArray.shuffle2DArray)(array);
76
- expect(array).toEqual(originalArray);
77
- });
78
- it("should maintain the total count of each unique element", function () {
79
- var array = [[1, 1], [2, 2], [1, 2]];
80
- var shuffledArray = (0, _shuffle2DArray.shuffle2DArray)(array);
81
- var countElements = function countElements(arr) {
82
- var counts = {};
83
- arr.flat().forEach(function (num) {
84
- counts[num] = (counts[num] || 0) + 1;
85
- });
86
- return counts;
87
- };
88
- expect(countElements(shuffledArray)).toEqual(countElements(array));
89
- });
90
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,44 +0,0 @@
1
- "use strict";
2
-
3
- var _sum = require("@/Array/sum");
4
- describe("sum function", function () {
5
- it("should calculate sum of integer numbers", function () {
6
- expect((0, _sum.sum)([1, 2, 3])).toBe(6);
7
- expect((0, _sum.sum)([10, 20, 30])).toBe(60);
8
- expect((0, _sum.sum)([-1, -2, -3])).toBe(-6);
9
- expect((0, _sum.sum)([])).toBe(0);
10
- });
11
- it("should calculate sum of decimal numbers", function () {
12
- expect((0, _sum.sum)([0.1, 0.2, 0.3])).toBe(0.6);
13
- expect((0, _sum.sum)([1.1, 2.2, 3.3])).toBe(6.6);
14
- expect((0, _sum.sum)([0.1, 0.02, 0.003])).toBe(0.123);
15
- });
16
- it("should handle mixed integer and decimal numbers", function () {
17
- expect((0, _sum.sum)([1, 2.5, 3.7])).toBe(7.2);
18
- expect((0, _sum.sum)([-1.5, 2, -3.7])).toBe(-3.2);
19
- });
20
- it("should handle large numbers", function () {
21
- var largeNum = 1000000000; // 10^9
22
- expect((0, _sum.sum)([largeNum, largeNum])).toBe(2 * largeNum);
23
- expect((0, _sum.sum)([largeNum, -largeNum])).toBe(0);
24
- expect((0, _sum.sum)([largeNum, 1, -1])).toBe(largeNum);
25
- var mediumNum = 1000000; // 10^6
26
- var count = 1000;
27
- var arr = new Array(count).fill(mediumNum);
28
- expect((0, _sum.sum)(arr)).toBe(mediumNum * count);
29
- });
30
- it("should handle very small numbers", function () {
31
- var smallNum = Number.MIN_VALUE;
32
- expect((0, _sum.sum)([smallNum, smallNum])).toBe(2 * smallNum);
33
- expect((0, _sum.sum)([smallNum, -smallNum])).toBe(0);
34
- });
35
- it("should handle JavaScript number precision", function () {
36
- // Testing number precision handling
37
- expect((0, _sum.sum)([0.1, 0.2])).toBeCloseTo(0.3, 10);
38
- expect((0, _sum.sum)([0.1, 0.2, 0.3, 0.4, 0.5])).toBeCloseTo(1.5, 10);
39
- });
40
- it("should maintain precision for many decimal places", function () {
41
- expect((0, _sum.sum)([0.0001, 0.0002, 0.0003])).toBe(0.0006);
42
- expect((0, _sum.sum)([1.23456, 2.34567, 3.45678])).toBeCloseTo(7.03701, 5);
43
- });
44
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,128 +0,0 @@
1
- "use strict";
2
-
3
- var _timSort = require("@/Array/timSort");
4
- describe("timSort", function () {
5
- it("should return an empty array when sorting an empty array", function () {
6
- expect((0, _timSort.timSort)([])).toEqual([]);
7
- });
8
- it("should return the same array when it's already sorted", function () {
9
- expect((0, _timSort.timSort)([1, 2, 3])).toEqual([1, 2, 3]);
10
- });
11
- it("should correctly sort a reverse-sorted array", function () {
12
- expect((0, _timSort.timSort)([3, 2, 1])).toEqual([1, 2, 3]);
13
- });
14
- it("should correctly sort a random array", function () {
15
- var array = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5];
16
- var sortedArray = [].concat(array).sort(function (a, b) {
17
- return a - b;
18
- });
19
- expect((0, _timSort.timSort)(array)).toEqual(sortedArray);
20
- });
21
- it("should correctly sort an array with duplicate elements", function () {
22
- expect((0, _timSort.timSort)([2, 3, 3, 1, 2])).toEqual([1, 2, 2, 3, 3]);
23
- });
24
- it("should correctly sort an array with large number of elements", function () {
25
- var largeArray = Array.from({
26
- length: 10000
27
- }, function () {
28
- return Math.floor(Math.random() * 10000);
29
- });
30
- var sortedArray = [].concat(largeArray).sort(function (a, b) {
31
- return a - b;
32
- });
33
- expect((0, _timSort.timSort)(largeArray)).toEqual(sortedArray);
34
- });
35
- it("should correctly sort an array with negative numbers", function () {
36
- expect((0, _timSort.timSort)([5, -1, 3, 2, 4, -5, 1, -2, 0])).toEqual([-5, -2, -1, 0, 1, 2, 3, 4, 5]);
37
- });
38
- it("should sort array in descending order", function () {
39
- expect((0, _timSort.timSort)([1, 2, 3], function (a, b) {
40
- return b - a;
41
- })).toEqual([3, 2, 1]);
42
- });
43
- it("should sort a portion of the array", function () {
44
- expect((0, _timSort.timSort)([1, 3, 2, 5, 4], function (a, b) {
45
- return a - b;
46
- }, 1, 3)).toEqual([1, 2, 3, 5, 4]);
47
- });
48
- it("should maintain stability when sorting objects", function () {
49
- var array = [{
50
- value: 2,
51
- order: 1
52
- }, {
53
- value: 1,
54
- order: 2
55
- }, {
56
- value: 2,
57
- order: 3
58
- }, {
59
- value: 1,
60
- order: 4
61
- }];
62
- var result = (0, _timSort.timSort)(array, function (a, b) {
63
- return a.value - b.value;
64
- });
65
- expect(result.map(function (x) {
66
- return x.order;
67
- })).toEqual([2, 4, 1, 3]); // original order within same values
68
- });
69
- it("should handle arrays just larger than MIN_RUN", function () {
70
- var array = Array.from({
71
- length: 33
72
- }, function (_, i) {
73
- return 33 - i;
74
- });
75
- var result = (0, _timSort.timSort)(array);
76
- expect(result).toEqual(Array.from({
77
- length: 33
78
- }, function (_, i) {
79
- return i + 1;
80
- }));
81
- });
82
- it("should handle arrays with repeated elements near run boundaries", function () {
83
- // Creates runs with repeated elements at boundaries
84
- var array = [];
85
- for (var i = 0; i < 64; i++) {
86
- array.push(Math.floor(i / 16)); // Creates 4 values, each repeated 16 times
87
- }
88
- var shuffled = [].concat(array).sort(function () {
89
- return Math.random() - 0.5;
90
- });
91
- expect((0, _timSort.timSort)(shuffled)).toEqual(array);
92
- });
93
- it("should handle arrays with all identical elements", function () {
94
- var array = new Array(100).fill(1);
95
- expect((0, _timSort.timSort)(array)).toEqual(array);
96
- });
97
- it("should handle strings and numbers separately", function () {
98
- var strings = ["b", "a", "d", "c"];
99
- var numbers = [3, 1, 4, 2];
100
- expect((0, _timSort.timSort)(strings)).toEqual(["a", "b", "c", "d"]);
101
- expect((0, _timSort.timSort)(numbers)).toEqual([1, 2, 3, 4]);
102
- });
103
- it("should handle booleans", function () {
104
- var array = [true, false, true, false];
105
- expect((0, _timSort.timSort)(array)).toEqual([false, false, true, true]);
106
- });
107
- it("should handle null and undefined", function () {
108
- var array = [null, undefined, null, undefined];
109
- var compareFunction = function compareFunction(a, b) {
110
- if (a === b) return 0;
111
- if (a === null) return -1;
112
- if (b === null) return 1;
113
- if (a === undefined) return -1;
114
- if (b === undefined) return 1;
115
- return 0;
116
- };
117
- expect((0, _timSort.timSort)(array, compareFunction)).toEqual([null, null, undefined, undefined]);
118
- });
119
- it("should handle custom comparison for mixed types", function () {
120
- var array = ["b", 2, "a", 1];
121
- var compareFunction = function compareFunction(a, b) {
122
- var aStr = String(a);
123
- var bStr = String(b);
124
- return aStr.localeCompare(bStr);
125
- };
126
- expect((0, _timSort.timSort)(array, compareFunction)).toEqual([1, 2, "a", "b"]);
127
- });
128
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,69 +0,0 @@
1
- "use strict";
2
-
3
- var _zip = require("@/Array/zip");
4
- describe("zip function", function () {
5
- it("should combine multiple arrays", function () {
6
- var array1 = [1, 2, 3];
7
- var array2 = ["one", "two", "three"];
8
- var array3 = [true, false, true];
9
- var result = (0, _zip.zip)(array1, array2, array3);
10
- expect(result).toEqual([[1, "one", true], [2, "two", false], [3, "three", true]]);
11
- });
12
- it("should combine arrays of different lengths", function () {
13
- var array1 = [1, 2];
14
- var array2 = ["one", "two", "three"];
15
- var result = (0, _zip.zip)(array1, array2);
16
- expect(result).toEqual([[1, "one"], [2, "two"]]);
17
- });
18
- it("should handle empty arrays correctly", function () {
19
- var array1 = [1, 2, 3];
20
- var emptyArray = [];
21
- var result = (0, _zip.zip)(array1, emptyArray);
22
- expect(result).toEqual([]);
23
- });
24
- it("should return an empty array when no arguments are provided", function () {
25
- var result = (0, _zip.zip)();
26
- expect(result).toEqual([]);
27
- });
28
- it("should handle arrays with null and undefined values", function () {
29
- var array1 = [1, null, 3];
30
- var array2 = ["a", undefined, "c"];
31
- var result = (0, _zip.zip)(array1, array2);
32
- expect(result).toEqual([[1, "a"], [null, undefined], [3, "c"]]);
33
- });
34
- it("should handle nested arrays", function () {
35
- var array1 = [[1], [2], [3]];
36
- var array2 = [["a"], ["b"], ["c"]];
37
- var result = (0, _zip.zip)(array1, array2);
38
- expect(result).toEqual([[[1], ["a"]], [[2], ["b"]], [[3], ["c"]]]);
39
- });
40
- it("should handle arrays of objects", function () {
41
- var array1 = [{
42
- id: 1
43
- }, {
44
- id: 2
45
- }];
46
- var array2 = [{
47
- name: "a"
48
- }, {
49
- name: "b"
50
- }];
51
- var result = (0, _zip.zip)(array1, array2);
52
- expect(result).toEqual([[{
53
- id: 1
54
- }, {
55
- name: "a"
56
- }], [{
57
- id: 2
58
- }, {
59
- name: "b"
60
- }]]);
61
- });
62
- it("should handle mixed type arrays without type errors", function () {
63
- var numbers = [1, 2];
64
- var strings = ["a", "b"];
65
- var booleans = [true, false];
66
- var result = (0, _zip.zip)(numbers, strings, booleans);
67
- expect(result).toEqual([[1, "a", true], [2, "b", false]]);
68
- });
69
- });
@@ -1 +0,0 @@
1
- export {};