umt 2.5.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (368) hide show
  1. package/README.md +36 -0
  2. package/module/Array/generateNumberArray.js +13 -7
  3. package/module/Array/generateNumberArray.js.map +1 -1
  4. package/module/Array/getArraysCommon.js +21 -3
  5. package/module/Array/getArraysCommon.js.map +1 -1
  6. package/module/Array/groupBy.js +1 -1
  7. package/module/Array/groupBy.js.map +1 -1
  8. package/module/Array/index.d.ts +2 -0
  9. package/module/Array/index.js +2 -0
  10. package/module/Array/index.js.map +1 -1
  11. package/module/Array/ultraNumberSort.js +2 -2
  12. package/module/Array/ultraNumberSort.js.map +1 -1
  13. package/module/Array/uniqBy.d.ts +7 -0
  14. package/module/Array/uniqBy.js +19 -0
  15. package/module/Array/uniqBy.js.map +1 -0
  16. package/module/Array/unique.d.ts +6 -0
  17. package/module/Array/unique.js +9 -0
  18. package/module/Array/unique.js.map +1 -0
  19. package/module/Color/rgbaToHsla.js +1 -1
  20. package/module/Color/rgbaToHsla.js.map +1 -1
  21. package/module/Crypto/decodeBase32.d.ts +7 -0
  22. package/module/Crypto/decodeBase32.js +27 -0
  23. package/module/Crypto/decodeBase32.js.map +1 -0
  24. package/module/Crypto/decodeBase32ToString.d.ts +7 -0
  25. package/module/Crypto/decodeBase32ToString.js +11 -0
  26. package/module/Crypto/decodeBase32ToString.js.map +1 -0
  27. package/module/Crypto/decodeBase58.d.ts +7 -0
  28. package/module/Crypto/decodeBase58.js +34 -0
  29. package/module/Crypto/decodeBase58.js.map +1 -0
  30. package/module/Crypto/decodeBase58ToString.d.ts +7 -0
  31. package/module/Crypto/decodeBase58ToString.js +11 -0
  32. package/module/Crypto/decodeBase58ToString.js.map +1 -0
  33. package/module/Crypto/encodeBase32.d.ts +7 -0
  34. package/module/Crypto/encodeBase32.js +28 -0
  35. package/module/Crypto/encodeBase32.js.map +1 -0
  36. package/module/Crypto/encodeBase58.d.ts +7 -0
  37. package/module/Crypto/encodeBase58.js +29 -0
  38. package/module/Crypto/encodeBase58.js.map +1 -0
  39. package/module/Crypto/index.d.ts +6 -0
  40. package/module/Crypto/index.js +7 -0
  41. package/module/Crypto/index.js.map +1 -0
  42. package/module/DataStructure/index.d.ts +1 -0
  43. package/module/DataStructure/index.js +2 -0
  44. package/module/DataStructure/index.js.map +1 -0
  45. package/module/DataStructure/priorityQueue.d.ts +241 -0
  46. package/module/DataStructure/priorityQueue.js +327 -0
  47. package/module/DataStructure/priorityQueue.js.map +1 -0
  48. package/module/Date/birthday.js +14 -6
  49. package/module/Date/birthday.js.map +1 -1
  50. package/module/Date/isLeapYear.js +3 -0
  51. package/module/Date/isLeapYear.js.map +1 -1
  52. package/module/Error/index.d.ts +1 -0
  53. package/module/Error/index.js +1 -0
  54. package/module/Error/index.js.map +1 -1
  55. package/module/Error/retry.d.ts +37 -0
  56. package/module/Error/retry.js +47 -0
  57. package/module/Error/retry.js.map +1 -0
  58. package/module/IP/getIpClass.js +1 -1
  59. package/module/IP/getIpClass.js.map +1 -1
  60. package/module/IP/getNetworkAddress.js +2 -2
  61. package/module/IP/getNetworkAddress.js.map +1 -1
  62. package/module/IP/ipToBinaryString.js +2 -2
  63. package/module/IP/ipToBinaryString.js.map +1 -1
  64. package/module/IP/subnetMaskToCidr.js +1 -1
  65. package/module/IP/subnetMaskToCidr.js.map +1 -1
  66. package/module/Math/calculator/core.js +21 -13
  67. package/module/Math/calculator/core.js.map +1 -1
  68. package/module/Math/calculator/literalExpression.js +19 -7
  69. package/module/Math/calculator/literalExpression.js.map +1 -1
  70. package/module/Math/correlationCoefficient.d.ts +11 -0
  71. package/module/Math/correlationCoefficient.js +40 -0
  72. package/module/Math/correlationCoefficient.js.map +1 -0
  73. package/module/Math/division.js +3 -3
  74. package/module/Math/division.js.map +1 -1
  75. package/module/Math/gcd.js +26 -4
  76. package/module/Math/gcd.js.map +1 -1
  77. package/module/Math/index.d.ts +3 -0
  78. package/module/Math/index.js +3 -0
  79. package/module/Math/index.js.map +1 -1
  80. package/module/Math/mode.d.ts +10 -0
  81. package/module/Math/mode.js +31 -0
  82. package/module/Math/mode.js.map +1 -0
  83. package/module/Math/percentile.d.ts +11 -0
  84. package/module/Math/percentile.js +31 -0
  85. package/module/Math/percentile.js.map +1 -0
  86. package/module/Math/standardDeviation.js +4 -2
  87. package/module/Math/standardDeviation.js.map +1 -1
  88. package/module/Object/has.js +1 -2
  89. package/module/Object/has.js.map +1 -1
  90. package/module/Object/index.d.ts +4 -0
  91. package/module/Object/index.js +4 -0
  92. package/module/Object/index.js.map +1 -1
  93. package/module/Object/isEmpty.d.ts +6 -0
  94. package/module/Object/isEmpty.js +20 -0
  95. package/module/Object/isEmpty.js.map +1 -0
  96. package/module/Object/merge.d.ts +8 -0
  97. package/module/Object/merge.js +10 -0
  98. package/module/Object/merge.js.map +1 -0
  99. package/module/Object/mergeDeep.d.ts +8 -0
  100. package/module/Object/mergeDeep.js +37 -0
  101. package/module/Object/mergeDeep.js.map +1 -0
  102. package/module/Object/omit.d.ts +7 -0
  103. package/module/Object/omit.js +14 -0
  104. package/module/Object/omit.js.map +1 -0
  105. package/module/Object/pickDeep.d.ts +2 -2
  106. package/module/Object/pickDeep.js +4 -4
  107. package/module/Object/pickDeep.js.map +1 -1
  108. package/module/Simple/Date/dayOfWeekSimple.js +3 -3
  109. package/module/Simple/Date/dayOfWeekSimple.js.map +1 -1
  110. package/module/String/camelCase.d.ts +6 -0
  111. package/module/String/camelCase.js +12 -0
  112. package/module/String/camelCase.js.map +1 -0
  113. package/module/String/escapeHtml.d.ts +6 -0
  114. package/module/String/escapeHtml.js +19 -0
  115. package/module/String/escapeHtml.js.map +1 -0
  116. package/module/String/formatString/applyFormatter.d.ts +25 -0
  117. package/module/String/formatString/applyFormatter.js +71 -0
  118. package/module/String/formatString/applyFormatter.js.map +1 -0
  119. package/module/String/formatString/defaultFormatters.d.ts +24 -0
  120. package/module/String/formatString/defaultFormatters.js +59 -0
  121. package/module/String/formatString/defaultFormatters.js.map +1 -0
  122. package/module/String/formatString/detectMode.d.ts +26 -0
  123. package/module/String/formatString/detectMode.js +61 -0
  124. package/module/String/formatString/detectMode.js.map +1 -0
  125. package/module/String/formatString/getValue.d.ts +27 -0
  126. package/module/String/formatString/getValue.js +56 -0
  127. package/module/String/formatString/getValue.js.map +1 -0
  128. package/module/String/formatString/index.d.ts +91 -0
  129. package/module/String/formatString/index.js +38 -0
  130. package/module/String/formatString/index.js.map +1 -0
  131. package/module/String/fuzzySearch.d.ts +14 -0
  132. package/module/String/fuzzySearch.js +27 -0
  133. package/module/String/fuzzySearch.js.map +1 -0
  134. package/module/String/index.d.ts +9 -0
  135. package/module/String/index.js +9 -0
  136. package/module/String/index.js.map +1 -1
  137. package/module/String/kebabCase.d.ts +6 -0
  138. package/module/String/kebabCase.js +22 -0
  139. package/module/String/kebabCase.js.map +1 -0
  140. package/module/String/levenshteinDistance.d.ts +8 -0
  141. package/module/String/levenshteinDistance.js +38 -0
  142. package/module/String/levenshteinDistance.js.map +1 -0
  143. package/module/String/slugify.d.ts +10 -0
  144. package/module/String/slugify.js +21 -0
  145. package/module/String/slugify.js.map +1 -0
  146. package/module/String/stringSimilarity.d.ts +8 -0
  147. package/module/String/stringSimilarity.js +23 -0
  148. package/module/String/stringSimilarity.js.map +1 -0
  149. package/module/String/truncate.d.ts +12 -0
  150. package/module/String/truncate.js +21 -0
  151. package/module/String/truncate.js.map +1 -0
  152. package/module/String/unescapeHtml.d.ts +17 -0
  153. package/module/String/unescapeHtml.js +45 -0
  154. package/module/String/unescapeHtml.js.map +1 -0
  155. package/module/Validate/core/index.js +0 -1
  156. package/module/Validate/core/index.js.map +1 -1
  157. package/module/Validate/index.d.ts +1 -0
  158. package/module/Validate/index.js +1 -0
  159. package/module/Validate/index.js.map +1 -1
  160. package/module/Validate/isDeepEqual.d.ts +28 -0
  161. package/module/Validate/isDeepEqual.js +148 -0
  162. package/module/Validate/isDeepEqual.js.map +1 -0
  163. package/module/Validate/isDouble.js +1 -1
  164. package/module/Validate/isDouble.js.map +1 -1
  165. package/module/Validate/isNode.js +1 -0
  166. package/module/Validate/isNode.js.map +1 -1
  167. package/module/Validate/isNumber.js +1 -1
  168. package/module/Validate/isNumber.js.map +1 -1
  169. package/module/Validate/isValueNaN.js +1 -1
  170. package/module/Validate/isValueNaN.js.map +1 -1
  171. package/module/Validate/number/even.js +7 -1
  172. package/module/Validate/number/even.js.map +1 -1
  173. package/module/Validate/number/odd.js +7 -1
  174. package/module/Validate/number/odd.js.map +1 -1
  175. package/module/Validate/string/email.js +20 -2
  176. package/module/Validate/string/email.js.map +1 -1
  177. package/module/es5/Array/generateNumberArray.js +15 -9
  178. package/module/es5/Array/getArraysCommon.js +39 -4
  179. package/module/es5/Array/groupBy.js +1 -1
  180. package/module/es5/Array/index.d.ts +2 -0
  181. package/module/es5/Array/index.js +22 -0
  182. package/module/es5/Array/ultraNumberSort.js +2 -2
  183. package/module/es5/Array/uniqBy.d.ts +7 -0
  184. package/module/es5/Array/uniqBy.js +36 -0
  185. package/module/es5/Array/unique.d.ts +6 -0
  186. package/module/es5/Array/unique.js +20 -0
  187. package/module/es5/Color/rgbaToHsla.js +1 -1
  188. package/module/es5/Crypto/decodeBase32.d.ts +7 -0
  189. package/module/es5/Crypto/decodeBase32.js +44 -0
  190. package/module/es5/Crypto/decodeBase32ToString.d.ts +7 -0
  191. package/module/es5/Crypto/decodeBase32ToString.js +16 -0
  192. package/module/es5/Crypto/decodeBase58.d.ts +7 -0
  193. package/module/es5/Crypto/decodeBase58.js +63 -0
  194. package/module/es5/Crypto/decodeBase58ToString.d.ts +7 -0
  195. package/module/es5/Crypto/decodeBase58ToString.js +16 -0
  196. package/module/es5/Crypto/encodeBase32.d.ts +7 -0
  197. package/module/es5/Crypto/encodeBase32.js +45 -0
  198. package/module/es5/Crypto/encodeBase58.d.ts +7 -0
  199. package/module/es5/Crypto/encodeBase58.js +55 -0
  200. package/module/es5/Crypto/index.d.ts +6 -0
  201. package/module/es5/Crypto/index.js +71 -0
  202. package/module/es5/DataStructure/index.d.ts +1 -0
  203. package/module/es5/DataStructure/index.js +16 -0
  204. package/module/es5/DataStructure/priorityQueue.d.ts +241 -0
  205. package/module/es5/DataStructure/priorityQueue.js +405 -0
  206. package/module/es5/Date/birthday.js +17 -3
  207. package/module/es5/Date/isLeapYear.js +3 -0
  208. package/module/es5/Error/index.d.ts +1 -0
  209. package/module/es5/Error/index.js +11 -0
  210. package/module/es5/Error/retry.d.ts +37 -0
  211. package/module/es5/Error/retry.js +88 -0
  212. package/module/es5/IP/getIpClass.js +1 -1
  213. package/module/es5/IP/getNetworkAddress.js +2 -2
  214. package/module/es5/IP/ipToBinaryString.js +2 -2
  215. package/module/es5/IP/subnetMaskToCidr.js +1 -1
  216. package/module/es5/Math/calculator/core.js +17 -9
  217. package/module/es5/Math/calculator/literalExpression.js +19 -6
  218. package/module/es5/Math/correlationCoefficient.d.ts +11 -0
  219. package/module/es5/Math/correlationCoefficient.js +63 -0
  220. package/module/es5/Math/division.js +3 -3
  221. package/module/es5/Math/gcd.js +43 -5
  222. package/module/es5/Math/index.d.ts +3 -0
  223. package/module/es5/Math/index.js +33 -0
  224. package/module/es5/Math/mode.d.ts +10 -0
  225. package/module/es5/Math/mode.js +67 -0
  226. package/module/es5/Math/percentile.d.ts +11 -0
  227. package/module/es5/Math/percentile.js +42 -0
  228. package/module/es5/Math/standardDeviation.js +4 -2
  229. package/module/es5/Object/has.js +1 -1
  230. package/module/es5/Object/index.d.ts +4 -0
  231. package/module/es5/Object/index.js +44 -0
  232. package/module/es5/Object/isEmpty.d.ts +6 -0
  233. package/module/es5/Object/isEmpty.js +26 -0
  234. package/module/es5/Object/merge.d.ts +8 -0
  235. package/module/es5/Object/merge.js +18 -0
  236. package/module/es5/Object/mergeDeep.d.ts +8 -0
  237. package/module/es5/Object/mergeDeep.js +46 -0
  238. package/module/es5/Object/omit.d.ts +7 -0
  239. package/module/es5/Object/omit.js +29 -0
  240. package/module/es5/Object/pickDeep.d.ts +2 -2
  241. package/module/es5/Object/pickDeep.js +4 -4
  242. package/module/es5/Simple/Date/dayOfWeekSimple.js +3 -3
  243. package/module/es5/String/camelCase.d.ts +6 -0
  244. package/module/es5/String/camelCase.js +18 -0
  245. package/module/es5/String/escapeHtml.d.ts +6 -0
  246. package/module/es5/String/escapeHtml.js +27 -0
  247. package/module/es5/String/formatString/applyFormatter.d.ts +25 -0
  248. package/module/es5/String/formatString/applyFormatter.js +100 -0
  249. package/module/es5/String/formatString/defaultFormatters.d.ts +24 -0
  250. package/module/es5/String/formatString/defaultFormatters.js +79 -0
  251. package/module/es5/String/formatString/detectMode.d.ts +26 -0
  252. package/module/es5/String/formatString/detectMode.js +60 -0
  253. package/module/es5/String/formatString/getValue.d.ts +27 -0
  254. package/module/es5/String/formatString/getValue.js +85 -0
  255. package/module/es5/String/formatString/index.d.ts +91 -0
  256. package/module/es5/String/formatString/index.js +152 -0
  257. package/module/es5/String/fuzzySearch.d.ts +14 -0
  258. package/module/es5/String/fuzzySearch.js +50 -0
  259. package/module/es5/String/index.d.ts +9 -0
  260. package/module/es5/String/index.js +99 -0
  261. package/module/es5/String/kebabCase.d.ts +6 -0
  262. package/module/es5/String/kebabCase.js +26 -0
  263. package/module/es5/String/levenshteinDistance.d.ts +8 -0
  264. package/module/es5/String/levenshteinDistance.js +58 -0
  265. package/module/es5/String/slugify.d.ts +10 -0
  266. package/module/es5/String/slugify.js +18 -0
  267. package/module/es5/String/stringSimilarity.d.ts +8 -0
  268. package/module/es5/String/stringSimilarity.js +30 -0
  269. package/module/es5/String/truncate.d.ts +12 -0
  270. package/module/es5/String/truncate.js +27 -0
  271. package/module/es5/String/unescapeHtml.d.ts +17 -0
  272. package/module/es5/String/unescapeHtml.js +51 -0
  273. package/module/es5/Validate/core/index.js +0 -1
  274. package/module/es5/Validate/index.d.ts +1 -0
  275. package/module/es5/Validate/index.js +11 -0
  276. package/module/es5/Validate/isDeepEqual.d.ts +28 -0
  277. package/module/es5/Validate/isDeepEqual.js +232 -0
  278. package/module/es5/Validate/isDouble.js +1 -1
  279. package/module/es5/Validate/isNode.js +1 -0
  280. package/module/es5/Validate/isNumber.js +1 -1
  281. package/module/es5/Validate/isValueNaN.js +1 -1
  282. package/module/es5/Validate/number/even.js +4 -0
  283. package/module/es5/Validate/number/odd.js +4 -0
  284. package/module/es5/Validate/string/email.js +26 -1
  285. package/module/es5/index.d.ts +2 -0
  286. package/module/es5/index.js +22 -0
  287. package/module/es5/tsconfig.tsbuildinfo +1 -1
  288. package/module/es5/types/index.d.ts +1 -0
  289. package/module/es5/types/index.js +11 -0
  290. package/module/es5/types/logic/deepPartial.d.ts +37 -0
  291. package/module/es5/types/logic/deepPartial.js +5 -0
  292. package/module/es5/types/logic/deepRequired.d.ts +37 -0
  293. package/module/es5/types/logic/deepRequired.js +5 -0
  294. package/module/es5/types/logic/index.d.ts +3 -0
  295. package/module/es5/types/logic/index.js +33 -0
  296. package/module/es5/types/logic/unionToIntersection.d.ts +12 -0
  297. package/module/es5/types/logic/unionToIntersection.js +5 -0
  298. package/module/es5/types/object/index.d.ts +1 -0
  299. package/module/es5/types/object/index.js +11 -0
  300. package/module/es5/types/object/pickDeep.d.ts +13 -1
  301. package/module/es5/types/object/shallowObjectValue.d.ts +9 -0
  302. package/module/es5/types/object/shallowObjectValue.js +5 -0
  303. package/module/es5/types/string/formatString/formatData.d.ts +17 -0
  304. package/module/es5/types/string/formatString/formatData.js +5 -0
  305. package/module/es5/types/string/formatString/formatOptions.d.ts +21 -0
  306. package/module/es5/types/string/formatString/formatOptions.js +5 -0
  307. package/module/es5/types/string/formatString/formatString.d.ts +4 -0
  308. package/module/es5/types/string/formatString/formatString.js +49 -0
  309. package/module/es5/types/string/formatString/formatValue.d.ts +15 -0
  310. package/module/es5/types/string/formatString/formatValue.js +5 -0
  311. package/module/es5/types/string/formatString/formatter.d.ts +13 -0
  312. package/module/es5/types/string/formatString/formatter.js +5 -0
  313. package/module/es5/types/string/formatString/index.d.ts +5 -0
  314. package/module/es5/types/string/formatString/index.js +60 -0
  315. package/module/es5/types/string/index.d.ts +1 -0
  316. package/module/es5/types/string/index.js +16 -0
  317. package/module/index.d.ts +2 -0
  318. package/module/index.js +2 -0
  319. package/module/index.js.map +1 -1
  320. package/module/types/index.d.ts +1 -0
  321. package/module/types/index.js +1 -0
  322. package/module/types/index.js.map +1 -1
  323. package/module/types/logic/deepPartial.d.ts +37 -0
  324. package/module/types/logic/deepPartial.js +36 -0
  325. package/module/types/logic/deepPartial.js.map +1 -0
  326. package/module/types/logic/deepRequired.d.ts +37 -0
  327. package/module/types/logic/deepRequired.js +2 -0
  328. package/module/types/logic/deepRequired.js.map +1 -0
  329. package/module/types/logic/index.d.ts +3 -0
  330. package/module/types/logic/index.js +3 -0
  331. package/module/types/logic/index.js.map +1 -1
  332. package/module/types/logic/unionToIntersection.d.ts +12 -0
  333. package/module/types/logic/unionToIntersection.js +2 -0
  334. package/module/types/logic/unionToIntersection.js.map +1 -0
  335. package/module/types/object/index.d.ts +1 -0
  336. package/module/types/object/index.js +1 -0
  337. package/module/types/object/index.js.map +1 -1
  338. package/module/types/object/pickDeep.d.ts +13 -1
  339. package/module/types/object/shallowObjectValue.d.ts +9 -0
  340. package/module/types/object/shallowObjectValue.js +2 -0
  341. package/module/types/object/shallowObjectValue.js.map +1 -0
  342. package/module/types/string/formatString/formatData.d.ts +17 -0
  343. package/module/types/string/formatString/formatData.js +2 -0
  344. package/module/types/string/formatString/formatData.js.map +1 -0
  345. package/module/types/string/formatString/formatOptions.d.ts +21 -0
  346. package/module/types/string/formatString/formatOptions.js +2 -0
  347. package/module/types/string/formatString/formatOptions.js.map +1 -0
  348. package/module/types/string/formatString/formatString.d.ts +4 -0
  349. package/module/types/string/formatString/formatString.js +5 -0
  350. package/module/types/string/formatString/formatString.js.map +1 -0
  351. package/module/types/string/formatString/formatValue.d.ts +15 -0
  352. package/module/types/string/formatString/formatValue.js +2 -0
  353. package/module/types/string/formatString/formatValue.js.map +1 -0
  354. package/module/types/string/formatString/formatter.d.ts +13 -0
  355. package/module/types/string/formatString/formatter.js +2 -0
  356. package/module/types/string/formatString/formatter.js.map +1 -0
  357. package/module/types/string/formatString/index.d.ts +5 -0
  358. package/module/types/string/formatString/index.js +6 -0
  359. package/module/types/string/formatString/index.js.map +1 -0
  360. package/module/types/string/index.d.ts +1 -0
  361. package/module/types/string/index.js +2 -0
  362. package/module/types/string/index.js.map +1 -0
  363. package/package.json +40 -41
  364. package/module/String/formatString.d.ts +0 -13
  365. package/module/String/formatString.js +0 -18
  366. package/module/String/formatString.js.map +0 -1
  367. package/module/es5/String/formatString.d.ts +0 -13
  368. package/module/es5/String/formatString.js +0 -26
@@ -7,5 +7,6 @@ export * from "./joke";
7
7
  export * from "./logic";
8
8
  export * from "./math";
9
9
  export * from "./object";
10
+ export * from "./string";
10
11
  export * from "./time";
11
12
  export * from "./ua";
@@ -102,6 +102,17 @@ Object.keys(_object).forEach(function (key) {
102
102
  }
103
103
  });
104
104
  });
105
+ var _string = require("./string");
106
+ Object.keys(_string).forEach(function (key) {
107
+ if (key === "default" || key === "__esModule") return;
108
+ if (key in exports && exports[key] === _string[key]) return;
109
+ Object.defineProperty(exports, key, {
110
+ enumerable: true,
111
+ get: function get() {
112
+ return _string[key];
113
+ }
114
+ });
115
+ });
105
116
  var _time = require("./time");
106
117
  Object.keys(_time).forEach(function (key) {
107
118
  if (key === "default" || key === "__esModule") return;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Recursively makes all properties in T optional, including nested objects.
3
+ * Unlike TypeScript's built-in Partial<T> which only affects top-level properties,
4
+ * DeepPartial<T> applies the optional modifier to all levels of nested objects.
5
+ *
6
+ * @template T - The type to make deeply partial
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * interface User {
11
+ * id: number;
12
+ * profile: {
13
+ * name: string;
14
+ * address: {
15
+ * street: string;
16
+ * city: string;
17
+ * };
18
+ * };
19
+ * }
20
+ *
21
+ * type PartialUser = DeepPartial<User>;
22
+ * // Result:
23
+ * // {
24
+ * // id?: number;
25
+ * // profile?: {
26
+ * // name?: string;
27
+ * // address?: {
28
+ * // street?: string;
29
+ * // city?: string;
30
+ * // };
31
+ * // };
32
+ * // }
33
+ * ```
34
+ */
35
+ export type DeepPartial<T> = T extends Record<PropertyKey, any> ? {
36
+ [P in keyof T]?: DeepPartial<T[P]>;
37
+ } : T;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Recursively makes all properties in T required, including nested objects.
3
+ * Unlike TypeScript's built-in Required<T> which only affects top-level properties,
4
+ * DeepRequired<T> removes the optional modifier from all levels of nested objects.
5
+ *
6
+ * @template T - The type to make deeply required
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * interface User {
11
+ * id?: number;
12
+ * profile?: {
13
+ * name?: string;
14
+ * address?: {
15
+ * street?: string;
16
+ * city?: string;
17
+ * };
18
+ * };
19
+ * }
20
+ *
21
+ * type RequiredUser = DeepRequired<User>;
22
+ * // Result:
23
+ * // {
24
+ * // id: number;
25
+ * // profile: {
26
+ * // name: string;
27
+ * // address: {
28
+ * // street: string;
29
+ * // city: string;
30
+ * // };
31
+ * // };
32
+ * // }
33
+ * ```
34
+ */
35
+ export type DeepRequired<T> = T extends Record<PropertyKey, any> ? {
36
+ [P in keyof T]-?: DeepRequired<T[P]>;
37
+ } : T;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -27,6 +27,8 @@ export * from "./capitalize";
27
27
  export * from "./decimal1byteTobinary";
28
28
  export * from "./decimal4bitTobinary";
29
29
  export * from "./decimal4bitToHex";
30
+ export * from "./deepPartial";
31
+ export * from "./deepRequired";
30
32
  export * from "./equal";
31
33
  export * from "./first";
32
34
  export * from "./first8Chars";
@@ -53,6 +55,7 @@ export * from "./stringReverse";
53
55
  export * from "./stringToArray";
54
56
  export * from "./stringToUnion";
55
57
  export * from "./toNumber";
58
+ export * from "./unionToIntersection";
56
59
  export * from "./xnor";
57
60
  export * from "./xor";
58
61
  export * from "./zeroAorB";
@@ -322,6 +322,28 @@ Object.keys(_decimal4bitToHex).forEach(function (key) {
322
322
  }
323
323
  });
324
324
  });
325
+ var _deepPartial = require("./deepPartial");
326
+ Object.keys(_deepPartial).forEach(function (key) {
327
+ if (key === "default" || key === "__esModule") return;
328
+ if (key in exports && exports[key] === _deepPartial[key]) return;
329
+ Object.defineProperty(exports, key, {
330
+ enumerable: true,
331
+ get: function get() {
332
+ return _deepPartial[key];
333
+ }
334
+ });
335
+ });
336
+ var _deepRequired = require("./deepRequired");
337
+ Object.keys(_deepRequired).forEach(function (key) {
338
+ if (key === "default" || key === "__esModule") return;
339
+ if (key in exports && exports[key] === _deepRequired[key]) return;
340
+ Object.defineProperty(exports, key, {
341
+ enumerable: true,
342
+ get: function get() {
343
+ return _deepRequired[key];
344
+ }
345
+ });
346
+ });
325
347
  var _equal = require("./equal");
326
348
  Object.keys(_equal).forEach(function (key) {
327
349
  if (key === "default" || key === "__esModule") return;
@@ -608,6 +630,17 @@ Object.keys(_toNumber).forEach(function (key) {
608
630
  }
609
631
  });
610
632
  });
633
+ var _unionToIntersection = require("./unionToIntersection");
634
+ Object.keys(_unionToIntersection).forEach(function (key) {
635
+ if (key === "default" || key === "__esModule") return;
636
+ if (key in exports && exports[key] === _unionToIntersection[key]) return;
637
+ Object.defineProperty(exports, key, {
638
+ enumerable: true,
639
+ get: function get() {
640
+ return _unionToIntersection[key];
641
+ }
642
+ });
643
+ });
611
644
  var _xnor = require("./xnor");
612
645
  Object.keys(_xnor).forEach(function (key) {
613
646
  if (key === "default" || key === "__esModule") return;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Converts a union type to an intersection type
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * type A = { a: string }
7
+ * type B = { b: number }
8
+ * type Union = A | B
9
+ * type Intersection = UnionToIntersection<Union> // { a: string } & { b: number }
10
+ * ```
11
+ */
12
+ export type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,2 +1,3 @@
1
1
  export * from "./pickDeep";
2
2
  export * from "./pickDeepKey";
3
+ export * from "./shallowObjectValue";
@@ -24,4 +24,15 @@ Object.keys(_pickDeepKey).forEach(function (key) {
24
24
  return _pickDeepKey[key];
25
25
  }
26
26
  });
27
+ });
28
+ var _shallowObjectValue = require("./shallowObjectValue");
29
+ Object.keys(_shallowObjectValue).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _shallowObjectValue[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function get() {
35
+ return _shallowObjectValue[key];
36
+ }
37
+ });
27
38
  });
@@ -1 +1,13 @@
1
- export type PickDeep<T extends object> = keyof T extends infer K ? K extends keyof T ? T[K] extends object ? PickDeep<T[K]> : T[K] : never : never;
1
+ import type { PickDeepKey } from "./pickDeepKey";
2
+ import type { UnionToIntersection } from "$/logic/unionToIntersection";
3
+ type GetValueAtPath<T, P extends string> = P extends `${infer Key}.${infer Rest}` ? Key extends keyof T ? T[Key] extends object ? GetValueAtPath<T[Key], Rest> : never : never : P extends keyof T ? T[P] : never;
4
+ type ConstructNestedObject<P extends string, V> = P extends `${infer Key}.${infer Rest}` ? {
5
+ [K in Key]: ConstructNestedObject<Rest, V>;
6
+ } : {
7
+ [K in P]: V;
8
+ };
9
+ type ProcessKeys<T extends object, K extends readonly PickDeepKey<T>[]> = {
10
+ [I in keyof K]: K[I] extends string ? ConstructNestedObject<K[I], GetValueAtPath<T, K[I]>> : never;
11
+ }[number];
12
+ export type PickDeep<T extends object, K extends readonly PickDeepKey<T>[]> = UnionToIntersection<ProcessKeys<T, K>>;
13
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { UnionToIntersection } from "$/logic/unionToIntersection";
2
+ /**
3
+ * Extract the value type from the first level of an object
4
+ *
5
+ * @example
6
+ * type Input = { a: { b: { c: {} } } }
7
+ * type Output = ShallowObjectValue<Input> // { b: { c: {} } }
8
+ */
9
+ export type ShallowObjectValue<T> = T extends Record<PropertyKey, infer U> ? UnionToIntersection<U> : never;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,17 @@
1
+ import type { FormatValue } from "./formatValue";
2
+ /**
3
+ * Data structure for formatString input.
4
+ *
5
+ * Can be either an object for named placeholders or an array for indexed placeholders.
6
+ *
7
+ * @example
8
+ * // Object for named placeholders
9
+ * const namedData: FormatData = { name: "Alice", age: 25 };
10
+ * formatString("Hello {name}, age {age}", namedData);
11
+ *
12
+ * @example
13
+ * // Array for indexed placeholders
14
+ * const indexedData: FormatData = ["Alice", 25];
15
+ * formatString("Hello {0}, age {1}", ...indexedData);
16
+ */
17
+ export type FormatData = Record<string, unknown> | FormatValue[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,21 @@
1
+ import type { Formatter } from "./formatter";
2
+ /**
3
+ * Configuration options for formatString.
4
+ *
5
+ * @property formatters - Custom formatter functions to extend or override built-in formatters
6
+ * @property locale - Default locale for built-in formatters (currently unused but reserved)
7
+ *
8
+ * @example
9
+ * const options: FormatOptions = {
10
+ * formatters: {
11
+ * reverse: (value) => String(value).split('').reverse().join(''),
12
+ * shout: (value) => `${String(value).toUpperCase()}!`
13
+ * }
14
+ * };
15
+ * formatString("{text:reverse} {text:shout}", { text: "hello" }, options);
16
+ * // → "olleh HELLO!"
17
+ */
18
+ export interface FormatOptions {
19
+ formatters?: Record<string, Formatter>;
20
+ locale?: string;
21
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,4 @@
1
+ export * from "./formatData";
2
+ export * from "./formatOptions";
3
+ export * from "./formatter";
4
+ export * from "./formatValue";
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _formatData = require("./formatData");
7
+ Object.keys(_formatData).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _formatData[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _formatData[key];
14
+ }
15
+ });
16
+ });
17
+ var _formatOptions = require("./formatOptions");
18
+ Object.keys(_formatOptions).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _formatOptions[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function get() {
24
+ return _formatOptions[key];
25
+ }
26
+ });
27
+ });
28
+ var _formatter = require("./formatter");
29
+ Object.keys(_formatter).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _formatter[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function get() {
35
+ return _formatter[key];
36
+ }
37
+ });
38
+ });
39
+ var _formatValue = require("./formatValue");
40
+ Object.keys(_formatValue).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _formatValue[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function get() {
46
+ return _formatValue[key];
47
+ }
48
+ });
49
+ });
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Valid value types that can be passed to formatString.
3
+ *
4
+ * Includes primitives, objects, arrays, and null/undefined values.
5
+ * Objects and arrays are typically used in indexed mode as placeholder values.
6
+ *
7
+ * @example
8
+ * // Primitive values
9
+ * formatString("{0} {1}", "hello", 42) // string, number
10
+ *
11
+ * @example
12
+ * // Complex values
13
+ * formatString("{0} {1}", { key: "value" }, [1, 2, 3]) // object, array
14
+ */
15
+ export type FormatValue = string | number | boolean | Date | null | undefined | Record<string, unknown> | unknown[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Function type for formatString formatter functions.
3
+ *
4
+ * @param value - The value to be formatted
5
+ * @param arguments_ - Additional string arguments passed to the formatter
6
+ * @returns Formatted string representation of the value
7
+ *
8
+ * @example
9
+ * const upperFormatter: Formatter = (value) => String(value).toUpperCase();
10
+ * const padFormatter: Formatter = (value, length = "2", char = "0") =>
11
+ * String(value).padStart(Number(length), char);
12
+ */
13
+ export type Formatter = (value: unknown, ...arguments_: string[]) => string;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,5 @@
1
+ export * from "./formatData";
2
+ export * from "./formatValue";
3
+ export * from "./formatter";
4
+ export * from "./formatString";
5
+ export * from "./formatOptions";
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _formatData = require("./formatData");
7
+ Object.keys(_formatData).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _formatData[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _formatData[key];
14
+ }
15
+ });
16
+ });
17
+ var _formatValue = require("./formatValue");
18
+ Object.keys(_formatValue).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _formatValue[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function get() {
24
+ return _formatValue[key];
25
+ }
26
+ });
27
+ });
28
+ var _formatter = require("./formatter");
29
+ Object.keys(_formatter).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _formatter[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function get() {
35
+ return _formatter[key];
36
+ }
37
+ });
38
+ });
39
+ var _formatString = require("./formatString");
40
+ Object.keys(_formatString).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _formatString[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function get() {
46
+ return _formatString[key];
47
+ }
48
+ });
49
+ });
50
+ var _formatOptions = require("./formatOptions");
51
+ Object.keys(_formatOptions).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _formatOptions[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function get() {
57
+ return _formatOptions[key];
58
+ }
59
+ });
60
+ });
@@ -0,0 +1 @@
1
+ export * from "./formatString";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _formatString = require("./formatString");
7
+ Object.keys(_formatString).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _formatString[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _formatString[key];
14
+ }
15
+ });
16
+ });
package/module/index.d.ts CHANGED
@@ -2,6 +2,8 @@ export * from "./Advance";
2
2
  export * from "./Array";
3
3
  export * from "./Color";
4
4
  export * from "./Consts";
5
+ export * from "./Crypto";
6
+ export * from "./DataStructure";
5
7
  export * from "./Date";
6
8
  export * from "./Error";
7
9
  export * from "./Function";
package/module/index.js CHANGED
@@ -2,6 +2,8 @@ export * from "./Advance";
2
2
  export * from "./Array";
3
3
  export * from "./Color";
4
4
  export * from "./Consts";
5
+ export * from "./Crypto";
6
+ export * from "./DataStructure";
5
7
  export * from "./Date";
6
8
  export * from "./Error";
7
9
  export * from "./Function";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,MAAM,CAAC;AACrB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC;AACrB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,MAAM,CAAC;AACrB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC;AACrB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC"}
@@ -7,5 +7,6 @@ export * from "./joke";
7
7
  export * from "./logic";
8
8
  export * from "./math";
9
9
  export * from "./object";
10
+ export * from "./string";
10
11
  export * from "./time";
11
12
  export * from "./ua";
@@ -7,6 +7,7 @@ export * from "./joke";
7
7
  export * from "./logic";
8
8
  export * from "./math";
9
9
  export * from "./object";
10
+ export * from "./string";
10
11
  export * from "./time";
11
12
  export * from "./ua";
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Recursively makes all properties in T optional, including nested objects.
3
+ * Unlike TypeScript's built-in Partial<T> which only affects top-level properties,
4
+ * DeepPartial<T> applies the optional modifier to all levels of nested objects.
5
+ *
6
+ * @template T - The type to make deeply partial
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * interface User {
11
+ * id: number;
12
+ * profile: {
13
+ * name: string;
14
+ * address: {
15
+ * street: string;
16
+ * city: string;
17
+ * };
18
+ * };
19
+ * }
20
+ *
21
+ * type PartialUser = DeepPartial<User>;
22
+ * // Result:
23
+ * // {
24
+ * // id?: number;
25
+ * // profile?: {
26
+ * // name?: string;
27
+ * // address?: {
28
+ * // street?: string;
29
+ * // city?: string;
30
+ * // };
31
+ * // };
32
+ * // }
33
+ * ```
34
+ */
35
+ export type DeepPartial<T> = T extends Record<PropertyKey, any> ? {
36
+ [P in keyof T]?: DeepPartial<T[P]>;
37
+ } : T;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Recursively makes all properties in T optional, including nested objects.
3
+ * Unlike TypeScript's built-in Partial<T> which only affects top-level properties,
4
+ * DeepPartial<T> applies the optional modifier to all levels of nested objects.
5
+ *
6
+ * @template T - The type to make deeply partial
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * interface User {
11
+ * id: number;
12
+ * profile: {
13
+ * name: string;
14
+ * address: {
15
+ * street: string;
16
+ * city: string;
17
+ * };
18
+ * };
19
+ * }
20
+ *
21
+ * type PartialUser = DeepPartial<User>;
22
+ * // Result:
23
+ * // {
24
+ * // id?: number;
25
+ * // profile?: {
26
+ * // name?: string;
27
+ * // address?: {
28
+ * // street?: string;
29
+ * // city?: string;
30
+ * // };
31
+ * // };
32
+ * // }
33
+ * ```
34
+ */
35
+ export {};
36
+ //# sourceMappingURL=deepPartial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepPartial.js","sourceRoot":"","sources":["../../../src/types/logic/deepPartial.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG"}