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
@@ -1,82 +0,0 @@
1
- "use strict";
2
-
3
- var _isInRange = require("@/IP/isInRange");
4
- describe("isInRange", function () {
5
- describe("valid IP ranges", function () {
6
- test.each([
7
- // [remoteIp, networkIp, cidr, expected]
8
- ["192.168.1.2", "192.168.1.0", 24, true],
9
- // Common class C network
10
- ["192.168.2.2", "192.168.1.0", 24, false],
11
- // Outside class C network
12
- ["10.0.0.5", "10.0.0.0", 8, true],
13
- // Class A network
14
- ["11.0.0.5", "10.0.0.0", 8, false],
15
- // Outside class A network
16
- ["172.16.1.1", "172.16.0.0", 16, true],
17
- // Class B network
18
- ["172.17.1.1", "172.16.0.0", 16, false],
19
- // Outside class B network
20
- ["192.168.1.0", "192.168.1.0", 32, true],
21
- // Single host network - exact match
22
- ["192.168.1.1", "192.168.1.1", 32, true],
23
- // Single host network - exact match
24
- ["192.168.1.1", "192.168.1.0", 32, false],
25
- // Single host network - different IP
26
- ["192.168.1.1", "192.168.1.0", 30, true],
27
- // Small subnet
28
- ["192.168.1.4", "192.168.1.0", 30, false],
29
- // Outside small subnet
30
- ["0.0.0.1", "0.0.0.0", 0, true],
31
- // All IPs in range (CIDR 0)
32
- ["255.255.255.255", "0.0.0.0", 0, true] // All IPs in range (CIDR 0)
33
- ])("should evaluate if %s is in network %s/%i => %s", function (remoteIp, networkIp, cidr, expected) {
34
- expect((0, _isInRange.isInRange)(remoteIp, networkIp, cidr)).toBe(expected);
35
- });
36
- test.each([
37
- // [remoteIp, networkIp, cidr, description]
38
- ["192.168.1.1", "0.0.0.0", 0, "CIDR 0: all IPs in range"], ["192.168.1.0", "192.168.1.0", 32, "CIDR 32: exact match only"], ["192.168.1.1", "192.168.1.0", 31, "CIDR 31: two IPs"], ["192.168.1.1", "192.168.1.0", 1, "CIDR 1: half of all IPs"]])("should handle %s (%s)", function (ip, network, cidr) {
39
- expect((0, _isInRange.isInRange)(ip, network, cidr)).toBe(true);
40
- });
41
- test("should correctly handle edge cases with specific CIDR masks", function () {
42
- expect((0, _isInRange.isInRange)("192.168.1.5", "192.168.1.0", 24)).toBe(true);
43
- expect((0, _isInRange.isInRange)("192.168.2.0", "192.168.1.0", 24)).toBe(false);
44
- expect((0, _isInRange.isInRange)("192.168.1.0", "192.168.1.0", 31)).toBe(true);
45
- expect((0, _isInRange.isInRange)("192.168.1.1", "192.168.1.0", 31)).toBe(true);
46
- expect((0, _isInRange.isInRange)("192.168.1.2", "192.168.1.0", 31)).toBe(false);
47
- expect((0, _isInRange.isInRange)("192.168.1.3", "192.168.1.0", 30)).toBe(true);
48
- expect((0, _isInRange.isInRange)("192.168.1.4", "192.168.1.4", 30)).toBe(true);
49
- });
50
- });
51
- describe("invalid inputs", function () {
52
- test.each([[undefined, "192.168.1.0", 24, "Remote IP address is required"], ["192.168.1.1", undefined, 24, "Network IP address is required"], ["", "192.168.1.0", 24, "Remote IP address is required"], ["192.168.1.1", "", 24, "Network IP address is required"], ["192.168.1.1", "192.168.1.0", undefined, "CIDR must be an integer between 0 and 32"], ["192.168.1.1", "192.168.1.0", -1, "CIDR must be an integer between 0 and 32"], ["192.168.1.1", "192.168.1.0", 33, "CIDR must be an integer between 0 and 32"], ["192.168.1.1", "192.168.1.0", 1.5, "CIDR must be an integer between 0 and 32"]])("should throw error for remoteIp=%s, networkIp=%s, cidr=%s", function (remoteIp, networkIp, cidr, expectedError) {
53
- expect(function () {
54
- return (0, _isInRange.isInRange)(remoteIp, networkIp, cidr);
55
- }).toThrow(expectedError);
56
- });
57
- });
58
- describe("invalid IP formats", function () {
59
- test.each([["invalid", "192.168.1.0", 24], ["192.168.1.1", "invalid", 24], ["256.256.256.256", "192.168.1.0", 24], ["192.168.1.1", "256.256.256.256", 24], ["192.168.1.1.1", "192.168.1.0", 24], ["192.168.-1.1", "192.168.1.0", 24], ["192.168.1", "192.168.1.0", 24]])("should throw for invalid IP format: %s", function (remoteIp, networkIp, cidr) {
60
- expect(function () {
61
- return (0, _isInRange.isInRange)(remoteIp, networkIp, cidr);
62
- }).toThrow("Invalid IP address format");
63
- });
64
- });
65
- describe("error message formatting", function () {
66
- test("should format error messages correctly with String(error) for invalid IP", function () {
67
- expect(function () {
68
- return (0, _isInRange.isInRange)("invalid-ip", "192.168.1.0", 24);
69
- }).toThrow("Invalid IP address format: Error: Invalid IP address format");
70
- });
71
- test("should format error messages correctly for invalid network IP", function () {
72
- expect(function () {
73
- return (0, _isInRange.isInRange)("192.168.1.1", "invalid-network", 24);
74
- }).toThrow("Invalid IP address format: Error: Invalid IP address format");
75
- });
76
- test("should format error messages for out-of-range IP values", function () {
77
- expect(function () {
78
- return (0, _isInRange.isInRange)("999.999.999.999", "192.168.1.0", 24);
79
- }).toThrow("Invalid IP address format: Error: Invalid IP address format");
80
- });
81
- });
82
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- var _isPrivateIp = require("@/IP/isPrivateIp");
4
- describe("isPrivateIp", function () {
5
- describe("private IP addresses", function () {
6
- test.each([
7
- // [IP address, description]
8
- ["10.0.0.1", "Class A private - start range"], ["10.255.255.255", "Class A private - end range"], ["172.16.0.1", "Class B private - start range"], ["172.31.255.255", "Class B private - end range"], ["192.168.0.1", "Class C private - start range"], ["192.168.255.255", "Class C private - end range"]])("should identify %s as private IP (%s)", function (ip) {
9
- expect((0, _isPrivateIp.isPrivateIp)(ip)).toBe(true);
10
- });
11
- });
12
- describe("non-private IP addresses", function () {
13
- test.each([
14
- // [IP address, description]
15
- ["9.255.255.255", "Just before Class A private"], ["11.0.0.0", "Just after Class A private"], ["172.15.255.255", "Just before Class B private"], ["172.32.0.0", "Just after Class B private"], ["192.167.255.255", "Just before Class C private"], ["192.169.0.0", "Just after Class C private"], ["8.8.8.8", "Google DNS"], ["1.1.1.1", "Cloudflare DNS"], ["169.254.0.1", "Link-local address"], ["127.0.0.1", "Localhost"]])("should identify %s as non-private IP (%s)", function (ip) {
16
- expect((0, _isPrivateIp.isPrivateIp)(ip)).toBe(false);
17
- });
18
- });
19
- describe("invalid inputs", function () {
20
- test.each([[undefined, "IP address is required"], ["", "IP address is required"], ["256.256.256.256", "Invalid IP address"], ["192.168", "Invalid IP address"], ["a.b.c.d", "Invalid IP address"], ["192.168.1.1.1", "Invalid IP address"], ["-1.0.0.0", "Invalid IP address"]])("should throw error for %s: %s", function (ip, expectedError) {
21
- expect(function () {
22
- return (0, _isPrivateIp.isPrivateIp)(ip);
23
- }).toThrow(expectedError);
24
- });
25
- });
26
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,39 +0,0 @@
1
- "use strict";
2
-
3
- var _longToIp = require("@/IP/longToIp");
4
- describe("longToIp", function () {
5
- describe("valid 32-bit integers", function () {
6
- test.each([
7
- // [long value, expected IP]
8
- [0xc0a80001, "192.168.0.1"],
9
- // Common private network
10
- [0x80000001, "128.0.0.1"],
11
- // Class B start
12
- [0x0a000001, "10.0.0.1"],
13
- // Class A private
14
- [0xac100001, "172.16.0.1"],
15
- // Class B private
16
- [0xffffffff, "255.255.255.255"],
17
- // Maximum value
18
- [0x00000000, "0.0.0.0"],
19
- // Minimum value
20
- [0x7f000001, "127.0.0.1"],
21
- // Localhost
22
- [0x01020304, "1.2.3.4"] // Simple incremental
23
- ])("should convert %i to %s", function (_long, expected) {
24
- expect((0, _longToIp.longToIp)(_long)).toBe(expected);
25
- });
26
- });
27
- describe("invalid inputs", function () {
28
- test.each([[undefined, "Input must be a valid 32-bit unsigned integer"], [null, "Input must be a valid 32-bit unsigned integer"], [Number.NaN, "Input must be a valid 32-bit unsigned integer"], [Number.POSITIVE_INFINITY, "Input must be a valid 32-bit unsigned integer"], [-1, "Input must be a valid 32-bit unsigned integer"], [0x100000000, "Input must be a valid 32-bit unsigned integer"],
29
- // Too large
30
- [1.5, "Input must be a valid 32-bit unsigned integer"],
31
- // Not an integer
32
- ["123", "Input must be a valid 32-bit unsigned integer"] // Wrong type
33
- ])("should throw error for %p: %s", function (input, expectedError) {
34
- expect(function () {
35
- return (0, _longToIp.longToIp)(input);
36
- }).toThrow(expectedError);
37
- });
38
- });
39
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,41 +0,0 @@
1
- "use strict";
2
-
3
- var _subnetMaskToCidr = require("@/IP/subnetMaskToCidr");
4
- describe("subnetMaskToCidr", function () {
5
- describe("valid subnet masks", function () {
6
- test.each([
7
- // [subnet mask, expected CIDR]
8
- ["255.255.255.255", 32],
9
- // All bits set
10
- ["255.255.255.0", 24],
11
- // Common /24 network
12
- ["255.255.0.0", 16],
13
- // Common /16 network
14
- ["255.0.0.0", 8],
15
- // Common /8 network
16
- ["255.255.254.0", 23],
17
- // Less common /23 network
18
- ["255.255.255.252", 30],
19
- // Small /30 network
20
- ["255.255.255.248", 29],
21
- // Small /29 network
22
- ["255.255.240.0", 20],
23
- // Medium /20 network
24
- ["0.0.0.0", 0] // No bits set
25
- ])("should convert %s to /%i", function (mask, expected) {
26
- expect((0, _subnetMaskToCidr.subnetMaskToCidr)(mask)).toBe(expected);
27
- });
28
- });
29
- describe("invalid subnet masks", function () {
30
- test.each([[undefined, "Subnet mask is required"], ["", "Subnet mask is required"], ["192.168", "Invalid subnet mask format"], ["256.255.255.0", "Invalid subnet mask format"], ["255.255.255.256", "Invalid subnet mask format"], ["255.-1.255.0", "Invalid subnet mask format"], ["255.255.255.abc", "Invalid subnet mask format"], ["a.b.c.d", "Invalid subnet mask format"], ["255.255.255.1", "Invalid subnet mask: must be consecutive 1s followed by 0s"],
31
- // Non-continuous mask
32
- ["255.0.255.0", "Invalid subnet mask: must be consecutive 1s followed by 0s"],
33
- // Non-continuous mask
34
- ["254.255.255.0", "Invalid subnet mask: must be consecutive 1s followed by 0s"] // Invalid bit pattern
35
- ])("should throw error for %s: %s", function (mask, expectedError) {
36
- expect(function () {
37
- return (0, _subnetMaskToCidr.subnetMaskToCidr)(mask);
38
- }).toThrow(expectedError);
39
- });
40
- });
41
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,79 +0,0 @@
1
- "use strict";
2
-
3
- var _addition = require("@/Math/addition");
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("addition", function () {
11
- var testCases = [{
12
- args: [2, 3],
13
- expected: 5
14
- }, {
15
- args: [-2, -3],
16
- expected: -5
17
- }, {
18
- args: [2, -3],
19
- expected: -1
20
- }, {
21
- args: [0.1, 0.2],
22
- expected: 0.3,
23
- closeTo: true
24
- }, {
25
- args: [-0.1, -0.2],
26
- expected: -0.3,
27
- closeTo: true
28
- }, {
29
- args: [0.1, -0.2],
30
- expected: -0.1,
31
- closeTo: true
32
- }, {
33
- args: [2, 0.3],
34
- expected: 2.3,
35
- closeTo: true
36
- }, {
37
- args: [-2, -0.3],
38
- expected: -2.3,
39
- closeTo: true
40
- }, {
41
- args: [2, -0.3],
42
- expected: 1.7,
43
- closeTo: true
44
- }, {
45
- args: [-2, 0.3],
46
- expected: -1.7,
47
- closeTo: true
48
- }, {
49
- args: [1, 2, 3],
50
- expected: 6
51
- }, {
52
- args: [-1, -2, -3],
53
- expected: -6
54
- }, {
55
- args: [0.1, 0.2, 0.3],
56
- expected: 0.6,
57
- closeTo: true
58
- }, {
59
- args: [2, -3, 1],
60
- expected: 0
61
- }, {
62
- args: [-2, 0.5, 1.5],
63
- expected: 0,
64
- closeTo: true
65
- }];
66
- testCases.forEach(function (_ref) {
67
- var args = _ref.args,
68
- expected = _ref.expected,
69
- closeTo = _ref.closeTo;
70
- it("should add ".concat(args.length, " numbers: ").concat(args.join(", ")), function () {
71
- var result = _addition.addition.apply(void 0, _toConsumableArray(args));
72
- if (closeTo) {
73
- expect(result).toBeCloseTo(expected);
74
- } else {
75
- expect(result).toBe(expected);
76
- }
77
- });
78
- });
79
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- var _average = require("@/Math/average");
4
- describe("average function", function () {
5
- describe("basic scenarios", function () {
6
- it("should calculate average of integer numbers", function () {
7
- expect((0, _average.average)([1, 2])).toBe(1.5);
8
- expect((0, _average.average)([1, 2, 3, 4, 5])).toBe(3);
9
- });
10
- it("should calculate average of decimal numbers", function () {
11
- expect((0, _average.average)([1.1, 2.2])).toBeCloseTo(1.65);
12
- expect((0, _average.average)([1.1, 2.2, 3.3, 4.4, 5.5])).toBeCloseTo(3.3);
13
- });
14
- it("should handle single element arrays", function () {
15
- expect((0, _average.average)([5])).toBe(5);
16
- expect((0, _average.average)([3.14])).toBe(3.14);
17
- });
18
- });
19
- describe("special cases", function () {
20
- it("should handle arrays with zeros", function () {
21
- expect((0, _average.average)([0, 0, 0])).toBe(0);
22
- expect((0, _average.average)([1, 0, 2, 0, 3])).toBe(1.2);
23
- });
24
- it("should handle negative numbers", function () {
25
- expect((0, _average.average)([-1, -2])).toBe(-1.5);
26
- expect((0, _average.average)([-10, -20, -30])).toBe(-20);
27
- });
28
- it("should handle mixed positive and negative numbers", function () {
29
- expect((0, _average.average)([-1, 1])).toBe(0);
30
- expect((0, _average.average)([-10, 10, -5, 5])).toBe(0);
31
- });
32
- it("should return 0 for empty arrays", function () {
33
- expect((0, _average.average)([])).toBe(0);
34
- });
35
- });
36
- describe("edge cases", function () {
37
- it("should handle large numbers", function () {
38
- expect((0, _average.average)([Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER])).toBe(Number.MAX_SAFE_INTEGER);
39
- });
40
- it("should handle small numbers", function () {
41
- expect((0, _average.average)([Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER])).toBe(Number.MIN_SAFE_INTEGER);
42
- });
43
- it("should handle large arrays", function () {
44
- var largeArray = new Array(10000).fill(1);
45
- expect((0, _average.average)(largeArray)).toBe(1);
46
- });
47
- });
48
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,62 +0,0 @@
1
- "use strict";
2
-
3
- var _bitwise = require("@/Math/bitwise");
4
- describe("bitwise", function () {
5
- it("should rotate 8 bits to the left", function () {
6
- var result = (0, _bitwise.bitwise)(0x12345678, 8);
7
- expect(result.toString(16)).toBe("34567812");
8
- });
9
- it("should rotate 16 bits to the left", function () {
10
- var result = (0, _bitwise.bitwise)(0x12345678, 16);
11
- expect(result.toString(16)).toBe("56781234");
12
- });
13
- it("should rotate 24 bits to the left", function () {
14
- var result = (0, _bitwise.bitwise)(0x12345678, 24);
15
- expect(result.toString(16)).toBe("78123456");
16
- });
17
- it("should rotate 32 bits to the left (same as original value)", function () {
18
- var result = (0, _bitwise.bitwise)(0x12345678, 32);
19
- expect(result.toString(16)).toBe("12345678");
20
- });
21
- it("should rotate 0 bits to the left (same as original value)", function () {
22
- var result = (0, _bitwise.bitwise)(0x12345678, 0);
23
- expect(result.toString(16)).toBe("12345678");
24
- });
25
- it("should handle negative bit count (same as right rotation)", function () {
26
- var result = (0, _bitwise.bitwise)(0x12345678, -8);
27
- expect(result.toString(16)).toBe("78123456");
28
- });
29
- it("should handle bit count over 32 (rotate by remainder when divided by 32)", function () {
30
- var result = (0, _bitwise.bitwise)(0x12345678, 40); // 40 % 32 = 8
31
- expect(result.toString(16)).toBe("34567812");
32
- });
33
- it("should rotate 8 bits to the right", function () {
34
- var result = (0, _bitwise.bitwise)(0x12345678, 8, "right");
35
- expect(result.toString(16)).toBe("78123456");
36
- });
37
- it("should rotate 16 bits to the right", function () {
38
- var result = (0, _bitwise.bitwise)(0x12345678, 16, "right");
39
- expect(result.toString(16)).toBe("56781234");
40
- });
41
- it("should rotate 24 bits to the right", function () {
42
- var result = (0, _bitwise.bitwise)(0x12345678, 24, "right");
43
- expect(result.toString(16)).toBe("34567812");
44
- });
45
- it("should rotate 32 bits to the right (same as original value)", function () {
46
- var result = (0, _bitwise.bitwise)(0x12345678, 32, "right");
47
- expect(result.toString(16)).toBe("12345678");
48
- });
49
- it("should rotate 0 bits to the right (same as original value)", function () {
50
- var result = (0, _bitwise.bitwise)(0x12345678, 0, "right");
51
- expect(result.toString(16)).toBe("12345678");
52
- });
53
- it("should handle bit count over 32 (rotate by remainder when divided by 32)", function () {
54
- var result = (0, _bitwise.bitwise)(0x12345678, 40, "right"); // 40 % 32 = 8
55
- expect(result.toString(16)).toBe("78123456");
56
- });
57
- it("should throw error for invalid direction", function () {
58
- expect(function () {
59
- return (0, _bitwise.bitwise)(0x12345678, 8, "invalid");
60
- }).toThrowError("Invalid direction");
61
- });
62
- });
@@ -1,76 +0,0 @@
1
- "use strict";
2
-
3
- var _calculator = require("@/Math/calculator");
4
- describe("calculator function", function () {
5
- // Addition
6
- test("should handle addition", function () {
7
- expect((0, _calculator.calculator)("1+")).toBe("1+");
8
- expect((0, _calculator.calculator)("1+1")).toBe("2");
9
- expect((0, _calculator.calculator)("1+1+1")).toBe("3");
10
- expect((0, _calculator.calculator)("1+1+1+1")).toBe("4");
11
- expect((0, _calculator.calculator)("1+1+1+1+1")).toBe("5");
12
- });
13
-
14
- // Subtraction
15
- test("should handle subtraction", function () {
16
- expect((0, _calculator.calculator)("1-")).toBe("1-");
17
- expect((0, _calculator.calculator)("1-1")).toBe("0");
18
- expect((0, _calculator.calculator)("1-1-1")).toBe("-1");
19
- expect((0, _calculator.calculator)("1-1-1-1")).toBe("-2");
20
- expect((0, _calculator.calculator)("1-1-1-1-1")).toBe("-3");
21
- });
22
-
23
- // Multiplication
24
- test("should handle multiplication", function () {
25
- expect((0, _calculator.calculator)("2*")).toBe("2*");
26
- expect((0, _calculator.calculator)("2*2")).toBe("4");
27
- expect((0, _calculator.calculator)("2*2*2")).toBe("8");
28
- expect((0, _calculator.calculator)("2*2*2*2")).toBe("16");
29
- expect((0, _calculator.calculator)("2*2*2*2*2")).toBe("32");
30
- });
31
-
32
- // Division
33
- test("should handle division", function () {
34
- expect((0, _calculator.calculator)("2/")).toBe("2/");
35
- expect((0, _calculator.calculator)("2/2")).toBe("1");
36
- expect((0, _calculator.calculator)("2/2/2")).toBe("0.5");
37
- expect((0, _calculator.calculator)("2/2/2/2")).toBe("0.25");
38
- expect((0, _calculator.calculator)("2/2/2/2/2")).toBe("0.125");
39
- });
40
-
41
- // Exponentiation
42
- test("should handle exponentiation", function () {
43
- expect((0, _calculator.calculator)("2^")).toBe("2^");
44
- expect((0, _calculator.calculator)("2^2")).toBe("4");
45
- expect((0, _calculator.calculator)("2^2^2")).toBe("16");
46
- expect((0, _calculator.calculator)("2^2^2^2")).toBe("65536");
47
- expect((0, _calculator.calculator)("2^2^2^2^2")).toBe("Infinity");
48
- expect((0, _calculator.calculator)("3^4")).toBe("81");
49
- expect((0, _calculator.calculator)("3^4^2")).toBe("43046721");
50
- });
51
-
52
- // Parentheses
53
- test("should handle parentheses", function () {
54
- expect((0, _calculator.calculator)("(1+1)")).toBe("2");
55
- expect((0, _calculator.calculator)("(1")).toBe("(1");
56
- expect((0, _calculator.calculator)("(1+")).toBe("(1+");
57
- expect((0, _calculator.calculator)("1)")).toBe("1)");
58
- expect((0, _calculator.calculator)("(1)")).toBe("(1)");
59
- expect((0, _calculator.calculator)("(1+1)+(1+1)")).toBe("4");
60
- });
61
-
62
- // Equations
63
- test("should handle equations", function () {
64
- expect((0, _calculator.calculator)("2x=(1+1)+(1+1)+(1+1)")).toBe("3");
65
- });
66
-
67
- // Variables and currency conversion
68
- test("should handle variables", function () {
69
- expect((0, _calculator.calculator)("$10*2", {
70
- $: 100
71
- })).toBe("2000");
72
- expect((0, _calculator.calculator)("2*$10", {
73
- $: 100
74
- })).toBe("2000");
75
- });
76
- });
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- var _calculatorInitialization = require("@/Math/calculator/calculatorInitialization");
4
- describe("calculatorInitialization function", function () {
5
- it("should initialize a calculator with exchange rates", function () {
6
- var calculator = (0, _calculatorInitialization.calculatorInitialization)({
7
- $: 100
8
- });
9
- expect(calculator("$1")).toBe("100");
10
- expect(calculator("100 + $1")).toBe("200");
11
- });
12
- it("should handle multiple exchange rates", function () {
13
- var calculator = (0, _calculatorInitialization.calculatorInitialization)({
14
- $: 100,
15
- EUR: 120
16
- });
17
- expect(calculator("$1")).toBe("100");
18
- expect(calculator("EUR1")).toBe("120");
19
- expect(calculator("$1 + EUR1")).toBe("220");
20
- });
21
- });
@@ -1,40 +0,0 @@
1
- "use strict";
2
-
3
- var _convertCurrency = require("@/Math/calculator/convertCurrency");
4
- /**
5
- * Tests for the convertCurrency function
6
- */
7
- describe("convertCurrency function", function () {
8
- // Case 1: No conversion rates provided
9
- test("should return original string when conversionRates is undefined", function () {
10
- expect((0, _convertCurrency.convertCurrency)("¥1000")).toBe("¥1000");
11
- });
12
-
13
- // Case 2: Currency symbol doesn't match
14
- test("should return original string when currency symbol doesn't match", function () {
15
- expect((0, _convertCurrency.convertCurrency)("¥1000", {
16
- $: 1.1
17
- })).toBe("¥1000");
18
- });
19
-
20
- // Case 3: Currency symbol matches and conversion rate is a number
21
- test("should convert currency when symbol matches and rate is a number", function () {
22
- expect((0, _convertCurrency.convertCurrency)("¥1000", {
23
- "¥": 1.1
24
- })).toBe("1100");
25
- });
26
-
27
- // Case 4: Currency symbol matches but conversion rate is not a number
28
- test("should return original string when rate is not a number", function () {
29
- expect((0, _convertCurrency.convertCurrency)("¥1000", {
30
- "¥": "invalid"
31
- })).toBe("¥1000");
32
- });
33
-
34
- // Case 5: Conversion result is NaN
35
- test("should return original string when conversion result is NaN", function () {
36
- expect((0, _convertCurrency.convertCurrency)("¥NaN", {
37
- "¥": 1.1
38
- })).toBe("¥NaN");
39
- });
40
- });
@@ -1,51 +0,0 @@
1
- "use strict";
2
-
3
- var _literalExpression = require("@/Math/calculator/literalExpression");
4
- describe("literalExpression function", function () {
5
- // Basic equations with variable on left side
6
- test("should handle basic equations", function () {
7
- expect((0, _literalExpression.literalExpression)("x=1")).toBe("1");
8
- expect((0, _literalExpression.literalExpression)("x=0")).toBe("0");
9
- expect((0, _literalExpression.literalExpression)("x=-1")).toBe("-1");
10
- });
11
-
12
- // Basic equations with variable on right side
13
- test("should handle basic equations (right side)", function () {
14
- expect((0, _literalExpression.literalExpression)("1=x")).toBe("1");
15
- expect((0, _literalExpression.literalExpression)("0=x")).toBe("0");
16
- expect((0, _literalExpression.literalExpression)("-1=x")).toBe("-1");
17
- });
18
-
19
- // Equations with coefficients and additional terms (variable on left)
20
- test("should handle equations with mixed numerical and variable parts", function () {
21
- expect((0, _literalExpression.literalExpression)("2x=4")).toBe("2");
22
- expect((0, _literalExpression.literalExpression)("1x=1")).toBe("1");
23
- expect((0, _literalExpression.literalExpression)("3x=-6")).toBe("-2");
24
- expect((0, _literalExpression.literalExpression)("2x+2=4")).toBe("1");
25
- expect((0, _literalExpression.literalExpression)("3x-2=-6")).toBe("-4/3");
26
- });
27
-
28
- // Equations with coefficients and additional terms (variable on right)
29
- test("should handle equations with mixed numerical and variable parts (right side)", function () {
30
- expect((0, _literalExpression.literalExpression)("4=2x")).toBe("2");
31
- expect((0, _literalExpression.literalExpression)("1=1x")).toBe("1");
32
- expect((0, _literalExpression.literalExpression)("-6=3x")).toBe("-2");
33
- expect((0, _literalExpression.literalExpression)("4=2x+2")).toBe("1");
34
- expect((0, _literalExpression.literalExpression)("-6=3x-2")).toBe("-4/3");
35
- });
36
-
37
- // Simplification using greatest common divisor (variable on left)
38
- test("should simplify when gcd is greater than 1", function () {
39
- expect((0, _literalExpression.literalExpression)("2x=8")).toBe("4");
40
- });
41
-
42
- // Simplification using greatest common divisor (variable on right)
43
- test("should simplify when gcd is greater than 1 (right side)", function () {
44
- expect((0, _literalExpression.literalExpression)("8=2x")).toBe("4");
45
- });
46
-
47
- // Invalid equations
48
- test("should handle invalid equations", function () {
49
- expect((0, _literalExpression.literalExpression)("x=x")).toBe("");
50
- });
51
- });
@@ -1 +0,0 @@
1
- export {};