umt 2.12.3 → 2.14.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 (463) hide show
  1. package/README.md +60 -0
  2. package/module/Array/arraysJoin.js +1 -1
  3. package/module/Array/arraysJoin.js.map +1 -1
  4. package/module/Array/chunk.js +1 -2
  5. package/module/Array/chunk.js.map +1 -1
  6. package/module/Array/generateNumberArray.js +13 -3
  7. package/module/Array/generateNumberArray.js.map +1 -1
  8. package/module/Array/getArraysDiff.js +5 -1
  9. package/module/Array/getArraysDiff.js.map +1 -1
  10. package/module/Array/mergeSort.js +45 -18
  11. package/module/Array/mergeSort.js.map +1 -1
  12. package/module/Array/pop.js +2 -1
  13. package/module/Array/pop.js.map +1 -1
  14. package/module/Array/randomSelect.js +8 -0
  15. package/module/Array/randomSelect.js.map +1 -1
  16. package/module/Array/sortingHelpers/rangeValidator.js +3 -2
  17. package/module/Array/sortingHelpers/rangeValidator.js.map +1 -1
  18. package/module/Array/timSort.js +25 -23
  19. package/module/Array/timSort.js.map +1 -1
  20. package/module/Array/ultraNumberSort.js +214 -136
  21. package/module/Array/ultraNumberSort.js.map +1 -1
  22. package/module/Async/defer.d.ts +18 -0
  23. package/module/Async/defer.js +19 -0
  24. package/module/Async/defer.js.map +1 -0
  25. package/module/Async/index.d.ts +4 -0
  26. package/module/Async/index.js +5 -0
  27. package/module/Async/index.js.map +1 -0
  28. package/module/Async/parallel.d.ts +10 -0
  29. package/module/Async/parallel.js +44 -0
  30. package/module/Async/parallel.js.map +1 -0
  31. package/module/Async/sleep.d.ts +8 -0
  32. package/module/Async/sleep.js +11 -0
  33. package/module/Async/sleep.js.map +1 -0
  34. package/module/Async/timeout.d.ts +10 -0
  35. package/module/Async/timeout.js +22 -0
  36. package/module/Async/timeout.js.map +1 -0
  37. package/module/Color/cmykToRgba.js +6 -7
  38. package/module/Color/cmykToRgba.js.map +1 -1
  39. package/module/Color/hexaToRgba.js +1 -8
  40. package/module/Color/hexaToRgba.js.map +1 -1
  41. package/module/Color/hslaToRgba.d.ts +0 -1
  42. package/module/Color/hslaToRgba.js +7 -22
  43. package/module/Color/hslaToRgba.js.map +1 -1
  44. package/module/Color/rgbaToCmyk.js +0 -11
  45. package/module/Color/rgbaToCmyk.js.map +1 -1
  46. package/module/Color/rgbaToHexA.js +2 -15
  47. package/module/Color/rgbaToHexA.js.map +1 -1
  48. package/module/Color/rgbaToHsla.d.ts +0 -1
  49. package/module/Color/rgbaToHsla.js +0 -12
  50. package/module/Color/rgbaToHsla.js.map +1 -1
  51. package/module/Crypto/constants.d.ts +2 -0
  52. package/module/Crypto/constants.js +3 -0
  53. package/module/Crypto/constants.js.map +1 -0
  54. package/module/Crypto/decodeBase32.js +4 -5
  55. package/module/Crypto/decodeBase32.js.map +1 -1
  56. package/module/Crypto/decodeBase58.js +7 -6
  57. package/module/Crypto/decodeBase58.js.map +1 -1
  58. package/module/Crypto/encodeBase32.js +2 -1
  59. package/module/Crypto/encodeBase32.js.map +1 -1
  60. package/module/Crypto/encodeBase58.js +7 -3
  61. package/module/Crypto/encodeBase58.js.map +1 -1
  62. package/module/DataStructure/index.d.ts +2 -0
  63. package/module/DataStructure/index.js +2 -0
  64. package/module/DataStructure/index.js.map +1 -1
  65. package/module/DataStructure/lruCache.d.ts +139 -0
  66. package/module/DataStructure/lruCache.js +172 -0
  67. package/module/DataStructure/lruCache.js.map +1 -0
  68. package/module/DataStructure/ttlCache.d.ts +139 -0
  69. package/module/DataStructure/ttlCache.js +172 -0
  70. package/module/DataStructure/ttlCache.js.map +1 -0
  71. package/module/Error/flatMapResult.d.ts +23 -0
  72. package/module/Error/flatMapResult.js +28 -0
  73. package/module/Error/flatMapResult.js.map +1 -0
  74. package/module/Error/index.d.ts +3 -0
  75. package/module/Error/index.js +3 -0
  76. package/module/Error/index.js.map +1 -1
  77. package/module/Error/mapResult.d.ts +21 -0
  78. package/module/Error/mapResult.js +27 -0
  79. package/module/Error/mapResult.js.map +1 -0
  80. package/module/Error/matchResult.d.ts +25 -0
  81. package/module/Error/matchResult.js +27 -0
  82. package/module/Error/matchResult.js.map +1 -0
  83. package/module/Error/safeExecute.d.ts +16 -3
  84. package/module/Error/safeExecute.js +5 -2
  85. package/module/Error/safeExecute.js.map +1 -1
  86. package/module/Function/debounce.d.ts +38 -0
  87. package/module/Function/debounce.js +67 -0
  88. package/module/Function/debounce.js.map +1 -0
  89. package/module/Function/index.d.ts +4 -0
  90. package/module/Function/index.js +4 -0
  91. package/module/Function/index.js.map +1 -1
  92. package/module/Function/memoize.d.ts +36 -0
  93. package/module/Function/memoize.js +54 -0
  94. package/module/Function/memoize.js.map +1 -0
  95. package/module/Function/once.d.ts +18 -0
  96. package/module/Function/once.js +29 -0
  97. package/module/Function/once.js.map +1 -0
  98. package/module/Function/throttle.d.ts +25 -0
  99. package/module/Function/throttle.js +55 -0
  100. package/module/Function/throttle.js.map +1 -0
  101. package/module/IP/cidrToLong.d.ts +0 -1
  102. package/module/IP/cidrToLong.js +0 -4
  103. package/module/IP/cidrToLong.js.map +1 -1
  104. package/module/IP/cidrToSubnetMask.d.ts +0 -1
  105. package/module/IP/cidrToSubnetMask.js +0 -1
  106. package/module/IP/cidrToSubnetMask.js.map +1 -1
  107. package/module/IP/getNetworkAddress.d.ts +0 -1
  108. package/module/IP/getNetworkAddress.js +2 -32
  109. package/module/IP/getNetworkAddress.js.map +1 -1
  110. package/module/IP/ipToBinaryString.d.ts +0 -1
  111. package/module/IP/ipToBinaryString.js +2 -25
  112. package/module/IP/ipToBinaryString.js.map +1 -1
  113. package/module/IP/ipToLong.d.ts +0 -1
  114. package/module/IP/ipToLong.js +0 -1
  115. package/module/IP/ipToLong.js.map +1 -1
  116. package/module/IP/isInRange.d.ts +0 -1
  117. package/module/IP/isInRange.js +5 -28
  118. package/module/IP/isInRange.js.map +1 -1
  119. package/module/IP/isPrivateIp.d.ts +0 -1
  120. package/module/IP/isPrivateIp.js +1 -10
  121. package/module/IP/isPrivateIp.js.map +1 -1
  122. package/module/IP/longToIp.d.ts +0 -1
  123. package/module/IP/longToIp.js +0 -8
  124. package/module/IP/longToIp.js.map +1 -1
  125. package/module/IP/subnetMaskToCidr.d.ts +0 -1
  126. package/module/IP/subnetMaskToCidr.js +2 -23
  127. package/module/IP/subnetMaskToCidr.js.map +1 -1
  128. package/module/Iterator/index.d.ts +3 -0
  129. package/module/Iterator/index.js +4 -0
  130. package/module/Iterator/index.js.map +1 -0
  131. package/module/Iterator/lazyFilter.d.ts +10 -0
  132. package/module/Iterator/lazyFilter.js +19 -0
  133. package/module/Iterator/lazyFilter.js.map +1 -0
  134. package/module/Iterator/lazyMap.d.ts +10 -0
  135. package/module/Iterator/lazyMap.js +17 -0
  136. package/module/Iterator/lazyMap.js.map +1 -0
  137. package/module/Iterator/lazyTake.d.ts +10 -0
  138. package/module/Iterator/lazyTake.js +20 -0
  139. package/module/Iterator/lazyTake.js.map +1 -0
  140. package/module/Math/addition.js +20 -4
  141. package/module/Math/addition.js.map +1 -1
  142. package/module/Math/average.js +3 -3
  143. package/module/Math/average.js.map +1 -1
  144. package/module/Math/bitwise.js +1 -1
  145. package/module/Math/bitwise.js.map +1 -1
  146. package/module/Math/calculator/core.js +2 -1
  147. package/module/Math/calculator/core.js.map +1 -1
  148. package/module/Math/calculator/literalExpression.js +1 -1
  149. package/module/Math/clamp.d.ts +16 -0
  150. package/module/Math/clamp.js +19 -0
  151. package/module/Math/clamp.js.map +1 -0
  152. package/module/Math/correlationCoefficient.js +0 -3
  153. package/module/Math/correlationCoefficient.js.map +1 -1
  154. package/module/Math/inRange.d.ts +19 -0
  155. package/module/Math/inRange.js +24 -0
  156. package/module/Math/inRange.js.map +1 -0
  157. package/module/Math/index.d.ts +3 -0
  158. package/module/Math/index.js +3 -0
  159. package/module/Math/index.js.map +1 -1
  160. package/module/Math/median.js +2 -2
  161. package/module/Math/median.js.map +1 -1
  162. package/module/Math/nCr.js +2 -4
  163. package/module/Math/nCr.js.map +1 -1
  164. package/module/Math/percentile.js +2 -5
  165. package/module/Math/percentile.js.map +1 -1
  166. package/module/Math/primeFactorization.js +1 -1
  167. package/module/Math/primeFactorization.js.map +1 -1
  168. package/module/Math/sumPrecise.d.ts +14 -0
  169. package/module/Math/sumPrecise.js +27 -0
  170. package/module/Math/sumPrecise.js.map +1 -0
  171. package/module/Math/uuidv7.js +56 -22
  172. package/module/Math/uuidv7.js.map +1 -1
  173. package/module/Number/formatNumber.d.ts +42 -0
  174. package/module/Number/formatNumber.js +44 -0
  175. package/module/Number/formatNumber.js.map +1 -0
  176. package/module/Number/index.d.ts +3 -0
  177. package/module/Number/index.js +4 -0
  178. package/module/Number/index.js.map +1 -0
  179. package/module/Number/toOrdinal.d.ts +20 -0
  180. package/module/Number/toOrdinal.js +37 -0
  181. package/module/Number/toOrdinal.js.map +1 -0
  182. package/module/Number/toPercentage.d.ts +20 -0
  183. package/module/Number/toPercentage.js +27 -0
  184. package/module/Number/toPercentage.js.map +1 -0
  185. package/module/Object/deepClone.d.ts +15 -0
  186. package/module/Object/deepClone.js +65 -0
  187. package/module/Object/deepClone.js.map +1 -0
  188. package/module/Object/getObjectsCommon.d.ts +23 -0
  189. package/module/Object/getObjectsCommon.js +60 -0
  190. package/module/Object/getObjectsCommon.js.map +1 -0
  191. package/module/Object/getObjectsDiff.d.ts +25 -0
  192. package/module/Object/getObjectsDiff.js +79 -0
  193. package/module/Object/getObjectsDiff.js.map +1 -0
  194. package/module/Object/index.d.ts +6 -0
  195. package/module/Object/index.js +6 -0
  196. package/module/Object/index.js.map +1 -1
  197. package/module/Object/isPlainObject.d.ts +16 -0
  198. package/module/Object/isPlainObject.js +32 -0
  199. package/module/Object/isPlainObject.js.map +1 -0
  200. package/module/Object/mapKeys.d.ts +15 -0
  201. package/module/Object/mapKeys.js +28 -0
  202. package/module/Object/mapKeys.js.map +1 -0
  203. package/module/Object/mapValues.d.ts +15 -0
  204. package/module/Object/mapValues.js +27 -0
  205. package/module/Object/mapValues.js.map +1 -0
  206. package/module/Object/mergeDeep.js +4 -9
  207. package/module/Object/mergeDeep.js.map +1 -1
  208. package/module/Object/omit.d.ts +1 -1
  209. package/module/Object/omit.js.map +1 -1
  210. package/module/Object/pickDeep.js +6 -1
  211. package/module/Object/pickDeep.js.map +1 -1
  212. package/module/Predicate/every.d.ts +14 -0
  213. package/module/Predicate/every.js +22 -0
  214. package/module/Predicate/every.js.map +1 -0
  215. package/module/Predicate/index.d.ts +6 -0
  216. package/module/Predicate/index.js +7 -0
  217. package/module/Predicate/index.js.map +1 -0
  218. package/module/Predicate/isNotNullish.d.ts +11 -0
  219. package/module/Predicate/isNotNullish.js +12 -0
  220. package/module/Predicate/isNotNullish.js.map +1 -0
  221. package/module/Predicate/isNullish.d.ts +11 -0
  222. package/module/Predicate/isNullish.js +12 -0
  223. package/module/Predicate/isNullish.js.map +1 -0
  224. package/module/Predicate/matches.d.ts +11 -0
  225. package/module/Predicate/matches.js +20 -0
  226. package/module/Predicate/matches.js.map +1 -0
  227. package/module/Predicate/not.d.ts +10 -0
  228. package/module/Predicate/not.js +11 -0
  229. package/module/Predicate/not.js.map +1 -0
  230. package/module/Predicate/some.d.ts +15 -0
  231. package/module/Predicate/some.js +23 -0
  232. package/module/Predicate/some.js.map +1 -0
  233. package/module/String/camelCase.js +2 -2
  234. package/module/String/camelCase.js.map +1 -1
  235. package/module/String/escapeHtml.js +1 -1
  236. package/module/String/formatString/getValue.js +1 -1
  237. package/module/String/formatString/getValue.js.map +1 -1
  238. package/module/String/fromBase64.d.ts +0 -1
  239. package/module/String/fromBase64.js +1 -9
  240. package/module/String/fromBase64.js.map +1 -1
  241. package/module/String/fuzzySearch.js +74 -6
  242. package/module/String/fuzzySearch.js.map +1 -1
  243. package/module/String/kebabCase.js +1 -1
  244. package/module/String/kebabCase.js.map +1 -1
  245. package/module/String/levenshteinDistance.js +1 -2
  246. package/module/String/levenshteinDistance.js.map +1 -1
  247. package/module/String/randomString.js +23 -2
  248. package/module/String/randomString.js.map +1 -1
  249. package/module/String/reverseString.js +1 -1
  250. package/module/String/reverseString.js.map +1 -1
  251. package/module/String/slugify.js +1 -1
  252. package/module/String/toHalfWidth.js +2 -2
  253. package/module/String/toHalfWidth.js.map +1 -1
  254. package/module/String/truncate.js +0 -3
  255. package/module/String/truncate.js.map +1 -1
  256. package/module/String/unescapeHtml.js +1 -1
  257. package/module/String/unescapeHtml.js.map +1 -1
  258. package/module/Time/convertTime.js +4 -3
  259. package/module/Time/convertTime.js.map +1 -1
  260. package/module/Tool/escapeRegExp.d.ts +8 -0
  261. package/module/Tool/escapeRegExp.js +11 -0
  262. package/module/Tool/escapeRegExp.js.map +1 -0
  263. package/module/Tool/index.d.ts +1 -0
  264. package/module/Tool/index.js +1 -0
  265. package/module/Tool/index.js.map +1 -1
  266. package/module/URL/buildUrl.d.ts +17 -0
  267. package/module/URL/buildUrl.js +24 -0
  268. package/module/URL/buildUrl.js.map +1 -0
  269. package/module/URL/index.d.ts +4 -0
  270. package/module/URL/index.js +5 -0
  271. package/module/URL/index.js.map +1 -0
  272. package/module/URL/isAbsoluteUrl.d.ts +20 -0
  273. package/module/URL/isAbsoluteUrl.js +23 -0
  274. package/module/URL/isAbsoluteUrl.js.map +1 -0
  275. package/module/URL/joinPath.d.ts +24 -0
  276. package/module/URL/joinPath.js +43 -0
  277. package/module/URL/joinPath.js.map +1 -0
  278. package/module/URL/parseQueryString.d.ts +22 -0
  279. package/module/URL/parseQueryString.js +34 -0
  280. package/module/URL/parseQueryString.js.map +1 -0
  281. package/module/Validate/parseEmail.js +5 -5
  282. package/module/Validate/parseEmail.js.map +1 -1
  283. package/module/es5/Array/arraysJoin.js +1 -1
  284. package/module/es5/Array/chunk.js +3 -2
  285. package/module/es5/Array/generateNumberArray.js +21 -3
  286. package/module/es5/Array/getArraysDiff.js +5 -3
  287. package/module/es5/Array/mergeSort.js +51 -19
  288. package/module/es5/Array/pop.js +2 -7
  289. package/module/es5/Array/randomSelect.js +8 -0
  290. package/module/es5/Array/sortingHelpers/rangeValidator.js +3 -2
  291. package/module/es5/Array/timSort.js +25 -23
  292. package/module/es5/Array/ultraNumberSort.js +243 -243
  293. package/module/es5/Async/defer.d.ts +18 -0
  294. package/module/es5/Async/defer.js +32 -0
  295. package/module/es5/Async/index.d.ts +4 -0
  296. package/module/es5/Async/index.js +49 -0
  297. package/module/es5/Async/parallel.d.ts +10 -0
  298. package/module/es5/Async/parallel.js +48 -0
  299. package/module/es5/Async/sleep.d.ts +8 -0
  300. package/module/es5/Async/sleep.js +18 -0
  301. package/module/es5/Async/timeout.d.ts +10 -0
  302. package/module/es5/Async/timeout.js +29 -0
  303. package/module/es5/Color/cmykToRgba.js +6 -7
  304. package/module/es5/Color/hexaToRgba.js +7 -5
  305. package/module/es5/Color/hslaToRgba.d.ts +0 -1
  306. package/module/es5/Color/hslaToRgba.js +7 -22
  307. package/module/es5/Color/rgbaToCmyk.js +0 -4
  308. package/module/es5/Color/rgbaToHexA.js +2 -6
  309. package/module/es5/Color/rgbaToHsla.d.ts +0 -1
  310. package/module/es5/Color/rgbaToHsla.js +0 -5
  311. package/module/es5/Crypto/constants.d.ts +2 -0
  312. package/module/es5/Crypto/constants.js +8 -0
  313. package/module/es5/Crypto/decodeBase32.js +12 -5
  314. package/module/es5/Crypto/decodeBase58.js +14 -8
  315. package/module/es5/Crypto/encodeBase32.js +2 -1
  316. package/module/es5/Crypto/encodeBase58.js +8 -3
  317. package/module/es5/DataStructure/index.d.ts +2 -0
  318. package/module/es5/DataStructure/index.js +22 -0
  319. package/module/es5/DataStructure/lruCache.d.ts +139 -0
  320. package/module/es5/DataStructure/lruCache.js +205 -0
  321. package/module/es5/DataStructure/ttlCache.d.ts +139 -0
  322. package/module/es5/DataStructure/ttlCache.js +211 -0
  323. package/module/es5/Error/flatMapResult.d.ts +23 -0
  324. package/module/es5/Error/flatMapResult.js +33 -0
  325. package/module/es5/Error/index.d.ts +3 -0
  326. package/module/es5/Error/index.js +33 -0
  327. package/module/es5/Error/mapResult.d.ts +21 -0
  328. package/module/es5/Error/mapResult.js +32 -0
  329. package/module/es5/Error/matchResult.d.ts +25 -0
  330. package/module/es5/Error/matchResult.js +32 -0
  331. package/module/es5/Error/safeExecute.d.ts +16 -3
  332. package/module/es5/Error/safeExecute.js +3 -3
  333. package/module/es5/Function/debounce.d.ts +38 -0
  334. package/module/es5/Function/debounce.js +88 -0
  335. package/module/es5/Function/index.d.ts +4 -0
  336. package/module/es5/Function/index.js +44 -0
  337. package/module/es5/Function/memoize.d.ts +36 -0
  338. package/module/es5/Function/memoize.js +73 -0
  339. package/module/es5/Function/once.d.ts +18 -0
  340. package/module/es5/Function/once.js +37 -0
  341. package/module/es5/Function/throttle.d.ts +25 -0
  342. package/module/es5/Function/throttle.js +69 -0
  343. package/module/es5/IP/cidrToLong.d.ts +0 -1
  344. package/module/es5/IP/cidrToLong.js +0 -4
  345. package/module/es5/IP/cidrToSubnetMask.d.ts +0 -1
  346. package/module/es5/IP/cidrToSubnetMask.js +0 -1
  347. package/module/es5/IP/getNetworkAddress.d.ts +0 -1
  348. package/module/es5/IP/getNetworkAddress.js +2 -31
  349. package/module/es5/IP/ipToBinaryString.d.ts +0 -1
  350. package/module/es5/IP/ipToBinaryString.js +1 -40
  351. package/module/es5/IP/ipToLong.d.ts +0 -1
  352. package/module/es5/IP/ipToLong.js +0 -1
  353. package/module/es5/IP/isInRange.d.ts +0 -1
  354. package/module/es5/IP/isInRange.js +5 -29
  355. package/module/es5/IP/isPrivateIp.d.ts +0 -1
  356. package/module/es5/IP/isPrivateIp.js +3 -12
  357. package/module/es5/IP/longToIp.d.ts +0 -1
  358. package/module/es5/IP/longToIp.js +0 -6
  359. package/module/es5/IP/subnetMaskToCidr.d.ts +0 -1
  360. package/module/es5/IP/subnetMaskToCidr.js +2 -26
  361. package/module/es5/Iterator/index.d.ts +3 -0
  362. package/module/es5/Iterator/index.js +38 -0
  363. package/module/es5/Iterator/lazyFilter.d.ts +10 -0
  364. package/module/es5/Iterator/lazyFilter.js +63 -0
  365. package/module/es5/Iterator/lazyMap.d.ts +10 -0
  366. package/module/es5/Iterator/lazyMap.js +59 -0
  367. package/module/es5/Iterator/lazyTake.d.ts +10 -0
  368. package/module/es5/Iterator/lazyTake.js +65 -0
  369. package/module/es5/Math/addition.js +24 -14
  370. package/module/es5/Math/average.js +3 -5
  371. package/module/es5/Math/bitwise.js +1 -1
  372. package/module/es5/Math/calculator/core.js +2 -1
  373. package/module/es5/Math/calculator/literalExpression.js +1 -1
  374. package/module/es5/Math/clamp.d.ts +16 -0
  375. package/module/es5/Math/clamp.js +24 -0
  376. package/module/es5/Math/correlationCoefficient.js +0 -3
  377. package/module/es5/Math/inRange.d.ts +19 -0
  378. package/module/es5/Math/inRange.js +29 -0
  379. package/module/es5/Math/index.d.ts +3 -0
  380. package/module/es5/Math/index.js +33 -0
  381. package/module/es5/Math/median.js +2 -2
  382. package/module/es5/Math/nCr.js +2 -4
  383. package/module/es5/Math/percentile.js +2 -11
  384. package/module/es5/Math/primeFactorization.js +1 -1
  385. package/module/es5/Math/sumPrecise.d.ts +14 -0
  386. package/module/es5/Math/sumPrecise.js +41 -0
  387. package/module/es5/Math/uuidv7.js +25 -40
  388. package/module/es5/Number/formatNumber.d.ts +42 -0
  389. package/module/es5/Number/formatNumber.js +58 -0
  390. package/module/es5/Number/index.d.ts +3 -0
  391. package/module/es5/Number/index.js +38 -0
  392. package/module/es5/Number/toOrdinal.d.ts +20 -0
  393. package/module/es5/Number/toOrdinal.js +42 -0
  394. package/module/es5/Number/toPercentage.d.ts +20 -0
  395. package/module/es5/Number/toPercentage.js +33 -0
  396. package/module/es5/Object/deepClone.d.ts +15 -0
  397. package/module/es5/Object/deepClone.js +110 -0
  398. package/module/es5/Object/getObjectsCommon.d.ts +23 -0
  399. package/module/es5/Object/getObjectsCommon.js +92 -0
  400. package/module/es5/Object/getObjectsDiff.d.ts +25 -0
  401. package/module/es5/Object/getObjectsDiff.js +146 -0
  402. package/module/es5/Object/index.d.ts +6 -0
  403. package/module/es5/Object/index.js +66 -0
  404. package/module/es5/Object/isPlainObject.d.ts +16 -0
  405. package/module/es5/Object/isPlainObject.js +39 -0
  406. package/module/es5/Object/mapKeys.d.ts +15 -0
  407. package/module/es5/Object/mapKeys.js +33 -0
  408. package/module/es5/Object/mapValues.d.ts +15 -0
  409. package/module/es5/Object/mapValues.js +32 -0
  410. package/module/es5/Object/mergeDeep.js +7 -10
  411. package/module/es5/Object/omit.d.ts +1 -1
  412. package/module/es5/Object/pickDeep.js +4 -6
  413. package/module/es5/Predicate/every.d.ts +14 -0
  414. package/module/es5/Predicate/every.js +33 -0
  415. package/module/es5/Predicate/index.d.ts +6 -0
  416. package/module/es5/Predicate/index.js +71 -0
  417. package/module/es5/Predicate/isNotNullish.d.ts +11 -0
  418. package/module/es5/Predicate/isNotNullish.js +19 -0
  419. package/module/es5/Predicate/isNullish.d.ts +11 -0
  420. package/module/es5/Predicate/isNullish.js +19 -0
  421. package/module/es5/Predicate/matches.d.ts +11 -0
  422. package/module/es5/Predicate/matches.js +28 -0
  423. package/module/es5/Predicate/not.d.ts +10 -0
  424. package/module/es5/Predicate/not.js +20 -0
  425. package/module/es5/Predicate/some.d.ts +15 -0
  426. package/module/es5/Predicate/some.js +34 -0
  427. package/module/es5/String/camelCase.js +2 -2
  428. package/module/es5/String/escapeHtml.js +1 -1
  429. package/module/es5/String/formatString/getValue.js +1 -1
  430. package/module/es5/String/fromBase64.d.ts +0 -1
  431. package/module/es5/String/fromBase64.js +9 -8
  432. package/module/es5/String/fuzzySearch.js +84 -9
  433. package/module/es5/String/kebabCase.js +1 -1
  434. package/module/es5/String/levenshteinDistance.js +3 -2
  435. package/module/es5/String/randomString.js +24 -2
  436. package/module/es5/String/reverseString.js +7 -1
  437. package/module/es5/String/slugify.js +1 -1
  438. package/module/es5/String/toHalfWidth.js +2 -2
  439. package/module/es5/String/truncate.js +0 -3
  440. package/module/es5/String/unescapeHtml.js +1 -1
  441. package/module/es5/Time/convertTime.js +4 -3
  442. package/module/es5/Tool/escapeRegExp.d.ts +8 -0
  443. package/module/es5/Tool/escapeRegExp.js +18 -0
  444. package/module/es5/Tool/index.d.ts +1 -0
  445. package/module/es5/Tool/index.js +11 -0
  446. package/module/es5/URL/buildUrl.d.ts +17 -0
  447. package/module/es5/URL/buildUrl.js +31 -0
  448. package/module/es5/URL/index.d.ts +4 -0
  449. package/module/es5/URL/index.js +49 -0
  450. package/module/es5/URL/isAbsoluteUrl.d.ts +20 -0
  451. package/module/es5/URL/isAbsoluteUrl.js +28 -0
  452. package/module/es5/URL/joinPath.d.ts +24 -0
  453. package/module/es5/URL/joinPath.js +48 -0
  454. package/module/es5/URL/parseQueryString.d.ts +22 -0
  455. package/module/es5/URL/parseQueryString.js +57 -0
  456. package/module/es5/Validate/parseEmail.js +5 -5
  457. package/module/es5/index.d.ts +5 -0
  458. package/module/es5/index.js +73 -18
  459. package/module/es5/tsconfig.tsbuildinfo +1 -1
  460. package/module/index.d.ts +5 -0
  461. package/module/index.js +5 -0
  462. package/module/index.js.map +1 -1
  463. package/package.json +58 -27
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.formatNumber = void 0;
7
+ /**
8
+ * Options for formatting a number.
9
+ */
10
+
11
+ /**
12
+ * Formats a number using Intl.NumberFormat.
13
+ *
14
+ * @param value - The number to format
15
+ * @param options - Formatting options
16
+ * @returns The formatted number string
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * formatNumber(1234567.89);
21
+ * // "1,234,567.89" (in en-US locale)
22
+ *
23
+ * formatNumber(1234567.89, { locale: "de-DE" });
24
+ * // "1.234.567,89"
25
+ *
26
+ * formatNumber(0.75, { style: "percent" });
27
+ * // "75%"
28
+ *
29
+ * formatNumber(1234.5, {
30
+ * style: "currency",
31
+ * currency: "USD",
32
+ * locale: "en-US",
33
+ * });
34
+ * // "$1,234.50"
35
+ * ```
36
+ */
37
+ var formatNumber = exports.formatNumber = function formatNumber(value) {
38
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
39
+ var locale = options.locale,
40
+ minimumFractionDigits = options.minimumFractionDigits,
41
+ maximumFractionDigits = options.maximumFractionDigits,
42
+ style = options.style,
43
+ currency = options.currency;
44
+ var formatOptions = {};
45
+ if (style !== undefined) {
46
+ formatOptions.style = style;
47
+ }
48
+ if (currency !== undefined) {
49
+ formatOptions.currency = currency;
50
+ }
51
+ if (minimumFractionDigits !== undefined) {
52
+ formatOptions.minimumFractionDigits = minimumFractionDigits;
53
+ }
54
+ if (maximumFractionDigits !== undefined) {
55
+ formatOptions.maximumFractionDigits = maximumFractionDigits;
56
+ }
57
+ return new Intl.NumberFormat(locale, formatOptions).format(value);
58
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./formatNumber";
2
+ export * from "./toOrdinal";
3
+ export * from "./toPercentage";
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _formatNumber = require("./formatNumber");
7
+ Object.keys(_formatNumber).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _formatNumber[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _formatNumber[key];
14
+ }
15
+ });
16
+ });
17
+ var _toOrdinal = require("./toOrdinal");
18
+ Object.keys(_toOrdinal).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _toOrdinal[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function get() {
24
+ return _toOrdinal[key];
25
+ }
26
+ });
27
+ });
28
+ var _toPercentage = require("./toPercentage");
29
+ Object.keys(_toPercentage).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _toPercentage[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function get() {
35
+ return _toPercentage[key];
36
+ }
37
+ });
38
+ });
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Converts a number to its English ordinal string representation.
3
+ *
4
+ * Handles the special cases for 11th, 12th, and 13th
5
+ * (which end in "th" despite their last digit).
6
+ *
7
+ * @param value - The number to convert to ordinal form
8
+ * @returns The ordinal string (e.g., "1st", "2nd", "3rd", "11th")
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * toOrdinal(1); // "1st"
13
+ * toOrdinal(2); // "2nd"
14
+ * toOrdinal(3); // "3rd"
15
+ * toOrdinal(11); // "11th"
16
+ * toOrdinal(21); // "21st"
17
+ * toOrdinal(112); // "112th"
18
+ * ```
19
+ */
20
+ export declare const toOrdinal: (value: number) => string;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.toOrdinal = void 0;
7
+ /**
8
+ * Converts a number to its English ordinal string representation.
9
+ *
10
+ * Handles the special cases for 11th, 12th, and 13th
11
+ * (which end in "th" despite their last digit).
12
+ *
13
+ * @param value - The number to convert to ordinal form
14
+ * @returns The ordinal string (e.g., "1st", "2nd", "3rd", "11th")
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * toOrdinal(1); // "1st"
19
+ * toOrdinal(2); // "2nd"
20
+ * toOrdinal(3); // "3rd"
21
+ * toOrdinal(11); // "11th"
22
+ * toOrdinal(21); // "21st"
23
+ * toOrdinal(112); // "112th"
24
+ * ```
25
+ */
26
+ var toOrdinal = exports.toOrdinal = function toOrdinal(value) {
27
+ var module100 = value % 100;
28
+ if (module100 >= 11 && module100 <= 13) {
29
+ return "".concat(value, "th");
30
+ }
31
+ var module10 = value % 10;
32
+ if (module10 === 1) {
33
+ return "".concat(value, "st");
34
+ }
35
+ if (module10 === 2) {
36
+ return "".concat(value, "nd");
37
+ }
38
+ if (module10 === 3) {
39
+ return "".concat(value, "rd");
40
+ }
41
+ return "".concat(value, "th");
42
+ };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Calculates the percentage of a value relative to a total.
3
+ *
4
+ * Returns 0 when the total is 0 to avoid division by zero.
5
+ *
6
+ * @param value - The partial value
7
+ * @param total - The total value
8
+ * @param decimals - The number of decimal places (default 2)
9
+ * @returns The percentage value
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * toPercentage(25, 100); // 25
14
+ * toPercentage(1, 3); // 33.33
15
+ * toPercentage(1, 3, 0); // 33
16
+ * toPercentage(0, 0); // 0
17
+ * toPercentage(50, 200, 1); // 25.0 -> 25
18
+ * ```
19
+ */
20
+ export declare const toPercentage: (value: number, total: number, decimals?: number) => number;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.toPercentage = void 0;
7
+ /**
8
+ * Calculates the percentage of a value relative to a total.
9
+ *
10
+ * Returns 0 when the total is 0 to avoid division by zero.
11
+ *
12
+ * @param value - The partial value
13
+ * @param total - The total value
14
+ * @param decimals - The number of decimal places (default 2)
15
+ * @returns The percentage value
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * toPercentage(25, 100); // 25
20
+ * toPercentage(1, 3); // 33.33
21
+ * toPercentage(1, 3, 0); // 33
22
+ * toPercentage(0, 0); // 0
23
+ * toPercentage(50, 200, 1); // 25.0 -> 25
24
+ * ```
25
+ */
26
+ var toPercentage = exports.toPercentage = function toPercentage(value, total) {
27
+ var decimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
28
+ if (total === 0) {
29
+ return 0;
30
+ }
31
+ var factor = Math.pow(10, decimals);
32
+ return Math.round(value / total * 100 * factor) / factor;
33
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Creates a deep clone of the given value.
3
+ *
4
+ * @param value - The value to deep clone.
5
+ * @returns A deep clone of the input value.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * const original = { a: 1, b: { c: 2 } };
10
+ * const cloned = deepClone(original);
11
+ * cloned.b.c = 99;
12
+ * original.b.c; // still 2
13
+ * ```
14
+ */
15
+ export declare const deepClone: <T>(value: T) => T;
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.deepClone = void 0;
7
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
11
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12
+ 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; } }
13
+ 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; }
14
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
15
+ /**
16
+ * Recursively clones a value.
17
+ */
18
+ var _cloneValue = function cloneValue(value) {
19
+ if (value === null || _typeof(value) !== "object") {
20
+ return value;
21
+ }
22
+ if (Array.isArray(value)) {
23
+ var _result = [];
24
+ var _iterator = _createForOfIteratorHelper(value),
25
+ _step;
26
+ try {
27
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
28
+ var element = _step.value;
29
+ _result.push(_cloneValue(element));
30
+ }
31
+ } catch (err) {
32
+ _iterator.e(err);
33
+ } finally {
34
+ _iterator.f();
35
+ }
36
+ return _result;
37
+ }
38
+ if (value instanceof Date) {
39
+ return new Date(value);
40
+ }
41
+ if (value instanceof RegExp) {
42
+ return new RegExp(value.source, value.flags);
43
+ }
44
+ if (value instanceof Map) {
45
+ var _result2 = new Map();
46
+ var _iterator2 = _createForOfIteratorHelper(value),
47
+ _step2;
48
+ try {
49
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
50
+ var _step2$value = _slicedToArray(_step2.value, 2),
51
+ k = _step2$value[0],
52
+ v = _step2$value[1];
53
+ _result2.set(_cloneValue(k), _cloneValue(v));
54
+ }
55
+ } catch (err) {
56
+ _iterator2.e(err);
57
+ } finally {
58
+ _iterator2.f();
59
+ }
60
+ return _result2;
61
+ }
62
+ if (value instanceof Set) {
63
+ var _result3 = new Set();
64
+ var _iterator3 = _createForOfIteratorHelper(value),
65
+ _step3;
66
+ try {
67
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
68
+ var _v = _step3.value;
69
+ _result3.add(_cloneValue(_v));
70
+ }
71
+ } catch (err) {
72
+ _iterator3.e(err);
73
+ } finally {
74
+ _iterator3.f();
75
+ }
76
+ return _result3;
77
+ }
78
+
79
+ // Plain object
80
+ var result = {};
81
+ for (var _i = 0, _Object$keys = Object.keys(value); _i < _Object$keys.length; _i++) {
82
+ var key = _Object$keys[_i];
83
+ if (key === "__proto__" || key === "constructor" || key === "prototype") {
84
+ continue;
85
+ }
86
+ result[key] = _cloneValue(value[key]);
87
+ }
88
+ return result;
89
+ };
90
+
91
+ /**
92
+ * Creates a deep clone of the given value.
93
+ *
94
+ * @param value - The value to deep clone.
95
+ * @returns A deep clone of the input value.
96
+ *
97
+ * @example
98
+ * ```typescript
99
+ * const original = { a: 1, b: { c: 2 } };
100
+ * const cloned = deepClone(original);
101
+ * cloned.b.c = 99;
102
+ * original.b.c; // still 2
103
+ * ```
104
+ */
105
+ var deepClone = exports.deepClone = function deepClone(value) {
106
+ if (value === null || _typeof(value) !== "object") {
107
+ return value;
108
+ }
109
+ return _cloneValue(value);
110
+ };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Extract key-value pairs common to all input objects.
3
+ *
4
+ * A key-value pair is considered common when the key exists in every object
5
+ * and the value is strictly equal (===) across all objects.
6
+ * When all values for a key are plain objects, the function recurses to find
7
+ * the common subset. If the recursive result is empty, the key is excluded.
8
+ *
9
+ * @template T - Type of the input objects.
10
+ * @param {T} object - The first object.
11
+ * @param {...Record<string, unknown>[]} objects - Additional objects to compare.
12
+ * @returns {Partial<T>} Object containing only the key-value pairs shared by all inputs.
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * getObjectsCommon({ a: 1, b: 2 }, { a: 1, c: 3 });
17
+ * // { a: 1 }
18
+ *
19
+ * getObjectsCommon({ a: { b: 1, c: 2 }, d: 3 }, { a: { b: 1, d: 4 }, d: 3 });
20
+ * // { a: { b: 1 }, d: 3 }
21
+ * ```
22
+ */
23
+ export declare const getObjectsCommon: <T extends Record<string, unknown>>(object: T, ...objects: Record<string, unknown>[]) => Partial<T>;
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getObjectsCommon = void 0;
7
+ var _isPlainObject = require("../Object/isPlainObject");
8
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
9
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
10
+ 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."); }
11
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
12
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
13
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
14
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
+ 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; } }
16
+ 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; }
17
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
18
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
19
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
20
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
21
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
22
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
23
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
24
+ /**
25
+ * Extract key-value pairs common to all input objects.
26
+ *
27
+ * A key-value pair is considered common when the key exists in every object
28
+ * and the value is strictly equal (===) across all objects.
29
+ * When all values for a key are plain objects, the function recurses to find
30
+ * the common subset. If the recursive result is empty, the key is excluded.
31
+ *
32
+ * @template T - Type of the input objects.
33
+ * @param {T} object - The first object.
34
+ * @param {...Record<string, unknown>[]} objects - Additional objects to compare.
35
+ * @returns {Partial<T>} Object containing only the key-value pairs shared by all inputs.
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * getObjectsCommon({ a: 1, b: 2 }, { a: 1, c: 3 });
40
+ * // { a: 1 }
41
+ *
42
+ * getObjectsCommon({ a: { b: 1, c: 2 }, d: 3 }, { a: { b: 1, d: 4 }, d: 3 });
43
+ * // { a: { b: 1 }, d: 3 }
44
+ * ```
45
+ */
46
+ var _getObjectsCommon = exports.getObjectsCommon = function getObjectsCommon(object) {
47
+ for (var _len = arguments.length, objects = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
48
+ objects[_key - 1] = arguments[_key];
49
+ }
50
+ if (objects.length === 0) {
51
+ return _objectSpread({}, object);
52
+ }
53
+ var result = {};
54
+ var _loop = function _loop() {
55
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
56
+ key = _Object$entries$_i[0],
57
+ value = _Object$entries$_i[1];
58
+ var isCommon = true;
59
+ var allPlainObjects = (0, _isPlainObject.isPlainObject)(value);
60
+ for (var _i2 = 0, _objects = objects; _i2 < _objects.length; _i2++) {
61
+ var other = _objects[_i2];
62
+ if (!Object.hasOwn(other, key)) {
63
+ isCommon = false;
64
+ break;
65
+ }
66
+ if (!(0, _isPlainObject.isPlainObject)(other[key])) {
67
+ allPlainObjects = false;
68
+ }
69
+ if (!allPlainObjects && other[key] !== value) {
70
+ isCommon = false;
71
+ break;
72
+ }
73
+ }
74
+ if (!isCommon) {
75
+ return 1; // continue
76
+ }
77
+ if (allPlainObjects) {
78
+ var nested = _getObjectsCommon.apply(void 0, [value].concat(_toConsumableArray(objects.map(function (other) {
79
+ return other[key];
80
+ }))));
81
+ if (Object.keys(nested).length > 0) {
82
+ result[key] = nested;
83
+ }
84
+ } else {
85
+ result[key] = value;
86
+ }
87
+ };
88
+ for (var _i = 0, _Object$entries = Object.entries(object); _i < _Object$entries.length; _i++) {
89
+ if (_loop()) continue;
90
+ }
91
+ return result;
92
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Extract key-value pairs that appear in exactly one input object.
3
+ *
4
+ * A key-value pair is considered "shared" if the same key with the same value (===)
5
+ * exists in two or more objects. Only pairs unique to a single object are returned.
6
+ * When all values for a key are plain objects, the function recurses to find
7
+ * the diff subset. If the recursive result is empty, the key is excluded.
8
+ * When multiple unique pairs share the same key (different values),
9
+ * the last value wins.
10
+ *
11
+ * @template T - Type of the input objects.
12
+ * @param {T} object - The first object.
13
+ * @param {...Record<string, unknown>[]} objects - Additional objects to compare.
14
+ * @returns {Partial<T>} Object containing only key-value pairs unique to one input.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * getObjectsDiff({ a: 1, b: 2 }, { b: 2, c: 3 });
19
+ * // { a: 1, c: 3 }
20
+ *
21
+ * getObjectsDiff({ a: { b: 1, c: 2 }, d: 3 }, { a: { b: 1, d: 4 }, d: 3 });
22
+ * // { a: { c: 2, d: 4 } }
23
+ * ```
24
+ */
25
+ export declare const getObjectsDiff: <T extends Record<string, unknown>>(object: T, ...objects: Record<string, unknown>[]) => Partial<T>;
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getObjectsDiff = void 0;
7
+ var _isPlainObject = require("../Object/isPlainObject");
8
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
9
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
10
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
13
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
14
+ 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."); }
15
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
16
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
17
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
18
+ 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; } }
19
+ 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; }
20
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
21
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
22
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
23
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
24
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
25
+ /**
26
+ * Extract key-value pairs that appear in exactly one input object.
27
+ *
28
+ * A key-value pair is considered "shared" if the same key with the same value (===)
29
+ * exists in two or more objects. Only pairs unique to a single object are returned.
30
+ * When all values for a key are plain objects, the function recurses to find
31
+ * the diff subset. If the recursive result is empty, the key is excluded.
32
+ * When multiple unique pairs share the same key (different values),
33
+ * the last value wins.
34
+ *
35
+ * @template T - Type of the input objects.
36
+ * @param {T} object - The first object.
37
+ * @param {...Record<string, unknown>[]} objects - Additional objects to compare.
38
+ * @returns {Partial<T>} Object containing only key-value pairs unique to one input.
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * getObjectsDiff({ a: 1, b: 2 }, { b: 2, c: 3 });
43
+ * // { a: 1, c: 3 }
44
+ *
45
+ * getObjectsDiff({ a: { b: 1, c: 2 }, d: 3 }, { a: { b: 1, d: 4 }, d: 3 });
46
+ * // { a: { c: 2, d: 4 } }
47
+ * ```
48
+ */
49
+ var _getObjectsDiff = exports.getObjectsDiff = function getObjectsDiff(object) {
50
+ for (var _len = arguments.length, objects = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
51
+ objects[_key - 1] = arguments[_key];
52
+ }
53
+ var allObjects = [object].concat(objects);
54
+ if (allObjects.length === 1) {
55
+ return _objectSpread({}, object);
56
+ }
57
+ var allKeys = new Set();
58
+ var _iterator = _createForOfIteratorHelper(allObjects),
59
+ _step;
60
+ try {
61
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
62
+ var object_ = _step.value;
63
+ for (var _i = 0, _Object$keys = Object.keys(object_); _i < _Object$keys.length; _i++) {
64
+ var key = _Object$keys[_i];
65
+ allKeys.add(key);
66
+ }
67
+ }
68
+ } catch (err) {
69
+ _iterator.e(err);
70
+ } finally {
71
+ _iterator.f();
72
+ }
73
+ var result = {};
74
+ var _iterator2 = _createForOfIteratorHelper(allKeys),
75
+ _step2;
76
+ try {
77
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
78
+ var _key2 = _step2.value;
79
+ var values = [];
80
+ var presentIn = [];
81
+ var _iterator3 = _createForOfIteratorHelper(allObjects.entries()),
82
+ _step3;
83
+ try {
84
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
85
+ var _step3$value = _slicedToArray(_step3.value, 2),
86
+ index = _step3$value[0],
87
+ currentObject = _step3$value[1];
88
+ if (Object.hasOwn(currentObject, _key2)) {
89
+ values.push(currentObject[_key2]);
90
+ presentIn.push(index);
91
+ }
92
+ }
93
+ } catch (err) {
94
+ _iterator3.e(err);
95
+ } finally {
96
+ _iterator3.f();
97
+ }
98
+ if (values.length === 1) {
99
+ result[_key2] = values[0];
100
+ continue;
101
+ }
102
+ var allPlain = values.every(function (value) {
103
+ return (0, _isPlainObject.isPlainObject)(value);
104
+ });
105
+ if (allPlain) {
106
+ var nested = _getObjectsDiff.apply(void 0, [values[0]].concat(_toConsumableArray(values.slice(1))));
107
+ if (Object.keys(nested).length > 0) {
108
+ result[_key2] = nested;
109
+ }
110
+ continue;
111
+ }
112
+ var lastUniqueValue = void 0;
113
+ var hasUnique = false;
114
+ for (var _i2 = 0, _values = values; _i2 < _values.length; _i2++) {
115
+ var value = _values[_i2];
116
+ var count = 0;
117
+ var _iterator4 = _createForOfIteratorHelper(values),
118
+ _step4;
119
+ try {
120
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
121
+ var other = _step4.value;
122
+ if (value === other) {
123
+ count++;
124
+ }
125
+ }
126
+ } catch (err) {
127
+ _iterator4.e(err);
128
+ } finally {
129
+ _iterator4.f();
130
+ }
131
+ if (count === 1) {
132
+ lastUniqueValue = value;
133
+ hasUnique = true;
134
+ }
135
+ }
136
+ if (hasUnique) {
137
+ result[_key2] = lastUniqueValue;
138
+ }
139
+ }
140
+ } catch (err) {
141
+ _iterator2.e(err);
142
+ } finally {
143
+ _iterator2.f();
144
+ }
145
+ return result;
146
+ };
@@ -1,6 +1,12 @@
1
+ export * from "./deepClone";
2
+ export * from "./getObjectsCommon";
3
+ export * from "./getObjectsDiff";
1
4
  export * from "./has";
2
5
  export * from "./isEmpty";
6
+ export * from "./isPlainObject";
3
7
  export * from "./keyBy";
8
+ export * from "./mapKeys";
9
+ export * from "./mapValues";
4
10
  export * from "./merge";
5
11
  export * from "./mergeDeep";
6
12
  export * from "./omit";