es-toolkit 1.0.4 → 1.1.0-dev.43

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 (243) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +0 -1
  3. package/dist/array/chunk.js.map +1 -1
  4. package/dist/array/chunk.mjs +1 -1
  5. package/dist/array/difference.js.map +1 -1
  6. package/dist/array/difference.mjs +1 -1
  7. package/dist/array/differenceBy.js.map +1 -1
  8. package/dist/array/differenceBy.mjs +1 -1
  9. package/dist/array/differenceWith.js.map +1 -1
  10. package/dist/array/differenceWith.mjs +1 -1
  11. package/dist/array/drop.js.map +1 -1
  12. package/dist/array/drop.mjs +1 -1
  13. package/dist/array/dropRight.js.map +1 -1
  14. package/dist/array/dropRight.mjs +1 -1
  15. package/dist/array/dropRightWhile.js.map +1 -1
  16. package/dist/array/dropRightWhile.mjs +2 -2
  17. package/dist/array/dropWhile.js.map +1 -1
  18. package/dist/array/dropWhile.mjs +1 -1
  19. package/dist/array/groupBy.js.map +1 -1
  20. package/dist/array/groupBy.mjs +1 -1
  21. package/dist/array/index.js.map +1 -1
  22. package/dist/array/index.mjs +30 -30
  23. package/dist/array/intersection.js.map +1 -1
  24. package/dist/array/intersection.mjs +1 -1
  25. package/dist/array/intersectionBy.js.map +1 -1
  26. package/dist/array/intersectionBy.mjs +1 -1
  27. package/dist/array/intersectionWith.js.map +1 -1
  28. package/dist/array/intersectionWith.mjs +1 -1
  29. package/dist/array/partition.js.map +1 -1
  30. package/dist/array/partition.mjs +1 -1
  31. package/dist/array/sample.js.map +1 -1
  32. package/dist/array/sample.mjs +1 -1
  33. package/dist/array/shuffle.js.map +1 -1
  34. package/dist/array/shuffle.mjs +1 -1
  35. package/dist/array/take.js.map +1 -1
  36. package/dist/array/take.mjs +1 -1
  37. package/dist/array/takeRight.js.map +1 -1
  38. package/dist/array/takeRight.mjs +1 -1
  39. package/dist/array/takeRightWhile.js.map +1 -1
  40. package/dist/array/takeRightWhile.mjs +1 -1
  41. package/dist/array/takeWhile.js.map +1 -1
  42. package/dist/array/takeWhile.mjs +1 -1
  43. package/dist/array/union.js.map +1 -1
  44. package/dist/array/union.mjs +2 -2
  45. package/dist/array/unionBy.js.map +1 -1
  46. package/dist/array/unionBy.mjs +1 -1
  47. package/dist/array/unionWith.js.map +1 -1
  48. package/dist/array/unionWith.mjs +2 -2
  49. package/dist/array/uniq.js.map +1 -1
  50. package/dist/array/uniq.mjs +1 -1
  51. package/dist/array/uniqBy.js.map +1 -1
  52. package/dist/array/uniqBy.mjs +2 -2
  53. package/dist/array/uniqWith.js.map +1 -1
  54. package/dist/array/uniqWith.mjs +1 -1
  55. package/dist/array/xor.js.map +1 -1
  56. package/dist/array/xor.mjs +5 -5
  57. package/dist/array/xorBy.js.map +1 -1
  58. package/dist/array/xorBy.mjs +4 -4
  59. package/dist/array/xorWith.js.map +1 -1
  60. package/dist/array/xorWith.mjs +5 -5
  61. package/dist/array/zip.js.map +1 -1
  62. package/dist/array/zip.mjs +1 -1
  63. package/dist/array/zipWith.js.map +1 -1
  64. package/dist/array/zipWith.mjs +1 -1
  65. package/dist/{chunk-TOLR2FNF.mjs → chunk-23DC774L.mjs} +1 -1
  66. package/dist/chunk-23DC774L.mjs.map +1 -0
  67. package/dist/{chunk-PTQLD7TG.mjs → chunk-2PB2OCC6.mjs} +1 -1
  68. package/dist/chunk-2PB2OCC6.mjs.map +1 -0
  69. package/dist/{chunk-S767XFOS.mjs → chunk-3PFYAKOD.mjs} +1 -1
  70. package/dist/chunk-3PFYAKOD.mjs.map +1 -0
  71. package/dist/{chunk-NYVT33DR.mjs → chunk-6BCRFIEW.mjs} +1 -1
  72. package/dist/chunk-6BCRFIEW.mjs.map +1 -0
  73. package/dist/{chunk-VACGGQOL.mjs → chunk-6GRNTXI3.mjs} +1 -1
  74. package/dist/chunk-6GRNTXI3.mjs.map +1 -0
  75. package/dist/{chunk-SGSQKXDO.mjs → chunk-6LDIBBWQ.mjs} +2 -2
  76. package/dist/chunk-6LDIBBWQ.mjs.map +1 -0
  77. package/dist/{chunk-GJM7F3TH.mjs → chunk-7LAOIS6P.mjs} +1 -1
  78. package/dist/chunk-7LAOIS6P.mjs.map +1 -0
  79. package/dist/{chunk-724PNXPR.mjs → chunk-AFYV2UVZ.mjs} +1 -1
  80. package/dist/chunk-AFYV2UVZ.mjs.map +1 -0
  81. package/dist/{chunk-2VB6XU3I.mjs → chunk-ANJSX6WH.mjs} +1 -1
  82. package/dist/chunk-ANJSX6WH.mjs.map +1 -0
  83. package/dist/{chunk-OBMK7JO2.mjs → chunk-B5P232BA.mjs} +1 -1
  84. package/dist/chunk-B5P232BA.mjs.map +1 -0
  85. package/dist/{chunk-L4Y3G6AJ.mjs → chunk-GELVVASW.mjs} +3 -3
  86. package/dist/chunk-GELVVASW.mjs.map +1 -0
  87. package/dist/{chunk-RLDY4N3Q.mjs → chunk-GLAZTR32.mjs} +2 -2
  88. package/dist/chunk-GLAZTR32.mjs.map +1 -0
  89. package/dist/{chunk-NK2262VG.mjs → chunk-HOQRMBSB.mjs} +1 -1
  90. package/dist/chunk-HOQRMBSB.mjs.map +1 -0
  91. package/dist/{chunk-PWMHSN27.mjs → chunk-IFCX35BI.mjs} +1 -1
  92. package/dist/chunk-IFCX35BI.mjs.map +1 -0
  93. package/dist/{chunk-UZP4YX7I.mjs → chunk-J6SWM4X6.mjs} +1 -1
  94. package/dist/chunk-J6SWM4X6.mjs.map +1 -0
  95. package/dist/{chunk-QRQPLMV4.mjs → chunk-JDMFIUGM.mjs} +1 -1
  96. package/dist/chunk-JDMFIUGM.mjs.map +1 -0
  97. package/dist/{chunk-WFQ3LAHQ.mjs → chunk-KBJTBR5T.mjs} +1 -1
  98. package/dist/chunk-KBJTBR5T.mjs.map +1 -0
  99. package/dist/{chunk-5JWSGT4R.mjs → chunk-L25VRQ54.mjs} +1 -1
  100. package/dist/chunk-L25VRQ54.mjs.map +1 -0
  101. package/dist/{chunk-BAJC3BM7.mjs → chunk-L3C6TG2V.mjs} +1 -1
  102. package/dist/chunk-L3C6TG2V.mjs.map +1 -0
  103. package/dist/{chunk-2KXLTAVK.mjs → chunk-LLOAPSQ6.mjs} +1 -1
  104. package/dist/{chunk-2KXLTAVK.mjs.map → chunk-LLOAPSQ6.mjs.map} +1 -1
  105. package/dist/{chunk-NSYWEYWT.mjs → chunk-M3SHJ3LL.mjs} +1 -1
  106. package/dist/chunk-M3SHJ3LL.mjs.map +1 -0
  107. package/dist/{chunk-HQF6OFGM.mjs → chunk-OLBUAFBX.mjs} +1 -1
  108. package/dist/chunk-OLBUAFBX.mjs.map +1 -0
  109. package/dist/{chunk-35TWSMYS.mjs → chunk-OS5PZ4B4.mjs} +1 -1
  110. package/dist/{chunk-35TWSMYS.mjs.map → chunk-OS5PZ4B4.mjs.map} +1 -1
  111. package/dist/{chunk-J3NTLMAE.mjs → chunk-PHG5JCSW.mjs} +1 -1
  112. package/dist/chunk-PHG5JCSW.mjs.map +1 -0
  113. package/dist/{chunk-RU3RXBUC.mjs → chunk-PRTIPC5X.mjs} +1 -1
  114. package/dist/chunk-PRTIPC5X.mjs.map +1 -0
  115. package/dist/{chunk-EAI6NLXI.mjs → chunk-PUQLVKMB.mjs} +1 -1
  116. package/dist/chunk-PUQLVKMB.mjs.map +1 -0
  117. package/dist/{chunk-7OZZODAE.mjs → chunk-QC3SFAQJ.mjs} +4 -4
  118. package/dist/chunk-QC3SFAQJ.mjs.map +1 -0
  119. package/dist/{chunk-Z4IO7EIH.mjs → chunk-SF3V7XXM.mjs} +1 -1
  120. package/dist/chunk-SF3V7XXM.mjs.map +1 -0
  121. package/dist/{chunk-7PPND7QY.mjs → chunk-SPLO5OZW.mjs} +1 -1
  122. package/dist/chunk-SPLO5OZW.mjs.map +1 -0
  123. package/dist/{chunk-EAI4DDCQ.mjs → chunk-SQOYF647.mjs} +1 -1
  124. package/dist/chunk-SQOYF647.mjs.map +1 -0
  125. package/dist/{chunk-XW452I77.mjs → chunk-T2C2WVFL.mjs} +1 -1
  126. package/dist/chunk-T2C2WVFL.mjs.map +1 -0
  127. package/dist/{chunk-XS4ZPJMT.mjs → chunk-TCHT4HCP.mjs} +4 -4
  128. package/dist/chunk-TCHT4HCP.mjs.map +1 -0
  129. package/dist/{chunk-NEMQJ2GF.mjs → chunk-TF6N37OE.mjs} +1 -1
  130. package/dist/chunk-TF6N37OE.mjs.map +1 -0
  131. package/dist/{chunk-JMLFPGZ3.mjs → chunk-TK2EDHSP.mjs} +2 -2
  132. package/dist/chunk-TK2EDHSP.mjs.map +1 -0
  133. package/dist/{chunk-R5DNKXDI.mjs → chunk-TULUUJ3E.mjs} +4 -4
  134. package/dist/chunk-TULUUJ3E.mjs.map +1 -0
  135. package/dist/{chunk-ARWKEQMQ.mjs → chunk-UFAA5WKR.mjs} +1 -1
  136. package/dist/chunk-UFAA5WKR.mjs.map +1 -0
  137. package/dist/{chunk-UNX3KZO2.mjs → chunk-V6LXSPMF.mjs} +1 -1
  138. package/dist/chunk-V6LXSPMF.mjs.map +1 -0
  139. package/dist/{chunk-VAKCSKGR.mjs → chunk-XLO3QZVY.mjs} +3 -3
  140. package/dist/chunk-XLO3QZVY.mjs.map +1 -0
  141. package/dist/{chunk-FUWEG5ZM.mjs → chunk-Y6ZRNII6.mjs} +1 -1
  142. package/dist/chunk-Y6ZRNII6.mjs.map +1 -0
  143. package/dist/{chunk-VJGGYY4Y.mjs → chunk-YEZIGQJG.mjs} +2 -2
  144. package/dist/chunk-YEZIGQJG.mjs.map +1 -0
  145. package/dist/{chunk-LAZNLIBJ.mjs → chunk-YHY2XTJW.mjs} +1 -1
  146. package/dist/chunk-YHY2XTJW.mjs.map +1 -0
  147. package/dist/{chunk-7GWOR247.mjs → chunk-YNRYG5OB.mjs} +1 -1
  148. package/dist/chunk-YNRYG5OB.mjs.map +1 -0
  149. package/dist/{chunk-7SJHJHBN.mjs → chunk-ZBG3EYM3.mjs} +1 -1
  150. package/dist/chunk-ZBG3EYM3.mjs.map +1 -0
  151. package/dist/{chunk-YMNXRH52.mjs → chunk-ZQNAZPSK.mjs} +1 -1
  152. package/dist/chunk-ZQNAZPSK.mjs.map +1 -0
  153. package/dist/function/debounce.d.mts +3 -4
  154. package/dist/function/debounce.d.ts +3 -4
  155. package/dist/function/debounce.js +2 -2
  156. package/dist/function/debounce.js.map +1 -1
  157. package/dist/function/debounce.mjs +1 -1
  158. package/dist/function/index.js +4 -4
  159. package/dist/function/index.js.map +1 -1
  160. package/dist/function/index.mjs +3 -3
  161. package/dist/function/once.js.map +1 -1
  162. package/dist/function/once.mjs +1 -1
  163. package/dist/function/throttle.d.mts +3 -3
  164. package/dist/function/throttle.d.ts +3 -3
  165. package/dist/function/throttle.js +2 -2
  166. package/dist/function/throttle.js.map +1 -1
  167. package/dist/function/throttle.mjs +1 -1
  168. package/dist/index.js +4 -4
  169. package/dist/index.js.map +1 -1
  170. package/dist/index.mjs +44 -44
  171. package/dist/math/index.js.map +1 -1
  172. package/dist/math/index.mjs +2 -2
  173. package/dist/math/round.js.map +1 -1
  174. package/dist/math/round.mjs +1 -1
  175. package/dist/math/sum.js.map +1 -1
  176. package/dist/math/sum.mjs +1 -1
  177. package/dist/object/index.js.map +1 -1
  178. package/dist/object/index.mjs +4 -4
  179. package/dist/object/omit.js.map +1 -1
  180. package/dist/object/omit.mjs +1 -1
  181. package/dist/object/omitBy.js.map +1 -1
  182. package/dist/object/omitBy.mjs +1 -1
  183. package/dist/object/pick.js.map +1 -1
  184. package/dist/object/pick.mjs +1 -1
  185. package/dist/object/pickBy.js.map +1 -1
  186. package/dist/object/pickBy.mjs +1 -1
  187. package/dist/predicate/index.js.map +1 -1
  188. package/dist/predicate/index.mjs +4 -4
  189. package/dist/predicate/isNil.js.map +1 -1
  190. package/dist/predicate/isNil.mjs +1 -1
  191. package/dist/predicate/isNotNil.js.map +1 -1
  192. package/dist/predicate/isNotNil.mjs +1 -1
  193. package/dist/predicate/isNull.js.map +1 -1
  194. package/dist/predicate/isNull.mjs +1 -1
  195. package/dist/predicate/isUndefined.js.map +1 -1
  196. package/dist/predicate/isUndefined.mjs +1 -1
  197. package/dist/promise/delay.js.map +1 -1
  198. package/dist/promise/delay.mjs +1 -1
  199. package/dist/promise/index.js.map +1 -1
  200. package/dist/promise/index.mjs +1 -1
  201. package/package.json +3 -2
  202. package/dist/chunk-2VB6XU3I.mjs.map +0 -1
  203. package/dist/chunk-5JWSGT4R.mjs.map +0 -1
  204. package/dist/chunk-724PNXPR.mjs.map +0 -1
  205. package/dist/chunk-7GWOR247.mjs.map +0 -1
  206. package/dist/chunk-7OZZODAE.mjs.map +0 -1
  207. package/dist/chunk-7PPND7QY.mjs.map +0 -1
  208. package/dist/chunk-7SJHJHBN.mjs.map +0 -1
  209. package/dist/chunk-ARWKEQMQ.mjs.map +0 -1
  210. package/dist/chunk-BAJC3BM7.mjs.map +0 -1
  211. package/dist/chunk-EAI4DDCQ.mjs.map +0 -1
  212. package/dist/chunk-EAI6NLXI.mjs.map +0 -1
  213. package/dist/chunk-FUWEG5ZM.mjs.map +0 -1
  214. package/dist/chunk-GJM7F3TH.mjs.map +0 -1
  215. package/dist/chunk-HQF6OFGM.mjs.map +0 -1
  216. package/dist/chunk-J3NTLMAE.mjs.map +0 -1
  217. package/dist/chunk-JMLFPGZ3.mjs.map +0 -1
  218. package/dist/chunk-L4Y3G6AJ.mjs.map +0 -1
  219. package/dist/chunk-LAZNLIBJ.mjs.map +0 -1
  220. package/dist/chunk-NEMQJ2GF.mjs.map +0 -1
  221. package/dist/chunk-NK2262VG.mjs.map +0 -1
  222. package/dist/chunk-NSYWEYWT.mjs.map +0 -1
  223. package/dist/chunk-NYVT33DR.mjs.map +0 -1
  224. package/dist/chunk-OBMK7JO2.mjs.map +0 -1
  225. package/dist/chunk-PTQLD7TG.mjs.map +0 -1
  226. package/dist/chunk-PWMHSN27.mjs.map +0 -1
  227. package/dist/chunk-QRQPLMV4.mjs.map +0 -1
  228. package/dist/chunk-R5DNKXDI.mjs.map +0 -1
  229. package/dist/chunk-RLDY4N3Q.mjs.map +0 -1
  230. package/dist/chunk-RU3RXBUC.mjs.map +0 -1
  231. package/dist/chunk-S767XFOS.mjs.map +0 -1
  232. package/dist/chunk-SGSQKXDO.mjs.map +0 -1
  233. package/dist/chunk-TOLR2FNF.mjs.map +0 -1
  234. package/dist/chunk-UNX3KZO2.mjs.map +0 -1
  235. package/dist/chunk-UZP4YX7I.mjs.map +0 -1
  236. package/dist/chunk-VACGGQOL.mjs.map +0 -1
  237. package/dist/chunk-VAKCSKGR.mjs.map +0 -1
  238. package/dist/chunk-VJGGYY4Y.mjs.map +0 -1
  239. package/dist/chunk-WFQ3LAHQ.mjs.map +0 -1
  240. package/dist/chunk-XS4ZPJMT.mjs.map +0 -1
  241. package/dist/chunk-XW452I77.mjs.map +0 -1
  242. package/dist/chunk-YMNXRH52.mjs.map +0 -1
  243. package/dist/chunk-Z4IO7EIH.mjs.map +0 -1
package/dist/index.mjs CHANGED
@@ -1,144 +1,144 @@
1
1
  import "./chunk-ARZ5BDR6.mjs";
2
2
  import {
3
3
  delay
4
- } from "./chunk-7SJHJHBN.mjs";
4
+ } from "./chunk-ZBG3EYM3.mjs";
5
5
  import "./chunk-T5JCRGXA.mjs";
6
6
  import {
7
7
  omit
8
- } from "./chunk-UZP4YX7I.mjs";
8
+ } from "./chunk-J6SWM4X6.mjs";
9
9
  import {
10
10
  omitBy
11
- } from "./chunk-Z4IO7EIH.mjs";
11
+ } from "./chunk-SF3V7XXM.mjs";
12
12
  import {
13
13
  pick
14
- } from "./chunk-724PNXPR.mjs";
14
+ } from "./chunk-AFYV2UVZ.mjs";
15
15
  import {
16
16
  pickBy
17
- } from "./chunk-XW452I77.mjs";
17
+ } from "./chunk-T2C2WVFL.mjs";
18
18
  import "./chunk-MAJSPFA6.mjs";
19
19
  import {
20
20
  isNull
21
- } from "./chunk-FUWEG5ZM.mjs";
21
+ } from "./chunk-Y6ZRNII6.mjs";
22
22
  import {
23
23
  isUndefined
24
- } from "./chunk-NK2262VG.mjs";
24
+ } from "./chunk-HOQRMBSB.mjs";
25
25
  import {
26
26
  isNil
27
- } from "./chunk-WFQ3LAHQ.mjs";
27
+ } from "./chunk-KBJTBR5T.mjs";
28
28
  import {
29
29
  isNotNil
30
- } from "./chunk-YMNXRH52.mjs";
30
+ } from "./chunk-ZQNAZPSK.mjs";
31
31
  import "./chunk-IJLQVGW4.mjs";
32
32
  import {
33
33
  clamp
34
34
  } from "./chunk-RK6PRCEJ.mjs";
35
35
  import {
36
36
  round
37
- } from "./chunk-LAZNLIBJ.mjs";
37
+ } from "./chunk-YHY2XTJW.mjs";
38
38
  import {
39
39
  sum
40
- } from "./chunk-OBMK7JO2.mjs";
40
+ } from "./chunk-B5P232BA.mjs";
41
41
  import "./chunk-EJGAXTF7.mjs";
42
42
  import {
43
43
  xorBy
44
- } from "./chunk-R5DNKXDI.mjs";
44
+ } from "./chunk-TULUUJ3E.mjs";
45
45
  import {
46
46
  xorWith
47
- } from "./chunk-XS4ZPJMT.mjs";
47
+ } from "./chunk-TCHT4HCP.mjs";
48
48
  import {
49
49
  zip
50
- } from "./chunk-5JWSGT4R.mjs";
50
+ } from "./chunk-L25VRQ54.mjs";
51
51
  import {
52
52
  zipWith
53
- } from "./chunk-RU3RXBUC.mjs";
53
+ } from "./chunk-PRTIPC5X.mjs";
54
54
  import {
55
55
  takeWhile
56
- } from "./chunk-2KXLTAVK.mjs";
56
+ } from "./chunk-LLOAPSQ6.mjs";
57
57
  import {
58
58
  unionBy
59
- } from "./chunk-7PPND7QY.mjs";
59
+ } from "./chunk-SPLO5OZW.mjs";
60
60
  import {
61
61
  unionWith
62
- } from "./chunk-VJGGYY4Y.mjs";
62
+ } from "./chunk-YEZIGQJG.mjs";
63
63
  import {
64
64
  uniqBy
65
- } from "./chunk-JMLFPGZ3.mjs";
65
+ } from "./chunk-TK2EDHSP.mjs";
66
66
  import {
67
67
  uniqWith
68
- } from "./chunk-EAI4DDCQ.mjs";
68
+ } from "./chunk-SQOYF647.mjs";
69
69
  import {
70
70
  xor
71
- } from "./chunk-7OZZODAE.mjs";
71
+ } from "./chunk-QC3SFAQJ.mjs";
72
72
  import {
73
73
  union
74
- } from "./chunk-RLDY4N3Q.mjs";
74
+ } from "./chunk-GLAZTR32.mjs";
75
75
  import {
76
76
  uniq
77
- } from "./chunk-QRQPLMV4.mjs";
77
+ } from "./chunk-JDMFIUGM.mjs";
78
78
  import {
79
79
  intersectionBy
80
- } from "./chunk-2VB6XU3I.mjs";
80
+ } from "./chunk-ANJSX6WH.mjs";
81
81
  import {
82
82
  intersectionWith
83
- } from "./chunk-GJM7F3TH.mjs";
83
+ } from "./chunk-7LAOIS6P.mjs";
84
84
  import {
85
85
  partition
86
- } from "./chunk-NEMQJ2GF.mjs";
86
+ } from "./chunk-TF6N37OE.mjs";
87
87
  import {
88
88
  sample
89
- } from "./chunk-J3NTLMAE.mjs";
89
+ } from "./chunk-PHG5JCSW.mjs";
90
90
  import {
91
91
  shuffle
92
- } from "./chunk-TOLR2FNF.mjs";
92
+ } from "./chunk-23DC774L.mjs";
93
93
  import {
94
94
  take
95
- } from "./chunk-HQF6OFGM.mjs";
95
+ } from "./chunk-OLBUAFBX.mjs";
96
96
  import {
97
97
  takeRight
98
- } from "./chunk-BAJC3BM7.mjs";
98
+ } from "./chunk-L3C6TG2V.mjs";
99
99
  import {
100
100
  takeRightWhile
101
- } from "./chunk-PWMHSN27.mjs";
101
+ } from "./chunk-IFCX35BI.mjs";
102
102
  import {
103
103
  differenceWith
104
- } from "./chunk-NSYWEYWT.mjs";
104
+ } from "./chunk-M3SHJ3LL.mjs";
105
105
  import {
106
106
  drop
107
- } from "./chunk-NYVT33DR.mjs";
107
+ } from "./chunk-6BCRFIEW.mjs";
108
108
  import {
109
109
  dropRight
110
- } from "./chunk-VACGGQOL.mjs";
110
+ } from "./chunk-6GRNTXI3.mjs";
111
111
  import {
112
112
  dropRightWhile
113
- } from "./chunk-SGSQKXDO.mjs";
113
+ } from "./chunk-6LDIBBWQ.mjs";
114
114
  import {
115
115
  dropWhile
116
- } from "./chunk-S767XFOS.mjs";
116
+ } from "./chunk-3PFYAKOD.mjs";
117
117
  import {
118
118
  groupBy
119
- } from "./chunk-UNX3KZO2.mjs";
119
+ } from "./chunk-V6LXSPMF.mjs";
120
120
  import {
121
121
  intersection
122
- } from "./chunk-7GWOR247.mjs";
122
+ } from "./chunk-YNRYG5OB.mjs";
123
123
  import "./chunk-SYQTG4N4.mjs";
124
124
  import {
125
125
  debounce
126
- } from "./chunk-L4Y3G6AJ.mjs";
126
+ } from "./chunk-GELVVASW.mjs";
127
127
  import {
128
128
  once
129
- } from "./chunk-ARWKEQMQ.mjs";
129
+ } from "./chunk-UFAA5WKR.mjs";
130
130
  import {
131
131
  throttle
132
- } from "./chunk-VAKCSKGR.mjs";
132
+ } from "./chunk-XLO3QZVY.mjs";
133
133
  import {
134
134
  chunk
135
- } from "./chunk-35TWSMYS.mjs";
135
+ } from "./chunk-OS5PZ4B4.mjs";
136
136
  import {
137
137
  difference
138
- } from "./chunk-PTQLD7TG.mjs";
138
+ } from "./chunk-2PB2OCC6.mjs";
139
139
  import {
140
140
  differenceBy
141
- } from "./chunk-EAI6NLXI.mjs";
141
+ } from "./chunk-PUQLVKMB.mjs";
142
142
  import "./chunk-2MM5EJJX.mjs";
143
143
  export {
144
144
  chunk,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/math/index.ts","../../src/math/clamp.ts","../../src/math/round.ts","../../src/math/sum.ts"],"sourcesContent":["export { clamp } from './clamp';\nexport { round } from './round';\nexport { sum } from './sum';","/**\n * Clamps a number within the inclusive lower and upper bounds.\n *\n * This function takes a number and two bounds, and returns the number clamped within the specified bounds.\n * If only one bound is provided, it returns the minimum of the value and the bound.\n *\n * @param {number} value - The number to clamp.\n * @param {number} minimum - The minimum bound to clamp the number.\n * @param {number} maximum - The maximum bound to clamp the number.\n * @returns {number} The clamped number within the specified bounds.\n *\n * @example\n * * const result1 = clamp(10, 5); // result1 will be 5, as 10 is clamped to the bound 5\n * const result2 = clamp(10, 5, 15); // result2 will be 10, as it is within the bounds 5 and 15\n * const result3 = clamp(2, 5, 15); // result3 will be 5, as 2 is clamped to the lower bound 5\n * const result4 = clamp(20, 5, 15); // result4 will be 15, as 20 is clamped to the upper bound 15\n */\nexport function clamp(value: number, maximum: number): number;\nexport function clamp(value: number, minimum: number, maximum: number): number;\nexport function clamp(value: number, bound1: number, bound2?: number): number {\n if (bound2 == null) {\n return Math.min(value, bound1);\n }\n\n return Math.min(Math.max(value, bound1), bound2);\n}\n","/**\n * Rounds a number to a specified precision.\n * \n * This function takes a number and an optional precision value, and returns the number rounded \n * to the specified number of decimal places.\n *\n * @param {number} value - The number to round.\n * @param {number} [precision=0] - The number of decimal places to round to. Defaults to 0.\n * @returns {number} The rounded number.\n *\n * @example\n * * const result1 = round(1.2345); // result1 will be 1\n * const result2 = round(1.2345, 2); // result2 will be 1.23\n * const result3 = round(1.2345, 3); // result3 will be 1.235\n */\nexport function round(value: number, precision: number = 0): number {\n const multiplier = Math.pow(10, precision);\n return Math.round(value * multiplier) / multiplier;\n}\n","/**\n * Calculates the sum of an array of numbers.\n * \n * This function takes an array of numbers and returns the sum of all the elements in the array.\n *\n * @param {number[]} nums - An array of numbers to be summed.\n * @returns {number} The sum of all the numbers in the array.\n *\n * @example\n * * const numbers = [1, 2, 3, 4, 5];\n * const result = sum(numbers);\n * // result will be 15\n */\nexport function sum(nums: number[]): number {\n let result = 0;\n\n for (const num of nums) {\n result += num;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmBO,SAAS,MAAM,OAAe,QAAgB,QAAyB;AAC5E,MAAI,UAAU,MAAM;AAClB,WAAO,KAAK,IAAI,OAAO,MAAM;AAAA,EAC/B;AAEA,SAAO,KAAK,IAAI,KAAK,IAAI,OAAO,MAAM,GAAG,MAAM;AACjD;;;ACVO,SAAS,MAAM,OAAe,YAAoB,GAAW;AAClE,QAAM,aAAa,KAAK,IAAI,IAAI,SAAS;AACzC,SAAO,KAAK,MAAM,QAAQ,UAAU,IAAI;AAC1C;;;ACLO,SAAS,IAAI,MAAwB;AAC1C,MAAI,SAAS;AAEb,aAAW,OAAO,MAAM;AACtB,cAAU;AAAA,EACZ;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/math/index.ts","../../src/math/clamp.ts","../../src/math/round.ts","../../src/math/sum.ts"],"sourcesContent":["export { clamp } from './clamp';\nexport { round } from './round';\nexport { sum } from './sum';\n","/**\n * Clamps a number within the inclusive lower and upper bounds.\n *\n * This function takes a number and two bounds, and returns the number clamped within the specified bounds.\n * If only one bound is provided, it returns the minimum of the value and the bound.\n *\n * @param {number} value - The number to clamp.\n * @param {number} minimum - The minimum bound to clamp the number.\n * @param {number} maximum - The maximum bound to clamp the number.\n * @returns {number} The clamped number within the specified bounds.\n *\n * @example\n * * const result1 = clamp(10, 5); // result1 will be 5, as 10 is clamped to the bound 5\n * const result2 = clamp(10, 5, 15); // result2 will be 10, as it is within the bounds 5 and 15\n * const result3 = clamp(2, 5, 15); // result3 will be 5, as 2 is clamped to the lower bound 5\n * const result4 = clamp(20, 5, 15); // result4 will be 15, as 20 is clamped to the upper bound 15\n */\nexport function clamp(value: number, maximum: number): number;\nexport function clamp(value: number, minimum: number, maximum: number): number;\nexport function clamp(value: number, bound1: number, bound2?: number): number {\n if (bound2 == null) {\n return Math.min(value, bound1);\n }\n\n return Math.min(Math.max(value, bound1), bound2);\n}\n","/**\n * Rounds a number to a specified precision.\n *\n * This function takes a number and an optional precision value, and returns the number rounded\n * to the specified number of decimal places.\n *\n * @param {number} value - The number to round.\n * @param {number} [precision=0] - The number of decimal places to round to. Defaults to 0.\n * @returns {number} The rounded number.\n *\n * @example\n * * const result1 = round(1.2345); // result1 will be 1\n * const result2 = round(1.2345, 2); // result2 will be 1.23\n * const result3 = round(1.2345, 3); // result3 will be 1.235\n */\nexport function round(value: number, precision: number = 0): number {\n const multiplier = Math.pow(10, precision);\n return Math.round(value * multiplier) / multiplier;\n}\n","/**\n * Calculates the sum of an array of numbers.\n *\n * This function takes an array of numbers and returns the sum of all the elements in the array.\n *\n * @param {number[]} nums - An array of numbers to be summed.\n * @returns {number} The sum of all the numbers in the array.\n *\n * @example\n * * const numbers = [1, 2, 3, 4, 5];\n * const result = sum(numbers);\n * // result will be 15\n */\nexport function sum(nums: number[]): number {\n let result = 0;\n\n for (const num of nums) {\n result += num;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmBO,SAAS,MAAM,OAAe,QAAgB,QAAyB;AAC5E,MAAI,UAAU,MAAM;AAClB,WAAO,KAAK,IAAI,OAAO,MAAM;AAAA,EAC/B;AAEA,SAAO,KAAK,IAAI,KAAK,IAAI,OAAO,MAAM,GAAG,MAAM;AACjD;;;ACVO,SAAS,MAAM,OAAe,YAAoB,GAAW;AAClE,QAAM,aAAa,KAAK,IAAI,IAAI,SAAS;AACzC,SAAO,KAAK,MAAM,QAAQ,UAAU,IAAI;AAC1C;;;ACLO,SAAS,IAAI,MAAwB;AAC1C,MAAI,SAAS;AAEb,aAAW,OAAO,MAAM;AACtB,cAAU;AAAA,EACZ;AAEA,SAAO;AACT;","names":[]}
@@ -4,10 +4,10 @@ import {
4
4
  } from "../chunk-RK6PRCEJ.mjs";
5
5
  import {
6
6
  round
7
- } from "../chunk-LAZNLIBJ.mjs";
7
+ } from "../chunk-YHY2XTJW.mjs";
8
8
  import {
9
9
  sum
10
- } from "../chunk-OBMK7JO2.mjs";
10
+ } from "../chunk-B5P232BA.mjs";
11
11
  import "../chunk-2MM5EJJX.mjs";
12
12
  export {
13
13
  clamp,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/math/round.ts"],"sourcesContent":["/**\n * Rounds a number to a specified precision.\n * \n * This function takes a number and an optional precision value, and returns the number rounded \n * to the specified number of decimal places.\n *\n * @param {number} value - The number to round.\n * @param {number} [precision=0] - The number of decimal places to round to. Defaults to 0.\n * @returns {number} The rounded number.\n *\n * @example\n * * const result1 = round(1.2345); // result1 will be 1\n * const result2 = round(1.2345, 2); // result2 will be 1.23\n * const result3 = round(1.2345, 3); // result3 will be 1.235\n */\nexport function round(value: number, precision: number = 0): number {\n const multiplier = Math.pow(10, precision);\n return Math.round(value * multiplier) / multiplier;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,MAAM,OAAe,YAAoB,GAAW;AAClE,QAAM,aAAa,KAAK,IAAI,IAAI,SAAS;AACzC,SAAO,KAAK,MAAM,QAAQ,UAAU,IAAI;AAC1C;","names":[]}
1
+ {"version":3,"sources":["../../src/math/round.ts"],"sourcesContent":["/**\n * Rounds a number to a specified precision.\n *\n * This function takes a number and an optional precision value, and returns the number rounded\n * to the specified number of decimal places.\n *\n * @param {number} value - The number to round.\n * @param {number} [precision=0] - The number of decimal places to round to. Defaults to 0.\n * @returns {number} The rounded number.\n *\n * @example\n * * const result1 = round(1.2345); // result1 will be 1\n * const result2 = round(1.2345, 2); // result2 will be 1.23\n * const result3 = round(1.2345, 3); // result3 will be 1.235\n */\nexport function round(value: number, precision: number = 0): number {\n const multiplier = Math.pow(10, precision);\n return Math.round(value * multiplier) / multiplier;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,MAAM,OAAe,YAAoB,GAAW;AAClE,QAAM,aAAa,KAAK,IAAI,IAAI,SAAS;AACzC,SAAO,KAAK,MAAM,QAAQ,UAAU,IAAI;AAC1C;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  round
3
- } from "../chunk-LAZNLIBJ.mjs";
3
+ } from "../chunk-YHY2XTJW.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  round
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/math/sum.ts"],"sourcesContent":["/**\n * Calculates the sum of an array of numbers.\n * \n * This function takes an array of numbers and returns the sum of all the elements in the array.\n *\n * @param {number[]} nums - An array of numbers to be summed.\n * @returns {number} The sum of all the numbers in the array.\n *\n * @example\n * * const numbers = [1, 2, 3, 4, 5];\n * const result = sum(numbers);\n * // result will be 15\n */\nexport function sum(nums: number[]): number {\n let result = 0;\n\n for (const num of nums) {\n result += num;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaO,SAAS,IAAI,MAAwB;AAC1C,MAAI,SAAS;AAEb,aAAW,OAAO,MAAM;AACtB,cAAU;AAAA,EACZ;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/math/sum.ts"],"sourcesContent":["/**\n * Calculates the sum of an array of numbers.\n *\n * This function takes an array of numbers and returns the sum of all the elements in the array.\n *\n * @param {number[]} nums - An array of numbers to be summed.\n * @returns {number} The sum of all the numbers in the array.\n *\n * @example\n * * const numbers = [1, 2, 3, 4, 5];\n * const result = sum(numbers);\n * // result will be 15\n */\nexport function sum(nums: number[]): number {\n let result = 0;\n\n for (const num of nums) {\n result += num;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaO,SAAS,IAAI,MAAwB;AAC1C,MAAI,SAAS;AAEb,aAAW,OAAO,MAAM;AACtB,cAAU;AAAA,EACZ;AAEA,SAAO;AACT;","names":[]}
package/dist/math/sum.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sum
3
- } from "../chunk-OBMK7JO2.mjs";
3
+ } from "../chunk-B5P232BA.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  sum
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/object/index.ts","../../src/object/omit.ts","../../src/object/omitBy.ts","../../src/object/pick.ts","../../src/object/pickBy.ts"],"sourcesContent":["export { omit } from './omit';\nexport { omitBy } from './omitBy';\nexport { pick } from './pick';\nexport { pickBy } from './pickBy';","/**\n * Creates a new object with specified keys omitted.\n *\n * This function takes an object and an array of keys, and returns a new object that \n * excludes the properties corresponding to the specified keys.\n *\n * @param {T} obj - The object to omit keys from.\n * @param {K[]} keys - An array of keys to be omitted from the object.\n * @returns {Omit<T, K>} A new object with the specified keys omitted.\n *\n * @example\n * * const obj = { a: 1, b: 2, c: 3 };\n * const result = omit(obj, ['b', 'c']);\n * // result will be { a: 1 }\n */\nexport function omit<T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {\n const result = { ...obj };\n\n for (const key of keys) {\n delete result[key];\n }\n\n return result as Omit<T, K>;\n}\n","/**\n * Creates a new object composed of the properties that do not satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that \n * includes only the properties for which the predicate function returns false.\n *\n * @param {T} obj - The object to omit properties from.\n * @param {(value: T[string], key: string) => boolean} shouldOmit - A predicate function that determines \n * whether a property should be omitted. It takes the property's key and value as arguments and returns `true` \n * if the property should be omitted, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that do not satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'omit', c: 3 };\n * const shouldOmit = (key, value) => typeof value === 'string';\n * const result = omitBy(obj, shouldOmit);\n * // result will be { a: 1, c: 3 }\n */\nexport function omitBy<T extends Record<string, any>>(obj: T, shouldOmit: (value: T[keyof T], key: string) => boolean): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (shouldOmit(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}","/**\n * Creates a new object composed of the picked object properties.\n *\n * This function takes an object and an array of keys, and returns a new object that \n * includes only the properties corresponding to the specified keys.\n *\n * @param {T} obj - The object to pick keys from.\n * @param {K[]} keys - An array of keys to be picked from the object.\n * @returns {Pick<T, K>} A new object with the specified keys picked.\n *\n * @example\n * * const obj = { a: 1, b: 2, c: 3 };\n * const result = pick(obj, ['a', 'c']);\n * // result will be { a: 1, c: 3 }\n */\nexport function pick<T, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n\n for (const key of keys) {\n result[key] = obj[key];\n }\n\n return result;\n}\n","/**\n * Creates a new object composed of the properties that satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that \n * includes only the properties for which the predicate function returns true.\n *\n * @param {T} obj - The object to pick properties from.\n * @param {(value: T[keyof T], key: string) => boolean} shouldPick - A predicate function that determines \n * whether a property should be picked. It takes the property's key and value as arguments and returns `true` \n * if the property should be picked, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'pick', c: 3 };\n * const shouldPick = (value) => typeof value === 'string';\n * const result = pickBy(obj, shouldPick);\n * // result will be { b: 'pick' }\n */\nexport function pickBy<T extends Record<string, any>>(obj: T, shouldPick: (value: T[keyof T], key: string) => boolean): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (!shouldPick(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACeO,SAAS,KAA2B,KAAQ,MAAuB;AACxE,QAAM,SAAS,mBAAK;AAEpB,aAAW,OAAO,MAAM;AACtB,WAAO,OAAO,GAAG;AAAA,EACnB;AAEA,SAAO;AACT;;;ACLO,SAAS,OAAsC,KAAQ,YAAqE;AACjI,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,WAAW,OAAO,GAAG,GAAG;AAC1B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;;;ACfO,SAAS,KAA2B,KAAQ,MAAuB;AACxE,QAAM,SAAS,CAAC;AAEhB,aAAW,OAAO,MAAM;AACtB,WAAO,GAAG,IAAI,IAAI,GAAG;AAAA,EACvB;AAEA,SAAO;AACT;;;ACLO,SAAS,OAAsC,KAAQ,YAAqE;AACjI,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,CAAC,WAAW,OAAO,GAAG,GAAG;AAC3B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/object/index.ts","../../src/object/omit.ts","../../src/object/omitBy.ts","../../src/object/pick.ts","../../src/object/pickBy.ts"],"sourcesContent":["export { omit } from './omit';\nexport { omitBy } from './omitBy';\nexport { pick } from './pick';\nexport { pickBy } from './pickBy';\n","/**\n * Creates a new object with specified keys omitted.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * excludes the properties corresponding to the specified keys.\n *\n * @param {T} obj - The object to omit keys from.\n * @param {K[]} keys - An array of keys to be omitted from the object.\n * @returns {Omit<T, K>} A new object with the specified keys omitted.\n *\n * @example\n * * const obj = { a: 1, b: 2, c: 3 };\n * const result = omit(obj, ['b', 'c']);\n * // result will be { a: 1 }\n */\nexport function omit<T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {\n const result = { ...obj };\n\n for (const key of keys) {\n delete result[key];\n }\n\n return result as Omit<T, K>;\n}\n","/**\n * Creates a new object composed of the properties that do not satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns false.\n *\n * @param {T} obj - The object to omit properties from.\n * @param {(value: T[string], key: string) => boolean} shouldOmit - A predicate function that determines\n * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`\n * if the property should be omitted, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that do not satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'omit', c: 3 };\n * const shouldOmit = (key, value) => typeof value === 'string';\n * const result = omitBy(obj, shouldOmit);\n * // result will be { a: 1, c: 3 }\n */\nexport function omitBy<T extends Record<string, any>>(\n obj: T,\n shouldOmit: (value: T[keyof T], key: string) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (shouldOmit(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n","/**\n * Creates a new object composed of the picked object properties.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * includes only the properties corresponding to the specified keys.\n *\n * @param {T} obj - The object to pick keys from.\n * @param {K[]} keys - An array of keys to be picked from the object.\n * @returns {Pick<T, K>} A new object with the specified keys picked.\n *\n * @example\n * * const obj = { a: 1, b: 2, c: 3 };\n * const result = pick(obj, ['a', 'c']);\n * // result will be { a: 1, c: 3 }\n */\nexport function pick<T, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n\n for (const key of keys) {\n result[key] = obj[key];\n }\n\n return result;\n}\n","/**\n * Creates a new object composed of the properties that satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns true.\n *\n * @param {T} obj - The object to pick properties from.\n * @param {(value: T[keyof T], key: string) => boolean} shouldPick - A predicate function that determines\n * whether a property should be picked. It takes the property's key and value as arguments and returns `true`\n * if the property should be picked, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'pick', c: 3 };\n * const shouldPick = (value) => typeof value === 'string';\n * const result = pickBy(obj, shouldPick);\n * // result will be { b: 'pick' }\n */\nexport function pickBy<T extends Record<string, any>>(\n obj: T,\n shouldPick: (value: T[keyof T], key: string) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (!shouldPick(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACeO,SAAS,KAA2B,KAAQ,MAAuB;AACxE,QAAM,SAAS,mBAAK;AAEpB,aAAW,OAAO,MAAM;AACtB,WAAO,OAAO,GAAG;AAAA,EACnB;AAEA,SAAO;AACT;;;ACLO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,WAAW,OAAO,GAAG,GAAG;AAC1B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;;;AClBO,SAAS,KAA2B,KAAQ,MAAuB;AACxE,QAAM,SAAS,CAAC;AAEhB,aAAW,OAAO,MAAM;AACtB,WAAO,GAAG,IAAI,IAAI,GAAG;AAAA,EACvB;AAEA,SAAO;AACT;;;ACLO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,CAAC,WAAW,OAAO,GAAG,GAAG;AAC3B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
@@ -1,16 +1,16 @@
1
1
  import "../chunk-T5JCRGXA.mjs";
2
2
  import {
3
3
  omit
4
- } from "../chunk-UZP4YX7I.mjs";
4
+ } from "../chunk-J6SWM4X6.mjs";
5
5
  import {
6
6
  omitBy
7
- } from "../chunk-Z4IO7EIH.mjs";
7
+ } from "../chunk-SF3V7XXM.mjs";
8
8
  import {
9
9
  pick
10
- } from "../chunk-724PNXPR.mjs";
10
+ } from "../chunk-AFYV2UVZ.mjs";
11
11
  import {
12
12
  pickBy
13
- } from "../chunk-XW452I77.mjs";
13
+ } from "../chunk-T2C2WVFL.mjs";
14
14
  import "../chunk-2MM5EJJX.mjs";
15
15
  export {
16
16
  omit,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/object/omit.ts"],"sourcesContent":["/**\n * Creates a new object with specified keys omitted.\n *\n * This function takes an object and an array of keys, and returns a new object that \n * excludes the properties corresponding to the specified keys.\n *\n * @param {T} obj - The object to omit keys from.\n * @param {K[]} keys - An array of keys to be omitted from the object.\n * @returns {Omit<T, K>} A new object with the specified keys omitted.\n *\n * @example\n * * const obj = { a: 1, b: 2, c: 3 };\n * const result = omit(obj, ['b', 'c']);\n * // result will be { a: 1 }\n */\nexport function omit<T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {\n const result = { ...obj };\n\n for (const key of keys) {\n delete result[key];\n }\n\n return result as Omit<T, K>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,KAA2B,KAAQ,MAAuB;AACxE,QAAM,SAAS,mBAAK;AAEpB,aAAW,OAAO,MAAM;AACtB,WAAO,OAAO,GAAG;AAAA,EACnB;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/object/omit.ts"],"sourcesContent":["/**\n * Creates a new object with specified keys omitted.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * excludes the properties corresponding to the specified keys.\n *\n * @param {T} obj - The object to omit keys from.\n * @param {K[]} keys - An array of keys to be omitted from the object.\n * @returns {Omit<T, K>} A new object with the specified keys omitted.\n *\n * @example\n * * const obj = { a: 1, b: 2, c: 3 };\n * const result = omit(obj, ['b', 'c']);\n * // result will be { a: 1 }\n */\nexport function omit<T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {\n const result = { ...obj };\n\n for (const key of keys) {\n delete result[key];\n }\n\n return result as Omit<T, K>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,KAA2B,KAAQ,MAAuB;AACxE,QAAM,SAAS,mBAAK;AAEpB,aAAW,OAAO,MAAM;AACtB,WAAO,OAAO,GAAG;AAAA,EACnB;AAEA,SAAO;AACT;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  omit
3
- } from "../chunk-UZP4YX7I.mjs";
3
+ } from "../chunk-J6SWM4X6.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  omit
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/object/omitBy.ts"],"sourcesContent":["/**\n * Creates a new object composed of the properties that do not satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that \n * includes only the properties for which the predicate function returns false.\n *\n * @param {T} obj - The object to omit properties from.\n * @param {(value: T[string], key: string) => boolean} shouldOmit - A predicate function that determines \n * whether a property should be omitted. It takes the property's key and value as arguments and returns `true` \n * if the property should be omitted, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that do not satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'omit', c: 3 };\n * const shouldOmit = (key, value) => typeof value === 'string';\n * const result = omitBy(obj, shouldOmit);\n * // result will be { a: 1, c: 3 }\n */\nexport function omitBy<T extends Record<string, any>>(obj: T, shouldOmit: (value: T[keyof T], key: string) => boolean): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (shouldOmit(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBO,SAAS,OAAsC,KAAQ,YAAqE;AACjI,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,WAAW,OAAO,GAAG,GAAG;AAC1B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/object/omitBy.ts"],"sourcesContent":["/**\n * Creates a new object composed of the properties that do not satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns false.\n *\n * @param {T} obj - The object to omit properties from.\n * @param {(value: T[string], key: string) => boolean} shouldOmit - A predicate function that determines\n * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`\n * if the property should be omitted, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that do not satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'omit', c: 3 };\n * const shouldOmit = (key, value) => typeof value === 'string';\n * const result = omitBy(obj, shouldOmit);\n * // result will be { a: 1, c: 3 }\n */\nexport function omitBy<T extends Record<string, any>>(\n obj: T,\n shouldOmit: (value: T[keyof T], key: string) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (shouldOmit(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,WAAW,OAAO,GAAG,GAAG;AAC1B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  omitBy
3
- } from "../chunk-Z4IO7EIH.mjs";
3
+ } from "../chunk-SF3V7XXM.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  omitBy
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/object/pick.ts"],"sourcesContent":["/**\n * Creates a new object composed of the picked object properties.\n *\n * This function takes an object and an array of keys, and returns a new object that \n * includes only the properties corresponding to the specified keys.\n *\n * @param {T} obj - The object to pick keys from.\n * @param {K[]} keys - An array of keys to be picked from the object.\n * @returns {Pick<T, K>} A new object with the specified keys picked.\n *\n * @example\n * * const obj = { a: 1, b: 2, c: 3 };\n * const result = pick(obj, ['a', 'c']);\n * // result will be { a: 1, c: 3 }\n */\nexport function pick<T, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n\n for (const key of keys) {\n result[key] = obj[key];\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,KAA2B,KAAQ,MAAuB;AACxE,QAAM,SAAS,CAAC;AAEhB,aAAW,OAAO,MAAM;AACtB,WAAO,GAAG,IAAI,IAAI,GAAG;AAAA,EACvB;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/object/pick.ts"],"sourcesContent":["/**\n * Creates a new object composed of the picked object properties.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * includes only the properties corresponding to the specified keys.\n *\n * @param {T} obj - The object to pick keys from.\n * @param {K[]} keys - An array of keys to be picked from the object.\n * @returns {Pick<T, K>} A new object with the specified keys picked.\n *\n * @example\n * * const obj = { a: 1, b: 2, c: 3 };\n * const result = pick(obj, ['a', 'c']);\n * // result will be { a: 1, c: 3 }\n */\nexport function pick<T, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n\n for (const key of keys) {\n result[key] = obj[key];\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,KAA2B,KAAQ,MAAuB;AACxE,QAAM,SAAS,CAAC;AAEhB,aAAW,OAAO,MAAM;AACtB,WAAO,GAAG,IAAI,IAAI,GAAG;AAAA,EACvB;AAEA,SAAO;AACT;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pick
3
- } from "../chunk-724PNXPR.mjs";
3
+ } from "../chunk-AFYV2UVZ.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  pick
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/object/pickBy.ts"],"sourcesContent":["/**\n * Creates a new object composed of the properties that satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that \n * includes only the properties for which the predicate function returns true.\n *\n * @param {T} obj - The object to pick properties from.\n * @param {(value: T[keyof T], key: string) => boolean} shouldPick - A predicate function that determines \n * whether a property should be picked. It takes the property's key and value as arguments and returns `true` \n * if the property should be picked, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'pick', c: 3 };\n * const shouldPick = (value) => typeof value === 'string';\n * const result = pickBy(obj, shouldPick);\n * // result will be { b: 'pick' }\n */\nexport function pickBy<T extends Record<string, any>>(obj: T, shouldPick: (value: T[keyof T], key: string) => boolean): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (!shouldPick(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBO,SAAS,OAAsC,KAAQ,YAAqE;AACjI,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,CAAC,WAAW,OAAO,GAAG,GAAG;AAC3B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/object/pickBy.ts"],"sourcesContent":["/**\n * Creates a new object composed of the properties that satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns true.\n *\n * @param {T} obj - The object to pick properties from.\n * @param {(value: T[keyof T], key: string) => boolean} shouldPick - A predicate function that determines\n * whether a property should be picked. It takes the property's key and value as arguments and returns `true`\n * if the property should be picked, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'pick', c: 3 };\n * const shouldPick = (value) => typeof value === 'string';\n * const result = pickBy(obj, shouldPick);\n * // result will be { b: 'pick' }\n */\nexport function pickBy<T extends Record<string, any>>(\n obj: T,\n shouldPick: (value: T[keyof T], key: string) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (!shouldPick(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,CAAC,WAAW,OAAO,GAAG,GAAG;AAC3B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pickBy
3
- } from "../chunk-XW452I77.mjs";
3
+ } from "../chunk-T2C2WVFL.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  pickBy
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/predicate/index.ts","../../src/predicate/isNil.ts","../../src/predicate/isNotNil.ts","../../src/predicate/isNull.ts","../../src/predicate/isUndefined.ts"],"sourcesContent":["export { isNil } from './isNil';\nexport { isNotNil } from './isNotNil';\nexport { isNull } from './isNull';\nexport { isUndefined } from './isUndefined';","/**\n * Checks if a given value is null or undefined.\n * \n * This function tests whether the provided value is either `null` or `undefined`. \n * It returns `true` if the value is `null` or `undefined`, and `false` otherwise.\n * \n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null` or `undefined`.\n *\n * @param {unknown} x - The value to test for null or undefined.\n * @returns {boolean} `true` if the value is null or undefined, `false` otherwise.\n *\n * @example\n * * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n * const result1 = isNil(value1); // true\n * const result2 = isNil(value2); // true\n * const result3 = isNil(value3); // false\n */\nexport function isNil(x: unknown): x is null | undefined {\n return x === null || x === undefined;\n}","/**\n * Checks if the given value is not null nor undefined.\n * \n * The main use of this function is to be used with TypeScript as a type predicate.\n *\n * @param {T | null | undefined} x - The value to test if it is not null nor undefined.\n * @returns {x is T} True if the value is not null nor undefined, false otherwise.\n *\n * @example\n * // Here the type of `arr` is (number | undefined)[]\n * const arr = [1, undefined, 3];\n * // Here the type of `result` is number[]\n * const result = arr.filter(isNotNil);\n * // result will be [1, 3]\n */\nexport function isNotNil<T>(x: T | null | undefined): x is T {\n return x !== null && x !== undefined;\n}\n","/**\n * Checks if the given value is null.\n *\n * This function tests whether the provided value is strictly equal to `null`. \n * It returns `true` if the value is `null`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null`.\n * \n * @param {unknown} x - The value to test if it is null.\n * @returns {x is null} True if the value is null, false otherwise.\n *\n * @example\n * * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n * \n * console.log(isNull(value1)); // true\n * console.log(isNull(value2)); // false\n * console.log(isNull(value3)); // false\n */\nexport function isNull(x: unknown): x is null {\n return x === null;\n}\n","/**\n * Checks if the given value is undefined.\n *\n * This function tests whether the provided value is strictly equal to `undefined`. \n * It returns `true` if the value is `undefined`, and `false` otherwise.\n * \n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `undefined`.\n *\n * @param {unknown} x - The value to test if it is undefined.\n * @returns {x is undefined} true if the value is undefined, false otherwise.\n *\n * @example\n * * const value1 = undefined;\n * const value2 = null;\n * const value3 = 42;\n * \n * console.log(isUndefined(value1)); // true\n * console.log(isUndefined(value2)); // false\n * console.log(isUndefined(value3)); // false\n */\nexport function isUndefined(x: unknown): x is undefined {\n return x === undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmBO,SAAS,MAAM,GAAmC;AACvD,SAAO,MAAM,QAAQ,MAAM;AAC7B;;;ACNO,SAAS,SAAY,GAAiC;AAC3D,SAAO,MAAM,QAAQ,MAAM;AAC7B;;;ACGO,SAAS,OAAO,GAAuB;AAC5C,SAAO,MAAM;AACf;;;ACFO,SAAS,YAAY,GAA4B;AACtD,SAAO,MAAM;AACf;","names":[]}
1
+ {"version":3,"sources":["../../src/predicate/index.ts","../../src/predicate/isNil.ts","../../src/predicate/isNotNil.ts","../../src/predicate/isNull.ts","../../src/predicate/isUndefined.ts"],"sourcesContent":["export { isNil } from './isNil';\nexport { isNotNil } from './isNotNil';\nexport { isNull } from './isNull';\nexport { isUndefined } from './isUndefined';\n","/**\n * Checks if a given value is null or undefined.\n *\n * This function tests whether the provided value is either `null` or `undefined`.\n * It returns `true` if the value is `null` or `undefined`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null` or `undefined`.\n *\n * @param {unknown} x - The value to test for null or undefined.\n * @returns {boolean} `true` if the value is null or undefined, `false` otherwise.\n *\n * @example\n * * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n * const result1 = isNil(value1); // true\n * const result2 = isNil(value2); // true\n * const result3 = isNil(value3); // false\n */\nexport function isNil(x: unknown): x is null | undefined {\n return x === null || x === undefined;\n}\n","/**\n * Checks if the given value is not null nor undefined.\n *\n * The main use of this function is to be used with TypeScript as a type predicate.\n *\n * @param {T | null | undefined} x - The value to test if it is not null nor undefined.\n * @returns {x is T} True if the value is not null nor undefined, false otherwise.\n *\n * @example\n * // Here the type of `arr` is (number | undefined)[]\n * const arr = [1, undefined, 3];\n * // Here the type of `result` is number[]\n * const result = arr.filter(isNotNil);\n * // result will be [1, 3]\n */\nexport function isNotNil<T>(x: T | null | undefined): x is T {\n return x !== null && x !== undefined;\n}\n","/**\n * Checks if the given value is null.\n *\n * This function tests whether the provided value is strictly equal to `null`.\n * It returns `true` if the value is `null`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null`.\n *\n * @param {unknown} x - The value to test if it is null.\n * @returns {x is null} True if the value is null, false otherwise.\n *\n * @example\n * * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n *\n * console.log(isNull(value1)); // true\n * console.log(isNull(value2)); // false\n * console.log(isNull(value3)); // false\n */\nexport function isNull(x: unknown): x is null {\n return x === null;\n}\n","/**\n * Checks if the given value is undefined.\n *\n * This function tests whether the provided value is strictly equal to `undefined`.\n * It returns `true` if the value is `undefined`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `undefined`.\n *\n * @param {unknown} x - The value to test if it is undefined.\n * @returns {x is undefined} true if the value is undefined, false otherwise.\n *\n * @example\n * * const value1 = undefined;\n * const value2 = null;\n * const value3 = 42;\n *\n * console.log(isUndefined(value1)); // true\n * console.log(isUndefined(value2)); // false\n * console.log(isUndefined(value3)); // false\n */\nexport function isUndefined(x: unknown): x is undefined {\n return x === undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmBO,SAAS,MAAM,GAAmC;AACvD,SAAO,MAAM,QAAQ,MAAM;AAC7B;;;ACNO,SAAS,SAAY,GAAiC;AAC3D,SAAO,MAAM,QAAQ,MAAM;AAC7B;;;ACGO,SAAS,OAAO,GAAuB;AAC5C,SAAO,MAAM;AACf;;;ACFO,SAAS,YAAY,GAA4B;AACtD,SAAO,MAAM;AACf;","names":[]}
@@ -1,16 +1,16 @@
1
1
  import "../chunk-MAJSPFA6.mjs";
2
2
  import {
3
3
  isNull
4
- } from "../chunk-FUWEG5ZM.mjs";
4
+ } from "../chunk-Y6ZRNII6.mjs";
5
5
  import {
6
6
  isUndefined
7
- } from "../chunk-NK2262VG.mjs";
7
+ } from "../chunk-HOQRMBSB.mjs";
8
8
  import {
9
9
  isNil
10
- } from "../chunk-WFQ3LAHQ.mjs";
10
+ } from "../chunk-KBJTBR5T.mjs";
11
11
  import {
12
12
  isNotNil
13
- } from "../chunk-YMNXRH52.mjs";
13
+ } from "../chunk-ZQNAZPSK.mjs";
14
14
  import "../chunk-2MM5EJJX.mjs";
15
15
  export {
16
16
  isNil,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/predicate/isNil.ts"],"sourcesContent":["/**\n * Checks if a given value is null or undefined.\n * \n * This function tests whether the provided value is either `null` or `undefined`. \n * It returns `true` if the value is `null` or `undefined`, and `false` otherwise.\n * \n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null` or `undefined`.\n *\n * @param {unknown} x - The value to test for null or undefined.\n * @returns {boolean} `true` if the value is null or undefined, `false` otherwise.\n *\n * @example\n * * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n * const result1 = isNil(value1); // true\n * const result2 = isNil(value2); // true\n * const result3 = isNil(value3); // false\n */\nexport function isNil(x: unknown): x is null | undefined {\n return x === null || x === undefined;\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBO,SAAS,MAAM,GAAmC;AACvD,SAAO,MAAM,QAAQ,MAAM;AAC7B;","names":[]}
1
+ {"version":3,"sources":["../../src/predicate/isNil.ts"],"sourcesContent":["/**\n * Checks if a given value is null or undefined.\n *\n * This function tests whether the provided value is either `null` or `undefined`.\n * It returns `true` if the value is `null` or `undefined`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null` or `undefined`.\n *\n * @param {unknown} x - The value to test for null or undefined.\n * @returns {boolean} `true` if the value is null or undefined, `false` otherwise.\n *\n * @example\n * * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n * const result1 = isNil(value1); // true\n * const result2 = isNil(value2); // true\n * const result3 = isNil(value3); // false\n */\nexport function isNil(x: unknown): x is null | undefined {\n return x === null || x === undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBO,SAAS,MAAM,GAAmC;AACvD,SAAO,MAAM,QAAQ,MAAM;AAC7B;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isNil
3
- } from "../chunk-WFQ3LAHQ.mjs";
3
+ } from "../chunk-KBJTBR5T.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  isNil
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/predicate/isNotNil.ts"],"sourcesContent":["/**\n * Checks if the given value is not null nor undefined.\n * \n * The main use of this function is to be used with TypeScript as a type predicate.\n *\n * @param {T | null | undefined} x - The value to test if it is not null nor undefined.\n * @returns {x is T} True if the value is not null nor undefined, false otherwise.\n *\n * @example\n * // Here the type of `arr` is (number | undefined)[]\n * const arr = [1, undefined, 3];\n * // Here the type of `result` is number[]\n * const result = arr.filter(isNotNil);\n * // result will be [1, 3]\n */\nexport function isNotNil<T>(x: T | null | undefined): x is T {\n return x !== null && x !== undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,SAAY,GAAiC;AAC3D,SAAO,MAAM,QAAQ,MAAM;AAC7B;","names":[]}
1
+ {"version":3,"sources":["../../src/predicate/isNotNil.ts"],"sourcesContent":["/**\n * Checks if the given value is not null nor undefined.\n *\n * The main use of this function is to be used with TypeScript as a type predicate.\n *\n * @param {T | null | undefined} x - The value to test if it is not null nor undefined.\n * @returns {x is T} True if the value is not null nor undefined, false otherwise.\n *\n * @example\n * // Here the type of `arr` is (number | undefined)[]\n * const arr = [1, undefined, 3];\n * // Here the type of `result` is number[]\n * const result = arr.filter(isNotNil);\n * // result will be [1, 3]\n */\nexport function isNotNil<T>(x: T | null | undefined): x is T {\n return x !== null && x !== undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,SAAY,GAAiC;AAC3D,SAAO,MAAM,QAAQ,MAAM;AAC7B;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isNotNil
3
- } from "../chunk-YMNXRH52.mjs";
3
+ } from "../chunk-ZQNAZPSK.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  isNotNil
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/predicate/isNull.ts"],"sourcesContent":["/**\n * Checks if the given value is null.\n *\n * This function tests whether the provided value is strictly equal to `null`. \n * It returns `true` if the value is `null`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null`.\n * \n * @param {unknown} x - The value to test if it is null.\n * @returns {x is null} True if the value is null, false otherwise.\n *\n * @example\n * * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n * \n * console.log(isNull(value1)); // true\n * console.log(isNull(value2)); // false\n * console.log(isNull(value3)); // false\n */\nexport function isNull(x: unknown): x is null {\n return x === null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,SAAS,OAAO,GAAuB;AAC5C,SAAO,MAAM;AACf;","names":[]}
1
+ {"version":3,"sources":["../../src/predicate/isNull.ts"],"sourcesContent":["/**\n * Checks if the given value is null.\n *\n * This function tests whether the provided value is strictly equal to `null`.\n * It returns `true` if the value is `null`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null`.\n *\n * @param {unknown} x - The value to test if it is null.\n * @returns {x is null} True if the value is null, false otherwise.\n *\n * @example\n * * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n *\n * console.log(isNull(value1)); // true\n * console.log(isNull(value2)); // false\n * console.log(isNull(value3)); // false\n */\nexport function isNull(x: unknown): x is null {\n return x === null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,SAAS,OAAO,GAAuB;AAC5C,SAAO,MAAM;AACf;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isNull
3
- } from "../chunk-FUWEG5ZM.mjs";
3
+ } from "../chunk-Y6ZRNII6.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  isNull
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/predicate/isUndefined.ts"],"sourcesContent":["/**\n * Checks if the given value is undefined.\n *\n * This function tests whether the provided value is strictly equal to `undefined`. \n * It returns `true` if the value is `undefined`, and `false` otherwise.\n * \n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `undefined`.\n *\n * @param {unknown} x - The value to test if it is undefined.\n * @returns {x is undefined} true if the value is undefined, false otherwise.\n *\n * @example\n * * const value1 = undefined;\n * const value2 = null;\n * const value3 = 42;\n * \n * console.log(isUndefined(value1)); // true\n * console.log(isUndefined(value2)); // false\n * console.log(isUndefined(value3)); // false\n */\nexport function isUndefined(x: unknown): x is undefined {\n return x === undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,SAAS,YAAY,GAA4B;AACtD,SAAO,MAAM;AACf;","names":[]}
1
+ {"version":3,"sources":["../../src/predicate/isUndefined.ts"],"sourcesContent":["/**\n * Checks if the given value is undefined.\n *\n * This function tests whether the provided value is strictly equal to `undefined`.\n * It returns `true` if the value is `undefined`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `undefined`.\n *\n * @param {unknown} x - The value to test if it is undefined.\n * @returns {x is undefined} true if the value is undefined, false otherwise.\n *\n * @example\n * * const value1 = undefined;\n * const value2 = null;\n * const value3 = 42;\n *\n * console.log(isUndefined(value1)); // true\n * console.log(isUndefined(value2)); // false\n * console.log(isUndefined(value3)); // false\n */\nexport function isUndefined(x: unknown): x is undefined {\n return x === undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,SAAS,YAAY,GAA4B;AACtD,SAAO,MAAM;AACf;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isUndefined
3
- } from "../chunk-NK2262VG.mjs";
3
+ } from "../chunk-HOQRMBSB.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  isUndefined
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/promise/delay.ts"],"sourcesContent":["/**\n * Delays the execution of code for a specified number of milliseconds.\n * \n * This function returns a Promise that resolves after the specified delay, allowing you to use it \n * with async/await to pause execution.\n *\n * @param {number} ms - The number of milliseconds to delay.\n * @returns {Promise<void>} A Promise that resolves after the specified delay.\n *\n * @example\n * async function foo() {\n * console.log('Start');\n * await delay(1000); // Delays execution for 1 second\n * console.log('End');\n * }\n * \n * foo();\n */\nexport function delay(ms: number): Promise<void> {\n return new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBO,SAAS,MAAM,IAA2B;AAC/C,SAAO,IAAI,QAAQ,aAAW;AAC5B,eAAW,SAAS,EAAE;AAAA,EACxB,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../../src/promise/delay.ts"],"sourcesContent":["/**\n * Delays the execution of code for a specified number of milliseconds.\n *\n * This function returns a Promise that resolves after the specified delay, allowing you to use it\n * with async/await to pause execution.\n *\n * @param {number} ms - The number of milliseconds to delay.\n * @returns {Promise<void>} A Promise that resolves after the specified delay.\n *\n * @example\n * async function foo() {\n * console.log('Start');\n * await delay(1000); // Delays execution for 1 second\n * console.log('End');\n * }\n *\n * foo();\n */\nexport function delay(ms: number): Promise<void> {\n return new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBO,SAAS,MAAM,IAA2B;AAC/C,SAAO,IAAI,QAAQ,aAAW;AAC5B,eAAW,SAAS,EAAE;AAAA,EACxB,CAAC;AACH;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  delay
3
- } from "../chunk-7SJHJHBN.mjs";
3
+ } from "../chunk-ZBG3EYM3.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  delay
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/promise/index.ts","../../src/promise/delay.ts"],"sourcesContent":["export { delay } from './delay';","/**\n * Delays the execution of code for a specified number of milliseconds.\n * \n * This function returns a Promise that resolves after the specified delay, allowing you to use it \n * with async/await to pause execution.\n *\n * @param {number} ms - The number of milliseconds to delay.\n * @returns {Promise<void>} A Promise that resolves after the specified delay.\n *\n * @example\n * async function foo() {\n * console.log('Start');\n * await delay(1000); // Delays execution for 1 second\n * console.log('End');\n * }\n * \n * foo();\n */\nexport function delay(ms: number): Promise<void> {\n return new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACkBO,SAAS,MAAM,IAA2B;AAC/C,SAAO,IAAI,QAAQ,aAAW;AAC5B,eAAW,SAAS,EAAE;AAAA,EACxB,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../../src/promise/index.ts","../../src/promise/delay.ts"],"sourcesContent":["export { delay } from './delay';\n","/**\n * Delays the execution of code for a specified number of milliseconds.\n *\n * This function returns a Promise that resolves after the specified delay, allowing you to use it\n * with async/await to pause execution.\n *\n * @param {number} ms - The number of milliseconds to delay.\n * @returns {Promise<void>} A Promise that resolves after the specified delay.\n *\n * @example\n * async function foo() {\n * console.log('Start');\n * await delay(1000); // Delays execution for 1 second\n * console.log('End');\n * }\n *\n * foo();\n */\nexport function delay(ms: number): Promise<void> {\n return new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACkBO,SAAS,MAAM,IAA2B;AAC/C,SAAO,IAAI,QAAQ,aAAW;AAC5B,eAAW,SAAS,EAAE;AAAA,EACxB,CAAC;AACH;","names":[]}
@@ -1,7 +1,7 @@
1
1
  import "../chunk-ARZ5BDR6.mjs";
2
2
  import {
3
3
  delay
4
- } from "../chunk-7SJHJHBN.mjs";
4
+ } from "../chunk-ZBG3EYM3.mjs";
5
5
  import "../chunk-2MM5EJJX.mjs";
6
6
  export {
7
7
  delay
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "es-toolkit",
3
3
  "description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
4
- "version": "1.0.4",
4
+ "version": "1.1.0-dev.43+795c83bd",
5
5
  "workspaces": [
6
6
  "docs"
7
7
  ],
@@ -190,7 +190,8 @@
190
190
  "prepack": "yarn build",
191
191
  "build": "tsup && ./.scripts/postbuild.sh",
192
192
  "test": "vitest run --coverage --typecheck",
193
- "lint": "eslint ./src --ext .ts"
193
+ "lint": "eslint ./src --ext .ts",
194
+ "format": "prettier --write ."
194
195
  },
195
196
  "main": "./dist/index.js",
196
197
  "module": "./dist/index.mjs",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/intersectionBy.ts"],"sourcesContent":["/**\n * Returns the intersection of two arrays based on a mapping function.\n * \n * This function takes two arrays and a mapping function. It returns a new array containing \n * the elements from the first array that, when mapped using the provided function, have matching \n * mapped elements in the second array. It effectively filters out any elements from the first array \n * that do not have corresponding mapped values in the second array.\n *\n * @param {T[]} firstArr - The first array to compare.\n * @param {T[]} secondArr - The second array to compare.\n * @param {(item: T) => U} mapper - A function to map the elements of both arrays for comparison.\n * @returns {T[]} A new array containing the elements from the first array that have corresponding mapped values in the second array.\n *\n * @example\n * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];\n * const array2 = [{ id: 2 }, { id: 4 }];\n * const mapper = item => item.id;\n * const result = intersectionBy(array1, array2, mapper);\n * // result will be [{ id: 2 }] since only this element has a matching id in both arrays.\n */\nexport function intersectionBy<T, U>(firstArr: T[], secondArr: T[], mapper: (item: T) => U): T[] {\n const mappedSecondArr = secondArr.map(x => mapper(x));\n \n return firstArr.filter(item => {\n return mappedSecondArr.includes(mapper(item));\n })\n}"],"mappings":";AAoBO,SAAS,eAAqB,UAAe,WAAgB,QAA6B;AAC/F,QAAM,kBAAkB,UAAU,IAAI,OAAK,OAAO,CAAC,CAAC;AAEpD,SAAO,SAAS,OAAO,UAAQ;AAC7B,WAAO,gBAAgB,SAAS,OAAO,IAAI,CAAC;AAAA,EAC9C,CAAC;AACH;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/zip.ts"],"sourcesContent":["/**\n * Combines multiple arrays into a single array of tuples.\n * \n * This function takes multiple arrays and returns a new array where each element is a tuple \n * containing the corresponding elements from the input arrays. If the input arrays are of \n * different lengths, the resulting array will have the length of the longest input array, \n * with undefined values for missing elements.\n *\n * @param {...T[][]} arrs - The arrays to zip together.\n * @returns {T[][]} A new array of tuples containing the corresponding elements from the input arrays.\n *\n * @example\n * const arr1 = [1, 2, 3];\n * const arr2 = ['a', 'b', 'c'];\n * const result = zip(arr1, arr2);\n * // result will be [[1, 'a'], [2, 'b'], [3, 'c']]\n *\n * const arr3 = [true, false];\n * const result2 = zip(arr1, arr2, arr3);\n * // result2 will be [[1, 'a', true], [2, 'b', false], [3, 'c', undefined]]\n */\nexport function zip<T>(arr1: T[]): Array<[T]>;\nexport function zip<T, U>(arr1: T[], arr2: U[]): Array<[T, U]>;\nexport function zip<T, U, V>(arr1: T[], arr2: U[], arr3: V[]): Array<[T, U, V]>;\nexport function zip<T, U, V, W>(arr1: T[], arr2: U[], arr3: V[], arr4: W[]): Array<[T, U, V, W]>;\nexport function zip<T>(...arrs: T[][]): T[][] {\n const result: T[][] = [];\n\n const maxIndex = Math.max(...arrs.map(x => x.length));\n\n for (let i = 0; i < maxIndex; i++) {\n const element: T[] = [];\n\n for (const arr of arrs) {\n element.push(arr[i]);\n }\n\n result.push(element);\n }\n\n return result;\n}\n"],"mappings":";AAyBO,SAAS,OAAU,MAAoB;AAC5C,QAAM,SAAgB,CAAC;AAEvB,QAAM,WAAW,KAAK,IAAI,GAAG,KAAK,IAAI,OAAK,EAAE,MAAM,CAAC;AAEpD,WAAS,IAAI,GAAG,IAAI,UAAU,KAAK;AACjC,UAAM,UAAe,CAAC;AAEtB,eAAW,OAAO,MAAM;AACtB,cAAQ,KAAK,IAAI,CAAC,CAAC;AAAA,IACrB;AAEA,WAAO,KAAK,OAAO;AAAA,EACrB;AAEA,SAAO;AACT;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/object/pick.ts"],"sourcesContent":["/**\n * Creates a new object composed of the picked object properties.\n *\n * This function takes an object and an array of keys, and returns a new object that \n * includes only the properties corresponding to the specified keys.\n *\n * @param {T} obj - The object to pick keys from.\n * @param {K[]} keys - An array of keys to be picked from the object.\n * @returns {Pick<T, K>} A new object with the specified keys picked.\n *\n * @example\n * * const obj = { a: 1, b: 2, c: 3 };\n * const result = pick(obj, ['a', 'c']);\n * // result will be { a: 1, c: 3 }\n */\nexport function pick<T, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n\n for (const key of keys) {\n result[key] = obj[key];\n }\n\n return result;\n}\n"],"mappings":";AAeO,SAAS,KAA2B,KAAQ,MAAuB;AACxE,QAAM,SAAS,CAAC;AAEhB,aAAW,OAAO,MAAM;AACtB,WAAO,GAAG,IAAI,IAAI,GAAG;AAAA,EACvB;AAEA,SAAO;AACT;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/intersection.ts"],"sourcesContent":["/**\n * Returns the intersection of two arrays.\n * \n * This function takes two arrays and returns a new array containing the elements that are \n * present in both arrays. It effectively filters out any elements from the first array that \n * are not found in the second array.\n *\n * @param {T[]} firstArr - The first array to compare.\n * @param {T[]} secondArr - The second array to compare.\n * @returns {T[]} A new array containing the elements that are present in both arrays.\n *\n * @example\n * const array1 = [1, 2, 3, 4, 5];\n * const array2 = [3, 4, 5, 6, 7];\n * const result = intersection(array1, array2);\n * // result will be [3, 4, 5] since these elements are in both arrays.\n */\nexport function intersection<T>(firstArr: T[], secondArr: T[]): T[] {\n return firstArr.filter(item => {\n return secondArr.includes(item);\n });\n}\n"],"mappings":";AAiBO,SAAS,aAAgB,UAAe,WAAqB;AAClE,SAAO,SAAS,OAAO,UAAQ;AAC7B,WAAO,UAAU,SAAS,IAAI;AAAA,EAChC,CAAC;AACH;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/xor.ts"],"sourcesContent":["import { difference } from \"./difference\";\nimport { intersection } from \"./intersection\";\nimport { union } from \"./union\";\n\n/**\n * Computes the symmetric difference between two arrays. The symmetric difference is the set of elements\n * which are in either of the arrays, but not in their intersection.\n * \n * @param {T[]} arr1 - The first array.\n * @param {T[]} arr2 - The second array.\n * @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both.\n * \n * @example\n * // Returns [1, 2, 5, 6]\n * xor([1, 2, 3, 4], [3, 4, 5, 6]);\n * \n * @example\n * // Returns ['a', 'c']\n * xor(['a', 'b'], ['b', 'c']);\n */\nexport function xor<T>(arr1: T[], arr2: T[]): T[] {\n return difference(union(arr1, arr2), intersection(arr1, arr2));\n}"],"mappings":";;;;;;;;;;;AAoBO,SAAS,IAAO,MAAW,MAAgB;AAChD,SAAO,WAAW,MAAM,MAAM,IAAI,GAAG,aAAa,MAAM,IAAI,CAAC;AAC/D;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/unionBy.ts"],"sourcesContent":["/**\n * Creates an array of unique values, in order, from all given arrays using a provided mapping function to determine equality.\n * \n * @param {T[]} arr1 - The first array.\n * @param {T[]} arr2 - The second array.\n * @param {function(item: T): U} mapper - The function to map array elements to comparison values.\n * @returns {T[]} A new array containing the union of unique elements from `arr1` and `arr2`, based on the values returned by the mapping function.\n * \n * @example\n * // Custom mapping function for numbers (modulo comparison)\n * const moduloMapper = (x) => x % 3;\n * unionBy([1, 2, 3], [4, 5, 6], moduloMapper);\n * // Returns [1, 2, 3]\n * \n * @example\n * // Custom mapping function for objects with an 'id' property\n * const idMapper = (obj) => obj.id;\n * unionBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper);\n * // Returns [{ id: 1 }, { id: 2 }, { id: 3 }]\n */\nexport function unionBy<T, U>(arr1: T[], arr2: T[], mapper: (item: T) => U): T[] {\n const map = new Map<U, T>();\n\n for (const item of [...arr1, ...arr2]) {\n const key = mapper(item);\n if (!map.has(key)) {\n map.set(key, item);\n }\n }\n\n return [...map.values()];\n}\n"],"mappings":";AAoBO,SAAS,QAAc,MAAW,MAAW,QAA6B;AAC/E,QAAM,MAAM,oBAAI,IAAU;AAE1B,aAAW,QAAQ,CAAC,GAAG,MAAM,GAAG,IAAI,GAAG;AACrC,UAAM,MAAM,OAAO,IAAI;AACvB,QAAI,CAAC,IAAI,IAAI,GAAG,GAAG;AACjB,UAAI,IAAI,KAAK,IAAI;AAAA,IACnB;AAAA,EACF;AAEA,SAAO,CAAC,GAAG,IAAI,OAAO,CAAC;AACzB;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/promise/delay.ts"],"sourcesContent":["/**\n * Delays the execution of code for a specified number of milliseconds.\n * \n * This function returns a Promise that resolves after the specified delay, allowing you to use it \n * with async/await to pause execution.\n *\n * @param {number} ms - The number of milliseconds to delay.\n * @returns {Promise<void>} A Promise that resolves after the specified delay.\n *\n * @example\n * async function foo() {\n * console.log('Start');\n * await delay(1000); // Delays execution for 1 second\n * console.log('End');\n * }\n * \n * foo();\n */\nexport function delay(ms: number): Promise<void> {\n return new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n}\n"],"mappings":";AAkBO,SAAS,MAAM,IAA2B;AAC/C,SAAO,IAAI,QAAQ,aAAW;AAC5B,eAAW,SAAS,EAAE;AAAA,EACxB,CAAC;AACH;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/function/once.ts"],"sourcesContent":["/**\n * Creates a function that is restricted to invoking the provided function `func` once.\n * Repeated calls to the function will return the value from the first invocation.\n *\n * @param {F} func - The function to restrict.\n * @returns {F} A new function that invokes `func` once and caches the result.\n *\n * @example\n * const initialize = once(() => {\n * console.log('Initialized!');\n * return true;\n * });\n * \n * initialize(); // Logs: 'Initialized!' and returns true\n * initialize(); // Returns true without logging\n */\nexport function once<F extends () => any>(func: F): F {\n let called = false;\n let cache: ReturnType<F> | undefined;\n\n return function () {\n if (called) {\n return cache;\n }\n\n const result = func();\n\n called = true;\n cache = result;\n\n return result;\n } as F;\n}\n"],"mappings":";AAgBO,SAAS,KAA0B,MAAY;AACpD,MAAI,SAAS;AACb,MAAI;AAEJ,SAAO,WAAY;AACjB,QAAI,QAAQ;AACV,aAAO;AAAA,IACT;AAEA,UAAM,SAAS,KAAK;AAEpB,aAAS;AACT,YAAQ;AAER,WAAO;AAAA,EACT;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/takeRight.ts"],"sourcesContent":["/**\n * Returns a new array containing the last `count` elements from the input array `arr`.\n * If `count` is greater than the length of `arr`, the entire array is returned.\n * \n * @param {T[]} arr - The array to take elements from.\n * @param {number} count - The number of elements to take.\n * @returns {T[]} A new array containing the last `count` elements from `arr`.\n * \n * @example\n * // Returns [4, 5]\n * takeRight([1, 2, 3, 4, 5], 2);\n * \n * @example\n * // Returns ['b', 'c']\n * takeRight(['a', 'b', 'c'], 2);\n * \n * @example\n * // Returns [1, 2, 3]\n * takeRight([1, 2, 3], 5);\n */\nexport function takeRight<T>(arr: T[], count: number): T[] {\n if (count === 0) {\n return [];\n }\n\n return arr.slice(-count);\n}"],"mappings":";AAoBO,SAAS,UAAa,KAAU,OAAoB;AACzD,MAAI,UAAU,GAAG;AACf,WAAO,CAAC;AAAA,EACV;AAEA,SAAO,IAAI,MAAM,CAAC,KAAK;AACzB;","names":[]}