es-toolkit 1.6.1-dev.136 → 1.6.1-dev.138

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 (274) hide show
  1. package/dist/array/compact.d.mts +1 -0
  2. package/dist/array/compact.d.ts +1 -0
  3. package/dist/array/compact.js.map +1 -1
  4. package/dist/array/compact.mjs +1 -1
  5. package/dist/array/drop.d.mts +1 -0
  6. package/dist/array/drop.d.ts +1 -0
  7. package/dist/array/drop.js.map +1 -1
  8. package/dist/array/drop.mjs +1 -1
  9. package/dist/array/dropRight.d.mts +1 -0
  10. package/dist/array/dropRight.d.ts +1 -0
  11. package/dist/array/dropRight.js.map +1 -1
  12. package/dist/array/dropRight.mjs +1 -1
  13. package/dist/array/dropRightWhile.d.mts +1 -0
  14. package/dist/array/dropRightWhile.d.ts +1 -0
  15. package/dist/array/dropRightWhile.js.map +1 -1
  16. package/dist/array/dropRightWhile.mjs +2 -2
  17. package/dist/array/dropWhile.d.mts +1 -0
  18. package/dist/array/dropWhile.d.ts +1 -0
  19. package/dist/array/dropWhile.js.map +1 -1
  20. package/dist/array/dropWhile.mjs +1 -1
  21. package/dist/array/groupBy.d.mts +2 -0
  22. package/dist/array/groupBy.d.ts +2 -0
  23. package/dist/array/groupBy.js.map +1 -1
  24. package/dist/array/groupBy.mjs +1 -1
  25. package/dist/array/index.js.map +1 -1
  26. package/dist/array/index.mjs +28 -28
  27. package/dist/array/intersection.d.mts +1 -0
  28. package/dist/array/intersection.d.ts +1 -0
  29. package/dist/array/intersection.js.map +1 -1
  30. package/dist/array/intersection.mjs +1 -1
  31. package/dist/array/intersectionBy.d.mts +2 -0
  32. package/dist/array/intersectionBy.d.ts +2 -0
  33. package/dist/array/intersectionBy.js.map +1 -1
  34. package/dist/array/intersectionBy.mjs +1 -1
  35. package/dist/array/intersectionWith.d.mts +1 -0
  36. package/dist/array/intersectionWith.d.ts +1 -0
  37. package/dist/array/intersectionWith.js.map +1 -1
  38. package/dist/array/intersectionWith.mjs +1 -1
  39. package/dist/array/keyBy.d.mts +2 -0
  40. package/dist/array/keyBy.d.ts +2 -0
  41. package/dist/array/keyBy.js.map +1 -1
  42. package/dist/array/keyBy.mjs +1 -1
  43. package/dist/array/maxBy.d.mts +1 -0
  44. package/dist/array/maxBy.d.ts +1 -0
  45. package/dist/array/maxBy.js.map +1 -1
  46. package/dist/array/maxBy.mjs +1 -1
  47. package/dist/array/minBy.d.mts +1 -0
  48. package/dist/array/minBy.d.ts +1 -0
  49. package/dist/array/minBy.js.map +1 -1
  50. package/dist/array/minBy.mjs +1 -1
  51. package/dist/array/partition.d.mts +1 -0
  52. package/dist/array/partition.d.ts +1 -0
  53. package/dist/array/partition.js.map +1 -1
  54. package/dist/array/partition.mjs +1 -1
  55. package/dist/array/sample.d.mts +1 -0
  56. package/dist/array/sample.d.ts +1 -0
  57. package/dist/array/sample.js.map +1 -1
  58. package/dist/array/sample.mjs +1 -1
  59. package/dist/array/sampleSize.d.mts +1 -0
  60. package/dist/array/sampleSize.d.ts +1 -0
  61. package/dist/array/sampleSize.js.map +1 -1
  62. package/dist/array/sampleSize.mjs +2 -2
  63. package/dist/array/shuffle.d.mts +1 -0
  64. package/dist/array/shuffle.d.ts +1 -0
  65. package/dist/array/shuffle.js.map +1 -1
  66. package/dist/array/shuffle.mjs +1 -1
  67. package/dist/array/takeRight.d.mts +1 -0
  68. package/dist/array/takeRight.d.ts +1 -0
  69. package/dist/array/takeRight.js.map +1 -1
  70. package/dist/array/takeRight.mjs +1 -1
  71. package/dist/array/union.d.mts +1 -0
  72. package/dist/array/union.d.ts +1 -0
  73. package/dist/array/union.js.map +1 -1
  74. package/dist/array/union.mjs +2 -2
  75. package/dist/array/unionBy.d.mts +2 -0
  76. package/dist/array/unionBy.d.ts +2 -0
  77. package/dist/array/unionBy.js.map +1 -1
  78. package/dist/array/unionBy.mjs +1 -1
  79. package/dist/array/unionWith.d.mts +1 -0
  80. package/dist/array/unionWith.d.ts +1 -0
  81. package/dist/array/unionWith.js.map +1 -1
  82. package/dist/array/unionWith.mjs +2 -2
  83. package/dist/array/uniq.d.mts +1 -0
  84. package/dist/array/uniq.d.ts +1 -0
  85. package/dist/array/uniq.js.map +1 -1
  86. package/dist/array/uniq.mjs +1 -1
  87. package/dist/array/uniqBy.d.mts +2 -0
  88. package/dist/array/uniqBy.d.ts +2 -0
  89. package/dist/array/uniqBy.js.map +1 -1
  90. package/dist/array/uniqBy.mjs +1 -1
  91. package/dist/array/uniqWith.d.mts +1 -0
  92. package/dist/array/uniqWith.d.ts +1 -0
  93. package/dist/array/uniqWith.js.map +1 -1
  94. package/dist/array/uniqWith.mjs +1 -1
  95. package/dist/array/xor.d.mts +1 -0
  96. package/dist/array/xor.d.ts +1 -0
  97. package/dist/array/xor.js.map +1 -1
  98. package/dist/array/xor.mjs +4 -4
  99. package/dist/array/xorBy.js.map +1 -1
  100. package/dist/array/xorBy.mjs +3 -3
  101. package/dist/array/xorWith.js.map +1 -1
  102. package/dist/array/xorWith.mjs +4 -4
  103. package/dist/array/zipObject.d.mts +2 -0
  104. package/dist/array/zipObject.d.ts +2 -0
  105. package/dist/array/zipObject.js.map +1 -1
  106. package/dist/array/zipObject.mjs +1 -1
  107. package/dist/{chunk-2PFDLYQC.mjs → chunk-237HGSZS.mjs} +1 -1
  108. package/dist/chunk-237HGSZS.mjs.map +1 -0
  109. package/dist/{chunk-DOOIIHT3.mjs → chunk-2KNLZB7V.mjs} +1 -1
  110. package/dist/chunk-2KNLZB7V.mjs.map +1 -0
  111. package/dist/{chunk-OUTSP4VR.mjs → chunk-2ZCITDMK.mjs} +2 -2
  112. package/dist/chunk-2ZCITDMK.mjs.map +1 -0
  113. package/dist/{chunk-G42NUGNE.mjs → chunk-3IP4JVLL.mjs} +1 -1
  114. package/dist/chunk-3IP4JVLL.mjs.map +1 -0
  115. package/dist/{chunk-MQWVBKUT.mjs → chunk-6CLH5YZ2.mjs} +1 -1
  116. package/dist/chunk-6CLH5YZ2.mjs.map +1 -0
  117. package/dist/{chunk-DA7GSKQ5.mjs → chunk-6GWEY5EL.mjs} +1 -1
  118. package/dist/chunk-6GWEY5EL.mjs.map +1 -0
  119. package/dist/{chunk-KSXWREB5.mjs → chunk-AJKZMN2V.mjs} +1 -1
  120. package/dist/chunk-AJKZMN2V.mjs.map +1 -0
  121. package/dist/{chunk-A67NF2C7.mjs → chunk-BCTYOXT7.mjs} +1 -1
  122. package/dist/chunk-BCTYOXT7.mjs.map +1 -0
  123. package/dist/{chunk-ZQNAZPSK.mjs → chunk-BMRTZMRE.mjs} +1 -1
  124. package/dist/chunk-BMRTZMRE.mjs.map +1 -0
  125. package/dist/{chunk-UFAA5WKR.mjs → chunk-CMBC4MXG.mjs} +1 -1
  126. package/dist/chunk-CMBC4MXG.mjs.map +1 -0
  127. package/dist/{chunk-JGNFYNYU.mjs → chunk-CXGIXTSH.mjs} +1 -1
  128. package/dist/chunk-CXGIXTSH.mjs.map +1 -0
  129. package/dist/{chunk-5L2V7WD3.mjs → chunk-DN3NOZ3H.mjs} +1 -1
  130. package/dist/chunk-DN3NOZ3H.mjs.map +1 -0
  131. package/dist/{chunk-NKTBEEIT.mjs → chunk-DTJJIMKJ.mjs} +1 -1
  132. package/dist/chunk-DTJJIMKJ.mjs.map +1 -0
  133. package/dist/{chunk-XFCW7XJ4.mjs → chunk-DVK2N4KC.mjs} +1 -1
  134. package/dist/chunk-DVK2N4KC.mjs.map +1 -0
  135. package/dist/{chunk-Q5XXJXXQ.mjs → chunk-DXB7EZUQ.mjs} +1 -1
  136. package/dist/chunk-DXB7EZUQ.mjs.map +1 -0
  137. package/dist/{chunk-H5YR3ZV4.mjs → chunk-E6E4RZLN.mjs} +1 -1
  138. package/dist/chunk-E6E4RZLN.mjs.map +1 -0
  139. package/dist/{chunk-PYLGHB3F.mjs → chunk-FVVSE2F2.mjs} +1 -1
  140. package/dist/chunk-FVVSE2F2.mjs.map +1 -0
  141. package/dist/{chunk-DPLJQQFX.mjs → chunk-G7UQ5PUR.mjs} +1 -1
  142. package/dist/chunk-G7UQ5PUR.mjs.map +1 -0
  143. package/dist/{chunk-OFWKFUFZ.mjs → chunk-HPFDYUGP.mjs} +1 -1
  144. package/dist/chunk-HPFDYUGP.mjs.map +1 -0
  145. package/dist/{chunk-OIHARMNM.mjs → chunk-IJD7FE2Z.mjs} +1 -1
  146. package/dist/chunk-IJD7FE2Z.mjs.map +1 -0
  147. package/dist/{chunk-XDKEPIUV.mjs → chunk-IQLKIDXF.mjs} +1 -1
  148. package/dist/chunk-IQLKIDXF.mjs.map +1 -0
  149. package/dist/{chunk-GTVOVGGZ.mjs → chunk-JE6JKZU3.mjs} +2 -2
  150. package/dist/chunk-JE6JKZU3.mjs.map +1 -0
  151. package/dist/{chunk-Q75KEFW5.mjs → chunk-JEKUA56R.mjs} +1 -1
  152. package/dist/chunk-JEKUA56R.mjs.map +1 -0
  153. package/dist/{chunk-VKM3R5T5.mjs → chunk-L7FQX5MN.mjs} +3 -3
  154. package/dist/chunk-L7FQX5MN.mjs.map +1 -0
  155. package/dist/{chunk-K2BAFL2T.mjs → chunk-LJ2C6MVP.mjs} +1 -1
  156. package/dist/chunk-LJ2C6MVP.mjs.map +1 -0
  157. package/dist/{chunk-4MRXVNGG.mjs → chunk-LUIKU43M.mjs} +1 -1
  158. package/dist/chunk-LUIKU43M.mjs.map +1 -0
  159. package/dist/{chunk-NRNKP6JF.mjs → chunk-NFS7RWWE.mjs} +1 -1
  160. package/dist/chunk-NFS7RWWE.mjs.map +1 -0
  161. package/dist/{chunk-H2FV6Z5X.mjs → chunk-O64NE2P4.mjs} +2 -2
  162. package/dist/{chunk-GNSJP2AB.mjs → chunk-O6UXZR3U.mjs} +1 -1
  163. package/dist/chunk-O6UXZR3U.mjs.map +1 -0
  164. package/dist/{chunk-FXOABQRO.mjs → chunk-OOKNBU4V.mjs} +1 -1
  165. package/dist/chunk-OOKNBU4V.mjs.map +1 -0
  166. package/dist/{chunk-WPDDOUQT.mjs → chunk-OXAZEEGP.mjs} +1 -1
  167. package/dist/chunk-OXAZEEGP.mjs.map +1 -0
  168. package/dist/{chunk-E54CCWDL.mjs → chunk-Q47NGNXT.mjs} +3 -3
  169. package/dist/{chunk-OEOAJOLQ.mjs → chunk-QOJGMVVR.mjs} +1 -1
  170. package/dist/chunk-QOJGMVVR.mjs.map +1 -0
  171. package/dist/{chunk-JSS4FXUD.mjs → chunk-QRSJBBFY.mjs} +3 -3
  172. package/dist/{chunk-PLTO44KM.mjs → chunk-QZITBKWX.mjs} +1 -1
  173. package/dist/chunk-QZITBKWX.mjs.map +1 -0
  174. package/dist/{chunk-UPJXHWSJ.mjs → chunk-R6QA7PLZ.mjs} +2 -2
  175. package/dist/chunk-R6QA7PLZ.mjs.map +1 -0
  176. package/dist/{chunk-ACFP3XMB.mjs → chunk-S3CORED5.mjs} +1 -1
  177. package/dist/chunk-S3CORED5.mjs.map +1 -0
  178. package/dist/{chunk-2EFS3VA3.mjs → chunk-XI7KRD2C.mjs} +1 -1
  179. package/dist/chunk-XI7KRD2C.mjs.map +1 -0
  180. package/dist/error/AbortError.d.mts +1 -1
  181. package/dist/error/AbortError.d.ts +1 -1
  182. package/dist/error/AbortError.js.map +1 -1
  183. package/dist/error/AbortError.mjs +1 -1
  184. package/dist/error/index.js.map +1 -1
  185. package/dist/error/index.mjs +1 -1
  186. package/dist/function/debounce.d.mts +1 -0
  187. package/dist/function/debounce.d.ts +1 -0
  188. package/dist/function/debounce.js.map +1 -1
  189. package/dist/function/debounce.mjs +1 -1
  190. package/dist/function/index.js.map +1 -1
  191. package/dist/function/index.mjs +3 -3
  192. package/dist/function/once.d.mts +1 -0
  193. package/dist/function/once.d.ts +1 -0
  194. package/dist/function/once.js.map +1 -1
  195. package/dist/function/once.mjs +1 -1
  196. package/dist/function/throttle.d.mts +1 -0
  197. package/dist/function/throttle.d.ts +1 -0
  198. package/dist/function/throttle.js.map +1 -1
  199. package/dist/function/throttle.mjs +1 -1
  200. package/dist/index.js.map +1 -1
  201. package/dist/index.mjs +41 -41
  202. package/dist/math/index.js.map +1 -1
  203. package/dist/math/index.mjs +1 -1
  204. package/dist/math/meanBy.d.mts +1 -0
  205. package/dist/math/meanBy.d.ts +1 -0
  206. package/dist/math/meanBy.js.map +1 -1
  207. package/dist/math/meanBy.mjs +1 -1
  208. package/dist/object/index.js.map +1 -1
  209. package/dist/object/index.mjs +4 -4
  210. package/dist/object/omit.d.mts +2 -0
  211. package/dist/object/omit.d.ts +2 -0
  212. package/dist/object/omit.js.map +1 -1
  213. package/dist/object/omit.mjs +1 -1
  214. package/dist/object/omitBy.d.mts +1 -0
  215. package/dist/object/omitBy.d.ts +1 -0
  216. package/dist/object/omitBy.js.map +1 -1
  217. package/dist/object/omitBy.mjs +1 -1
  218. package/dist/object/pick.d.mts +2 -0
  219. package/dist/object/pick.d.ts +2 -0
  220. package/dist/object/pick.js.map +1 -1
  221. package/dist/object/pick.mjs +1 -1
  222. package/dist/object/pickBy.d.mts +1 -0
  223. package/dist/object/pickBy.d.ts +1 -0
  224. package/dist/object/pickBy.js.map +1 -1
  225. package/dist/object/pickBy.mjs +1 -1
  226. package/dist/predicate/index.js.map +1 -1
  227. package/dist/predicate/index.mjs +1 -1
  228. package/dist/predicate/isNotNil.d.mts +1 -0
  229. package/dist/predicate/isNotNil.d.ts +1 -0
  230. package/dist/predicate/isNotNil.js.map +1 -1
  231. package/dist/predicate/isNotNil.mjs +1 -1
  232. package/dist/promise/delay.js.map +1 -1
  233. package/dist/promise/delay.mjs +2 -2
  234. package/dist/promise/index.js.map +1 -1
  235. package/dist/promise/index.mjs +2 -2
  236. package/package.json +9 -1
  237. package/dist/chunk-2EFS3VA3.mjs.map +0 -1
  238. package/dist/chunk-2PFDLYQC.mjs.map +0 -1
  239. package/dist/chunk-4MRXVNGG.mjs.map +0 -1
  240. package/dist/chunk-5L2V7WD3.mjs.map +0 -1
  241. package/dist/chunk-A67NF2C7.mjs.map +0 -1
  242. package/dist/chunk-ACFP3XMB.mjs.map +0 -1
  243. package/dist/chunk-DA7GSKQ5.mjs.map +0 -1
  244. package/dist/chunk-DOOIIHT3.mjs.map +0 -1
  245. package/dist/chunk-DPLJQQFX.mjs.map +0 -1
  246. package/dist/chunk-FXOABQRO.mjs.map +0 -1
  247. package/dist/chunk-G42NUGNE.mjs.map +0 -1
  248. package/dist/chunk-GNSJP2AB.mjs.map +0 -1
  249. package/dist/chunk-GTVOVGGZ.mjs.map +0 -1
  250. package/dist/chunk-H5YR3ZV4.mjs.map +0 -1
  251. package/dist/chunk-JGNFYNYU.mjs.map +0 -1
  252. package/dist/chunk-K2BAFL2T.mjs.map +0 -1
  253. package/dist/chunk-KSXWREB5.mjs.map +0 -1
  254. package/dist/chunk-MQWVBKUT.mjs.map +0 -1
  255. package/dist/chunk-NKTBEEIT.mjs.map +0 -1
  256. package/dist/chunk-NRNKP6JF.mjs.map +0 -1
  257. package/dist/chunk-OEOAJOLQ.mjs.map +0 -1
  258. package/dist/chunk-OFWKFUFZ.mjs.map +0 -1
  259. package/dist/chunk-OIHARMNM.mjs.map +0 -1
  260. package/dist/chunk-OUTSP4VR.mjs.map +0 -1
  261. package/dist/chunk-PLTO44KM.mjs.map +0 -1
  262. package/dist/chunk-PYLGHB3F.mjs.map +0 -1
  263. package/dist/chunk-Q5XXJXXQ.mjs.map +0 -1
  264. package/dist/chunk-Q75KEFW5.mjs.map +0 -1
  265. package/dist/chunk-UFAA5WKR.mjs.map +0 -1
  266. package/dist/chunk-UPJXHWSJ.mjs.map +0 -1
  267. package/dist/chunk-VKM3R5T5.mjs.map +0 -1
  268. package/dist/chunk-WPDDOUQT.mjs.map +0 -1
  269. package/dist/chunk-XDKEPIUV.mjs.map +0 -1
  270. package/dist/chunk-XFCW7XJ4.mjs.map +0 -1
  271. package/dist/chunk-ZQNAZPSK.mjs.map +0 -1
  272. /package/dist/{chunk-H2FV6Z5X.mjs.map → chunk-O64NE2P4.mjs.map} +0 -0
  273. /package/dist/{chunk-E54CCWDL.mjs.map → chunk-Q47NGNXT.mjs.map} +0 -0
  274. /package/dist/{chunk-JSS4FXUD.mjs.map → chunk-QRSJBBFY.mjs.map} +0 -0
@@ -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 {(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: readonly T[], arr2: readonly 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\n if (!map.has(key)) {\n map.set(key, item);\n }\n }\n\n return Array.from(map.values());\n}\n"],"mappings":";AAoBO,SAAS,QAAc,MAAoB,MAAoB,QAA6B;AACjG,QAAM,MAAM,oBAAI,IAAU;AAE1B,aAAW,QAAQ,CAAC,GAAG,MAAM,GAAG,IAAI,GAAG;AACrC,UAAM,MAAM,OAAO,IAAI;AAEvB,QAAI,CAAC,IAAI,IAAI,GAAG,GAAG;AACjB,UAAI,IAAI,KAAK,IAAI;AAAA,IACnB;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,IAAI,OAAO,CAAC;AAChC;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/function/throttle.ts"],"sourcesContent":["/**\n * Creates a throttled function that only invokes the provided function at most once\n * per every `throttleMs` milliseconds. Subsequent calls to the throttled function\n * within the wait time will not trigger the execution of the original function.\n *\n * @param {F} func - The function to throttle.\n * @param {number} throttleMs - The number of milliseconds to throttle executions to.\n * @returns {F} A new throttled function that accepts the same parameters as the original function.\n *\n * @example\n * const throttledFunction = throttle(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' immediately\n * throttledFunction();\n *\n * // Will not log anything as it is within the throttle time\n * throttledFunction();\n *\n * // After 1 second\n * setTimeout(() => {\n * throttledFunction(); // Will log 'Function executed'\n * }, 1000);\n */\nexport function throttle<F extends (...args: any[]) => void>(func: F, throttleMs: number): F {\n let lastCallTime: number | null;\n\n const throttledFunction = function (...args: Parameters<F>) {\n const now = Date.now();\n\n if (lastCallTime == null || now - lastCallTime >= throttleMs) {\n lastCallTime = now;\n func(...args);\n }\n } as F;\n\n return throttledFunction;\n}\n"],"mappings":";AAyBO,SAAS,SAA6C,MAAS,YAAuB;AAC3F,MAAI;AAEJ,QAAM,oBAAoB,YAAa,MAAqB;AAC1D,UAAM,MAAM,KAAK,IAAI;AAErB,QAAI,gBAAgB,QAAQ,MAAM,gBAAgB,YAAY;AAC5D,qBAAe;AACf,WAAK,GAAG,IAAI;AAAA,IACd;AAAA,EACF;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 extends Record<string, any>, 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,KAAuD,KAAQ,MAAuB;AACpG,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/minBy.ts"],"sourcesContent":["/**\n * Finds the element in an array that has the minimum value when applying\n * the `getValue` function to each element.\n *\n * @param {T[]} items The array of elements to search.\n * @param {(element: T) => number} getValue A function that selects a numeric value from each element.\n * @returns {T} The element with the minimum value as determined by the `getValue` function.\n * @example\n * minBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 1 }\n * minBy([], x => x.a); // Returns: undefined\n */\nexport function minBy<T>(items: T[], getValue: (element: T) => number): T {\n let minElement = items[0];\n let min = Infinity;\n\n for (const element of items) {\n const value = getValue(element);\n if (value < min) {\n min = value;\n minElement = element;\n }\n }\n\n return minElement;\n}\n"],"mappings":";AAWO,SAAS,MAAS,OAAY,UAAqC;AACxE,MAAI,aAAa,MAAM,CAAC;AACxB,MAAI,MAAM;AAEV,aAAW,WAAW,OAAO;AAC3B,UAAM,QAAQ,SAAS,OAAO;AAC9B,QAAI,QAAQ,KAAK;AACf,YAAM;AACN,mBAAa;AAAA,IACf;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/unionWith.ts"],"sourcesContent":["import { uniqWith } from './uniqWith.ts';\n\n/**\n * Creates an array of unique values from two given arrays based on a custom equality function.\n *\n * This function takes two arrays and a custom equality function, merges the arrays, and returns\n * a new array containing only the unique values as determined by the custom equality function.\n *\n * @param {T[]} arr1 - The first array to merge and filter for unique values.\n * @param {T[]} arr2 - The second array to merge and filter for unique values.\n * @param {(item1: T, item2: T) => boolean} areItemsEqual - A custom function to determine if two elements are equal.\n * It takes two arguments and returns `true` if the elements are considered equal, and `false` otherwise.\n * @returns {T[]} A new array of unique values based on the custom equality function.\n *\n * @example\n * const array1 = [{ id: 1 }, { id: 2 }];\n * const array2 = [{ id: 2 }, { id: 3 }];\n * const areItemsEqual = (a, b) => a.id === b.id;\n * const result = unionWith(array1, array2, areItemsEqual);\n * // result will be [{ id: 1 }, { id: 2 }, { id: 3 }] since { id: 2 } is considered equal in both arrays\n */\nexport function unionWith<T>(\n arr1: readonly T[],\n arr2: readonly T[],\n areItemsEqual: (item1: T, item2: T) => boolean\n): T[] {\n return uniqWith(arr1.concat(arr2), areItemsEqual);\n}\n"],"mappings":";;;;;AAqBO,SAAS,UACd,MACA,MACA,eACK;AACL,SAAO,SAAS,KAAK,OAAO,IAAI,GAAG,aAAa;AAClD;","names":[]}
@@ -1 +0,0 @@
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 extends Record<string, any>, 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":";;;;;AAeO,SAAS,KAAuD,KAAQ,MAAuB;AACpG,QAAM,SAAS,mBAAK;AAEpB,aAAW,OAAO,MAAM;AACtB,WAAO,OAAO,GAAG;AAAA,EACnB;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: readonly T[], secondArr: readonly T[]): T[] {\n const secondSet = new Set(secondArr);\n\n return firstArr.filter(item => {\n return secondSet.has(item);\n });\n}\n"],"mappings":";AAiBO,SAAS,aAAgB,UAAwB,WAA8B;AACpF,QAAM,YAAY,IAAI,IAAI,SAAS;AAEnC,SAAO,SAAS,OAAO,UAAQ;AAC7B,WAAO,UAAU,IAAI,IAAI;AAAA,EAC3B,CAAC;AACH;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/error/AbortError.ts"],"sourcesContent":["/**\n * An error class representing an aborted operation.\n * @extends Error\n */\nexport class AbortError extends Error {\n constructor(message = 'The operation was aborted') {\n super(message);\n this.name = 'AbortError';\n }\n}\n"],"mappings":";AAIO,IAAM,aAAN,cAAyB,MAAM;AAAA,EACpC,YAAY,UAAU,6BAA6B;AACjD,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/dropRight.ts"],"sourcesContent":["/**\n * Removes a specified number of elements from the end of an array and returns the rest.\n *\n * This function takes an array and a number, and returns a new array with the specified number\n * of elements removed from the end.\n *\n * @param {T[]} arr - The array from which to drop elements.\n * @param {number} itemsCount - The number of elements to drop from the end of the array.\n * @returns {T[]} A new array with the specified number of elements removed from the end.\n *\n * @example\n * const array = [1, 2, 3, 4, 5];\n * const result = dropRight(array, 2);\n * // result will be [1, 2, 3] since the last two elements are dropped.\n */\nexport function dropRight<T>(arr: readonly T[], itemsCount: number): T[] {\n return arr.slice(0, -itemsCount);\n}\n"],"mappings":";AAeO,SAAS,UAAa,KAAmB,YAAyB;AACvE,SAAO,IAAI,MAAM,GAAG,CAAC,UAAU;AACjC;","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/union.ts"],"sourcesContent":["import { uniq } from './uniq.ts';\n\n/**\n * Creates an array of unique values from all given arrays.\n *\n * This function takes two arrays, merges them into a single array, and returns a new array\n * containing only the unique values from the merged array.\n *\n * @param {T[]} arr1 - The first array to merge and filter for unique values.\n * @param {T[]} arr2 - The second array to merge and filter for unique values.\n * @returns {T[]} A new array of unique values.\n *\n * @example\n * const array1 = [1, 2, 3];\n * const array2 = [3, 4, 5];\n * const result = union(array1, array2);\n * // result will be [1, 2, 3, 4, 5]\n */\nexport function union<T>(arr1: readonly T[], arr2: readonly T[]): T[] {\n return uniq(arr1.concat(arr2));\n}\n"],"mappings":";;;;;AAkBO,SAAS,MAAS,MAAoB,MAAyB;AACpE,SAAO,KAAK,KAAK,OAAO,IAAI,CAAC;AAC/B;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/xor.ts"],"sourcesContent":["import { difference } from './difference.ts';\nimport { intersection } from './intersection.ts';\nimport { union } from './union.ts';\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: readonly T[], arr2: readonly T[]): T[] {\n return difference(union(arr1, arr2), intersection(arr1, arr2));\n}\n"],"mappings":";;;;;;;;;;;AAoBO,SAAS,IAAO,MAAoB,MAAyB;AAClE,SAAO,WAAW,MAAM,MAAM,IAAI,GAAG,aAAa,MAAM,IAAI,CAAC;AAC/D;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/uniqBy.ts"],"sourcesContent":["/**\n * Returns a new array containing only the unique elements from the original array,\n * based on the values returned by the mapper function.\n *\n * @param {T[]} arr - The array to process.\n * @param {(item: T) => U} mapper - The function used to convert the array elements.\n * @returns {T[]} A new array containing only the unique elements from the original array, based on the values returned by the mapper function.\n *\n * @example\n * ```ts\n * uniqBy([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], Math.floor);\n * // [1.2, 2.1, 3.3, 5.7, 7.19]\n * ```\n */\nexport function uniqBy<T, U>(arr: readonly T[], mapper: (item: T) => U): T[] {\n const map = new Map<U, T>();\n\n for (const item of arr) {\n const key = mapper(item);\n\n if (!map.has(key)) {\n map.set(key, item);\n }\n }\n\n return Array.from(map.values());\n}\n"],"mappings":";AAcO,SAAS,OAAa,KAAmB,QAA6B;AAC3E,QAAM,MAAM,oBAAI,IAAU;AAE1B,aAAW,QAAQ,KAAK;AACtB,UAAM,MAAM,OAAO,IAAI;AAEvB,QAAI,CAAC,IAAI,IAAI,GAAG,GAAG;AACjB,UAAI,IAAI,KAAK,IAAI;AAAA,IACnB;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,IAAI,OAAO,CAAC;AAChC;","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: readonly T[], count: number): T[] {\n if (count === 0) {\n return [];\n }\n\n return arr.slice(-count);\n}\n"],"mappings":";AAoBO,SAAS,UAAa,KAAmB,OAAoB;AAClE,MAAI,UAAU,GAAG;AACf,WAAO,CAAC;AAAA,EACV;AAEA,SAAO,IAAI,MAAM,CAAC,KAAK;AACzB;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/uniq.ts"],"sourcesContent":["/**\n * Creates a duplicate-free version of an array.\n *\n * This function takes an array and returns a new array containing only the unique values\n * from the original array, preserving the order of first occurrence.\n *\n * @param {T[]} arr - The array to process.\n * @returns {T[]} A new array with only unique values from the original array.\n *\n * @example\n * const array = [1, 2, 2, 3, 4, 4, 5];\n * const result = uniq(array);\n * // result will be [1, 2, 3, 4, 5]\n */\nexport function uniq<T>(arr: readonly T[]): T[] {\n return Array.from(new Set(arr));\n}\n"],"mappings":";AAcO,SAAS,KAAQ,KAAwB;AAC9C,SAAO,MAAM,KAAK,IAAI,IAAI,GAAG,CAAC;AAChC;","names":[]}
@@ -1 +0,0 @@
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":";AAeO,SAAS,SAAY,GAAiC;AAC3D,SAAO,MAAM,QAAQ,MAAM;AAC7B;","names":[]}