es-toolkit 1.0.3 → 1.0.4-dev.39

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 (471) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/{esm/array/chunk.mjs → dist/array/chunk.d.mts} +1 -13
  3. package/dist/array/chunk.d.ts +3 -1
  4. package/dist/array/chunk.js +43 -0
  5. package/dist/array/chunk.js.map +1 -0
  6. package/dist/array/chunk.mjs +8 -0
  7. package/dist/array/chunk.mjs.map +1 -0
  8. package/{esm/array/difference.mjs → dist/array/difference.d.mts} +8 -12
  9. package/dist/array/difference.d.ts +3 -1
  10. package/dist/array/difference.js +35 -0
  11. package/dist/array/difference.js.map +1 -0
  12. package/dist/array/difference.mjs +8 -0
  13. package/dist/array/difference.mjs.map +1 -0
  14. package/{esm/array/differenceBy.mjs → dist/array/differenceBy.d.mts} +10 -17
  15. package/dist/array/differenceBy.d.ts +3 -1
  16. package/dist/array/differenceBy.js +36 -0
  17. package/dist/array/differenceBy.js.map +1 -0
  18. package/dist/array/differenceBy.mjs +8 -0
  19. package/dist/array/differenceBy.mjs.map +1 -0
  20. package/{esm/array/differenceWith.mjs → dist/array/differenceWith.d.mts} +6 -12
  21. package/dist/array/differenceWith.d.ts +3 -1
  22. package/dist/array/differenceWith.js +37 -0
  23. package/dist/array/differenceWith.js.map +1 -0
  24. package/dist/array/differenceWith.mjs +8 -0
  25. package/dist/array/differenceWith.mjs.map +1 -0
  26. package/{esm/array/drop.mjs → dist/array/drop.d.mts} +4 -6
  27. package/dist/array/drop.d.ts +3 -1
  28. package/dist/array/drop.js +33 -0
  29. package/dist/array/drop.js.map +1 -0
  30. package/dist/array/drop.mjs +8 -0
  31. package/dist/array/drop.mjs.map +1 -0
  32. package/{esm/array/dropRight.mjs → dist/array/dropRight.d.mts} +3 -5
  33. package/dist/array/dropRight.d.ts +3 -1
  34. package/dist/array/dropRight.js +33 -0
  35. package/dist/array/dropRight.js.map +1 -0
  36. package/dist/array/dropRight.mjs +8 -0
  37. package/dist/array/dropRight.mjs.map +1 -0
  38. package/{esm/array/dropRightWhile.mjs → dist/array/dropRightWhile.d.mts} +5 -11
  39. package/dist/array/dropRightWhile.d.ts +3 -1
  40. package/dist/array/dropRightWhile.js +43 -0
  41. package/dist/array/dropRightWhile.js.map +1 -0
  42. package/dist/array/dropRightWhile.mjs +9 -0
  43. package/dist/array/dropRightWhile.mjs.map +1 -0
  44. package/{esm/array/dropWhile.mjs → dist/array/dropWhile.d.mts} +5 -10
  45. package/dist/array/dropWhile.d.ts +3 -1
  46. package/dist/array/dropWhile.js +34 -0
  47. package/dist/array/dropWhile.js.map +1 -0
  48. package/dist/array/dropWhile.mjs +8 -0
  49. package/dist/array/dropWhile.mjs.map +1 -0
  50. package/{esm/array/groupBy.mjs → dist/array/groupBy.d.mts} +5 -26
  51. package/dist/array/groupBy.d.ts +3 -1
  52. package/dist/array/groupBy.js +41 -0
  53. package/dist/array/groupBy.js.map +1 -0
  54. package/dist/array/groupBy.mjs +8 -0
  55. package/dist/array/groupBy.mjs.map +1 -0
  56. package/dist/array/index.d.ts +30 -30
  57. package/dist/array/index.js +199 -842
  58. package/dist/array/index.js.map +1 -0
  59. package/dist/array/index.mjs +125 -0
  60. package/dist/array/index.mjs.map +1 -0
  61. package/{esm/array/intersection.mjs → dist/array/intersection.d.mts} +4 -8
  62. package/dist/array/intersection.d.ts +3 -1
  63. package/dist/array/intersection.js +35 -0
  64. package/dist/array/intersection.js.map +1 -0
  65. package/dist/array/intersection.mjs +8 -0
  66. package/dist/array/intersection.mjs.map +1 -0
  67. package/{esm/array/intersectionBy.mjs → dist/array/intersectionBy.d.mts} +5 -12
  68. package/dist/array/intersectionBy.d.ts +3 -1
  69. package/dist/array/intersectionBy.js +36 -0
  70. package/dist/array/intersectionBy.js.map +1 -0
  71. package/dist/array/intersectionBy.mjs +8 -0
  72. package/dist/array/intersectionBy.mjs.map +1 -0
  73. package/{esm/array/intersectionWith.mjs → dist/array/intersectionWith.d.mts} +6 -12
  74. package/dist/array/intersectionWith.d.ts +3 -1
  75. package/dist/array/intersectionWith.js +37 -0
  76. package/dist/array/intersectionWith.js.map +1 -0
  77. package/dist/array/intersectionWith.mjs +8 -0
  78. package/dist/array/intersectionWith.mjs.map +1 -0
  79. package/{esm/array/partition.mjs → dist/array/partition.d.mts} +8 -30
  80. package/dist/array/partition.d.ts +3 -1
  81. package/dist/array/partition.js +42 -0
  82. package/dist/array/partition.js.map +1 -0
  83. package/dist/array/partition.mjs +8 -0
  84. package/dist/array/partition.mjs.map +1 -0
  85. package/{esm/array/sample.mjs → dist/array/sample.d.mts} +2 -5
  86. package/dist/array/sample.d.ts +3 -1
  87. package/dist/array/sample.js +34 -0
  88. package/dist/array/sample.js.map +1 -0
  89. package/dist/array/sample.mjs +8 -0
  90. package/dist/array/sample.mjs.map +1 -0
  91. package/{esm/array/shuffle.mjs → dist/array/shuffle.d.mts} +2 -13
  92. package/dist/array/shuffle.d.ts +3 -1
  93. package/dist/array/shuffle.js +37 -0
  94. package/dist/array/shuffle.js.map +1 -0
  95. package/dist/array/shuffle.mjs +8 -0
  96. package/dist/array/shuffle.mjs.map +1 -0
  97. package/{esm/array/take.mjs → dist/array/take.d.mts} +5 -7
  98. package/dist/array/take.d.ts +3 -1
  99. package/dist/array/take.js +33 -0
  100. package/dist/array/take.js.map +1 -0
  101. package/dist/array/take.mjs +8 -0
  102. package/dist/array/take.mjs.map +1 -0
  103. package/{esm/array/takeRight.mjs → dist/array/takeRight.d.mts} +5 -10
  104. package/dist/array/takeRight.d.ts +3 -1
  105. package/dist/array/takeRight.js +36 -0
  106. package/dist/array/takeRight.js.map +1 -0
  107. package/dist/array/takeRight.mjs +8 -0
  108. package/dist/array/takeRight.mjs.map +1 -0
  109. package/{esm/array/takeRightWhile.mjs → dist/array/takeRightWhile.d.mts} +5 -12
  110. package/dist/array/takeRightWhile.d.ts +3 -1
  111. package/dist/array/takeRightWhile.js +38 -0
  112. package/dist/array/takeRightWhile.js.map +1 -0
  113. package/dist/array/takeRightWhile.mjs +8 -0
  114. package/dist/array/takeRightWhile.mjs.map +1 -0
  115. package/{esm/array/takeWhile.mjs → dist/array/takeWhile.d.mts} +1 -21
  116. package/dist/array/takeWhile.d.ts +3 -1
  117. package/dist/array/takeWhile.js +40 -0
  118. package/dist/array/takeWhile.js.map +1 -0
  119. package/dist/array/takeWhile.mjs +8 -0
  120. package/dist/array/takeWhile.mjs.map +1 -0
  121. package/{esm/array/union.mjs → dist/array/union.d.mts} +3 -7
  122. package/dist/array/union.d.ts +3 -1
  123. package/dist/array/union.js +47 -0
  124. package/dist/array/union.js.map +1 -0
  125. package/dist/array/union.mjs +9 -0
  126. package/dist/array/union.mjs.map +1 -0
  127. package/{esm/array/unionBy.mjs → dist/array/unionBy.d.mts} +4 -16
  128. package/dist/array/unionBy.d.ts +3 -1
  129. package/dist/array/unionBy.js +40 -0
  130. package/dist/array/unionBy.js.map +1 -0
  131. package/dist/array/unionBy.mjs +8 -0
  132. package/dist/array/unionBy.mjs.map +1 -0
  133. package/{esm/array/unionWith.mjs → dist/array/unionWith.d.mts} +4 -8
  134. package/dist/array/unionWith.d.ts +3 -1
  135. package/dist/array/unionWith.js +47 -0
  136. package/dist/array/unionWith.js.map +1 -0
  137. package/dist/array/unionWith.mjs +9 -0
  138. package/dist/array/unionWith.mjs.map +1 -0
  139. package/dist/array/uniq.d.mts +17 -0
  140. package/dist/array/uniq.d.ts +3 -1
  141. package/dist/array/uniq.js +40 -0
  142. package/dist/array/uniq.js.map +1 -0
  143. package/dist/array/uniq.mjs +8 -0
  144. package/dist/array/uniq.mjs.map +1 -0
  145. package/{esm/array/uniqBy.mjs → dist/array/uniqBy.d.mts} +1 -7
  146. package/dist/array/uniqBy.d.ts +3 -1
  147. package/dist/array/uniqBy.js +47 -0
  148. package/dist/array/uniqBy.js.map +1 -0
  149. package/dist/array/uniqBy.mjs +9 -0
  150. package/dist/array/uniqBy.mjs.map +1 -0
  151. package/dist/array/uniqWith.d.mts +14 -0
  152. package/dist/array/uniqWith.d.ts +3 -1
  153. package/dist/array/uniqWith.js +40 -0
  154. package/dist/array/uniqWith.js.map +1 -0
  155. package/dist/array/uniqWith.mjs +8 -0
  156. package/dist/array/uniqWith.mjs.map +1 -0
  157. package/{esm/array/xor.mjs → dist/array/xor.d.mts} +4 -10
  158. package/dist/array/xor.d.ts +3 -1
  159. package/dist/array/xor.js +66 -0
  160. package/dist/array/xor.js.map +1 -0
  161. package/dist/array/xor.mjs +12 -0
  162. package/dist/array/xor.mjs.map +1 -0
  163. package/{esm/array/xorBy.mjs → dist/array/xorBy.d.mts} +5 -13
  164. package/dist/array/xorBy.d.ts +3 -1
  165. package/dist/array/xorBy.js +65 -0
  166. package/dist/array/xorBy.js.map +1 -0
  167. package/dist/array/xorBy.mjs +11 -0
  168. package/dist/array/xorBy.mjs.map +1 -0
  169. package/{esm/array/xorWith.mjs → dist/array/xorWith.d.mts} +5 -13
  170. package/dist/array/xorWith.d.ts +3 -1
  171. package/dist/array/xorWith.js +72 -0
  172. package/dist/array/xorWith.js.map +1 -0
  173. package/dist/array/xorWith.mjs +12 -0
  174. package/dist/array/xorWith.mjs.map +1 -0
  175. package/dist/array/zip.d.mts +27 -0
  176. package/dist/array/zip.d.ts +6 -4
  177. package/dist/array/zip.js +42 -0
  178. package/dist/array/zip.js.map +1 -0
  179. package/dist/array/zip.mjs +8 -0
  180. package/dist/array/zip.mjs.map +1 -0
  181. package/{esm/array/zipWith.mjs → dist/array/zipWith.d.mts} +6 -26
  182. package/dist/array/zipWith.d.ts +6 -4
  183. package/dist/array/zipWith.js +41 -0
  184. package/dist/array/zipWith.js.map +1 -0
  185. package/dist/array/zipWith.mjs +8 -0
  186. package/dist/array/zipWith.mjs.map +1 -0
  187. package/dist/chunk-2KXLTAVK.mjs +16 -0
  188. package/dist/chunk-2KXLTAVK.mjs.map +1 -0
  189. package/dist/chunk-2MM5EJJX.mjs +21 -0
  190. package/dist/chunk-2MM5EJJX.mjs.map +1 -0
  191. package/dist/chunk-2VB6XU3I.mjs +12 -0
  192. package/dist/chunk-2VB6XU3I.mjs.map +1 -0
  193. package/dist/chunk-35TWSMYS.mjs +19 -0
  194. package/dist/chunk-35TWSMYS.mjs.map +1 -0
  195. package/dist/chunk-5JWSGT4R.mjs +18 -0
  196. package/dist/chunk-5JWSGT4R.mjs.map +1 -0
  197. package/dist/chunk-724PNXPR.mjs +13 -0
  198. package/dist/chunk-724PNXPR.mjs.map +1 -0
  199. package/dist/chunk-7GWOR247.mjs +11 -0
  200. package/dist/chunk-7GWOR247.mjs.map +1 -0
  201. package/dist/chunk-7OZZODAE.mjs +19 -0
  202. package/dist/chunk-7OZZODAE.mjs.map +1 -0
  203. package/dist/chunk-7PPND7QY.mjs +16 -0
  204. package/dist/chunk-7PPND7QY.mjs.map +1 -0
  205. package/dist/chunk-7SJHJHBN.mjs +11 -0
  206. package/dist/chunk-7SJHJHBN.mjs.map +1 -0
  207. package/dist/chunk-ARWKEQMQ.mjs +19 -0
  208. package/dist/chunk-ARWKEQMQ.mjs.map +1 -0
  209. package/dist/chunk-ARZ5BDR6.mjs +1 -0
  210. package/dist/chunk-ARZ5BDR6.mjs.map +1 -0
  211. package/dist/chunk-BAJC3BM7.mjs +12 -0
  212. package/dist/chunk-BAJC3BM7.mjs.map +1 -0
  213. package/dist/chunk-EAI4DDCQ.mjs +16 -0
  214. package/dist/chunk-EAI4DDCQ.mjs.map +1 -0
  215. package/dist/chunk-EAI6NLXI.mjs +12 -0
  216. package/dist/chunk-EAI6NLXI.mjs.map +1 -0
  217. package/dist/chunk-EJGAXTF7.mjs +1 -0
  218. package/dist/chunk-EJGAXTF7.mjs.map +1 -0
  219. package/dist/chunk-FUWEG5ZM.mjs +9 -0
  220. package/dist/chunk-FUWEG5ZM.mjs.map +1 -0
  221. package/dist/chunk-GJM7F3TH.mjs +13 -0
  222. package/dist/chunk-GJM7F3TH.mjs.map +1 -0
  223. package/dist/chunk-HQF6OFGM.mjs +9 -0
  224. package/dist/chunk-HQF6OFGM.mjs.map +1 -0
  225. package/dist/chunk-IJLQVGW4.mjs +1 -0
  226. package/dist/chunk-IJLQVGW4.mjs.map +1 -0
  227. package/dist/chunk-J3NTLMAE.mjs +10 -0
  228. package/dist/chunk-J3NTLMAE.mjs.map +1 -0
  229. package/dist/chunk-JMLFPGZ3.mjs +13 -0
  230. package/dist/chunk-JMLFPGZ3.mjs.map +1 -0
  231. package/dist/chunk-L4Y3G6AJ.mjs +23 -0
  232. package/dist/chunk-L4Y3G6AJ.mjs.map +1 -0
  233. package/dist/chunk-LAZNLIBJ.mjs +10 -0
  234. package/dist/chunk-LAZNLIBJ.mjs.map +1 -0
  235. package/dist/chunk-MAJSPFA6.mjs +1 -0
  236. package/dist/chunk-MAJSPFA6.mjs.map +1 -0
  237. package/dist/chunk-NEMQJ2GF.mjs +18 -0
  238. package/dist/chunk-NEMQJ2GF.mjs.map +1 -0
  239. package/dist/chunk-NK2262VG.mjs +9 -0
  240. package/dist/chunk-NK2262VG.mjs.map +1 -0
  241. package/dist/chunk-NSYWEYWT.mjs +13 -0
  242. package/dist/chunk-NSYWEYWT.mjs.map +1 -0
  243. package/dist/chunk-NYVT33DR.mjs +9 -0
  244. package/dist/chunk-NYVT33DR.mjs.map +1 -0
  245. package/dist/chunk-OBMK7JO2.mjs +13 -0
  246. package/dist/chunk-OBMK7JO2.mjs.map +1 -0
  247. package/dist/chunk-PTQLD7TG.mjs +11 -0
  248. package/dist/chunk-PTQLD7TG.mjs.map +1 -0
  249. package/dist/chunk-PWMHSN27.mjs +14 -0
  250. package/dist/chunk-PWMHSN27.mjs.map +1 -0
  251. package/dist/chunk-QRQPLMV4.mjs +16 -0
  252. package/dist/chunk-QRQPLMV4.mjs.map +1 -0
  253. package/dist/chunk-R5DNKXDI.mjs +21 -0
  254. package/dist/chunk-R5DNKXDI.mjs.map +1 -0
  255. package/dist/chunk-RK6PRCEJ.mjs +12 -0
  256. package/dist/chunk-RK6PRCEJ.mjs.map +1 -0
  257. package/dist/chunk-RLDY4N3Q.mjs +13 -0
  258. package/dist/chunk-RLDY4N3Q.mjs.map +1 -0
  259. package/dist/chunk-RU3RXBUC.mjs +17 -0
  260. package/dist/chunk-RU3RXBUC.mjs.map +1 -0
  261. package/dist/chunk-S767XFOS.mjs +10 -0
  262. package/dist/chunk-S767XFOS.mjs.map +1 -0
  263. package/dist/chunk-SGSQKXDO.mjs +15 -0
  264. package/dist/chunk-SGSQKXDO.mjs.map +1 -0
  265. package/dist/chunk-SYQTG4N4.mjs +1 -0
  266. package/dist/chunk-SYQTG4N4.mjs.map +1 -0
  267. package/dist/chunk-T5JCRGXA.mjs +1 -0
  268. package/dist/chunk-T5JCRGXA.mjs.map +1 -0
  269. package/dist/chunk-TOLR2FNF.mjs +13 -0
  270. package/dist/chunk-TOLR2FNF.mjs.map +1 -0
  271. package/dist/chunk-UNX3KZO2.mjs +17 -0
  272. package/dist/chunk-UNX3KZO2.mjs.map +1 -0
  273. package/dist/chunk-UZP4YX7I.mjs +17 -0
  274. package/dist/chunk-UZP4YX7I.mjs.map +1 -0
  275. package/dist/chunk-VACGGQOL.mjs +9 -0
  276. package/dist/chunk-VACGGQOL.mjs.map +1 -0
  277. package/dist/chunk-VAKCSKGR.mjs +17 -0
  278. package/dist/chunk-VAKCSKGR.mjs.map +1 -0
  279. package/dist/chunk-VJGGYY4Y.mjs +13 -0
  280. package/dist/chunk-VJGGYY4Y.mjs.map +1 -0
  281. package/dist/chunk-WFQ3LAHQ.mjs +9 -0
  282. package/dist/chunk-WFQ3LAHQ.mjs.map +1 -0
  283. package/dist/chunk-XS4ZPJMT.mjs +21 -0
  284. package/dist/chunk-XS4ZPJMT.mjs.map +1 -0
  285. package/dist/chunk-XW452I77.mjs +16 -0
  286. package/dist/chunk-XW452I77.mjs.map +1 -0
  287. package/dist/chunk-YMNXRH52.mjs +9 -0
  288. package/dist/chunk-YMNXRH52.mjs.map +1 -0
  289. package/dist/chunk-Z4IO7EIH.mjs +16 -0
  290. package/dist/chunk-Z4IO7EIH.mjs.map +1 -0
  291. package/{esm/function/debounce.mjs → dist/function/debounce.d.mts} +5 -18
  292. package/dist/function/debounce.d.ts +3 -1
  293. package/dist/function/debounce.js +47 -0
  294. package/dist/function/debounce.js.map +1 -0
  295. package/dist/function/debounce.mjs +8 -0
  296. package/dist/function/debounce.mjs.map +1 -0
  297. package/dist/function/index.d.ts +3 -3
  298. package/dist/function/index.js +47 -78
  299. package/dist/function/index.js.map +1 -0
  300. package/dist/function/index.mjs +17 -0
  301. package/dist/function/index.mjs.map +1 -0
  302. package/{esm/function/once.mjs → dist/function/once.d.mts} +2 -14
  303. package/dist/function/once.d.ts +3 -1
  304. package/dist/function/once.js +43 -0
  305. package/dist/function/once.js.map +1 -0
  306. package/dist/function/once.mjs +8 -0
  307. package/dist/function/once.mjs.map +1 -0
  308. package/{esm/function/throttle.mjs → dist/function/throttle.d.mts} +3 -13
  309. package/dist/function/throttle.d.ts +3 -1
  310. package/dist/function/throttle.js +41 -0
  311. package/dist/function/throttle.js.map +1 -0
  312. package/dist/function/throttle.mjs +8 -0
  313. package/dist/function/throttle.mjs.map +1 -0
  314. package/dist/index.d.ts +45 -6
  315. package/dist/index.js +288 -1271
  316. package/dist/index.js.map +1 -0
  317. package/dist/index.mjs +190 -0
  318. package/dist/index.mjs.map +1 -0
  319. package/{esm/math/clamp.mjs → dist/math/clamp.d.mts} +2 -7
  320. package/dist/math/clamp.d.ts +4 -2
  321. package/dist/math/clamp.js +36 -0
  322. package/dist/math/clamp.js.map +1 -0
  323. package/dist/math/clamp.mjs +8 -0
  324. package/dist/math/clamp.mjs.map +1 -0
  325. package/dist/math/index.d.ts +3 -3
  326. package/dist/math/index.js +41 -132
  327. package/dist/math/index.js.map +1 -0
  328. package/dist/math/index.mjs +17 -0
  329. package/dist/math/index.mjs.map +1 -0
  330. package/{esm/math/round.mjs → dist/math/round.d.mts} +3 -7
  331. package/dist/math/round.d.ts +3 -1
  332. package/dist/math/round.js +34 -0
  333. package/dist/math/round.js.map +1 -0
  334. package/dist/math/round.mjs +8 -0
  335. package/dist/math/round.mjs.map +1 -0
  336. package/dist/math/sum.d.mts +16 -0
  337. package/dist/math/sum.d.ts +3 -1
  338. package/dist/math/sum.js +37 -0
  339. package/dist/math/sum.js.map +1 -0
  340. package/dist/math/sum.mjs +8 -0
  341. package/dist/math/sum.mjs.map +1 -0
  342. package/dist/object/index.d.ts +4 -4
  343. package/dist/object/index.js +62 -256
  344. package/dist/object/index.js.map +1 -0
  345. package/dist/object/index.mjs +21 -0
  346. package/dist/object/index.mjs.map +1 -0
  347. package/{esm/object/omit.mjs → dist/object/omit.d.mts} +2 -19
  348. package/dist/object/omit.d.ts +3 -1
  349. package/dist/object/omit.js +51 -0
  350. package/dist/object/omit.js.map +1 -0
  351. package/dist/object/omit.mjs +8 -0
  352. package/dist/object/omit.mjs.map +1 -0
  353. package/{esm/object/omitBy.mjs → dist/object/omitBy.d.mts} +4 -18
  354. package/dist/object/omitBy.d.ts +3 -1
  355. package/dist/object/omitBy.js +40 -0
  356. package/dist/object/omitBy.js.map +1 -0
  357. package/dist/object/omitBy.mjs +8 -0
  358. package/dist/object/omitBy.mjs.map +1 -0
  359. package/{esm/object/pick.mjs → dist/object/pick.d.mts} +2 -19
  360. package/dist/object/pick.d.ts +3 -1
  361. package/dist/object/pick.js +37 -0
  362. package/dist/object/pick.js.map +1 -0
  363. package/dist/object/pick.mjs +8 -0
  364. package/dist/object/pick.mjs.map +1 -0
  365. package/{esm/object/pickBy.mjs → dist/object/pickBy.d.mts} +4 -18
  366. package/dist/object/pickBy.d.ts +3 -1
  367. package/dist/object/pickBy.js +40 -0
  368. package/dist/object/pickBy.js.map +1 -0
  369. package/dist/object/pickBy.mjs +8 -0
  370. package/dist/object/pickBy.mjs.map +1 -0
  371. package/dist/predicate/index.d.ts +4 -4
  372. package/dist/predicate/index.js +42 -84
  373. package/dist/predicate/index.js.map +1 -0
  374. package/dist/predicate/index.mjs +21 -0
  375. package/dist/predicate/index.mjs.map +1 -0
  376. package/{esm/predicate/isNil.mjs → dist/predicate/isNil.d.mts} +4 -6
  377. package/dist/predicate/isNil.d.ts +3 -1
  378. package/dist/predicate/isNil.js +33 -0
  379. package/dist/predicate/isNil.js.map +1 -0
  380. package/dist/predicate/isNil.mjs +8 -0
  381. package/dist/predicate/isNil.mjs.map +1 -0
  382. package/{esm/predicate/isNotNil.mjs → dist/predicate/isNotNil.d.mts} +2 -4
  383. package/dist/predicate/isNotNil.d.ts +3 -1
  384. package/dist/predicate/isNotNil.js +33 -0
  385. package/dist/predicate/isNotNil.js.map +1 -0
  386. package/dist/predicate/isNotNil.mjs +8 -0
  387. package/dist/predicate/isNotNil.mjs.map +1 -0
  388. package/{esm/predicate/isNull.mjs → dist/predicate/isNull.d.mts} +4 -6
  389. package/dist/predicate/isNull.d.ts +3 -1
  390. package/dist/predicate/isNull.js +33 -0
  391. package/dist/predicate/isNull.js.map +1 -0
  392. package/dist/predicate/isNull.mjs +8 -0
  393. package/dist/predicate/isNull.mjs.map +1 -0
  394. package/{esm/predicate/isUndefined.mjs → dist/predicate/isUndefined.d.mts} +4 -6
  395. package/dist/predicate/isUndefined.d.ts +3 -1
  396. package/dist/predicate/isUndefined.js +33 -0
  397. package/dist/predicate/isUndefined.js.map +1 -0
  398. package/dist/predicate/isUndefined.mjs +8 -0
  399. package/dist/predicate/isUndefined.mjs.map +1 -0
  400. package/{esm/promise/delay.mjs → dist/promise/delay.d.mts} +4 -8
  401. package/dist/promise/delay.d.ts +3 -1
  402. package/dist/promise/delay.js +35 -0
  403. package/dist/promise/delay.js.map +1 -0
  404. package/dist/promise/delay.mjs +8 -0
  405. package/dist/promise/delay.mjs.map +1 -0
  406. package/dist/promise/index.d.ts +1 -1
  407. package/dist/promise/index.js +31 -23
  408. package/dist/promise/index.js.map +1 -0
  409. package/dist/promise/index.mjs +9 -0
  410. package/dist/promise/index.mjs.map +1 -0
  411. package/package.json +120 -49
  412. package/dist/array/chunk.spec.d.ts +0 -1
  413. package/dist/array/difference.spec.d.ts +0 -1
  414. package/dist/array/differenceBy.spec.d.ts +0 -1
  415. package/dist/array/differenceWith.spec.d.ts +0 -1
  416. package/dist/array/drop.spec.d.ts +0 -1
  417. package/dist/array/dropRight.spec.d.ts +0 -1
  418. package/dist/array/dropRightWhile.spec.d.ts +0 -1
  419. package/dist/array/dropWhile.spec.d.ts +0 -1
  420. package/dist/array/groupBy.spec.d.ts +0 -1
  421. package/dist/array/intersection.spec.d.ts +0 -1
  422. package/dist/array/intersectionBy.spec.d.ts +0 -1
  423. package/dist/array/intersectionWith.spec.d.ts +0 -1
  424. package/dist/array/partition.spec.d.ts +0 -1
  425. package/dist/array/sample.spec.d.ts +0 -1
  426. package/dist/array/shuffle.spec.d.ts +0 -1
  427. package/dist/array/take.spec.d.ts +0 -1
  428. package/dist/array/takeRight.spec.d.ts +0 -1
  429. package/dist/array/takeRightWhile.spec.d.ts +0 -1
  430. package/dist/array/takeWhile.spec.d.ts +0 -1
  431. package/dist/array/union.spec.d.ts +0 -1
  432. package/dist/array/unionBy.spec.d.ts +0 -1
  433. package/dist/array/unionWith.spec.d.ts +0 -1
  434. package/dist/array/uniq.spec.d.ts +0 -1
  435. package/dist/array/uniqBy.spec.d.ts +0 -1
  436. package/dist/array/uniqWith.spec.d.ts +0 -1
  437. package/dist/array/xor.spec.d.ts +0 -1
  438. package/dist/array/xorBy.spec.d.ts +0 -1
  439. package/dist/array/xorWith.spec.d.ts +0 -1
  440. package/dist/array/zip.spec.d.ts +0 -1
  441. package/dist/array/zipWith.spec.d.ts +0 -1
  442. package/dist/function/debounce.spec.d.ts +0 -1
  443. package/dist/function/once.spec.d.ts +0 -1
  444. package/dist/function/throttle.spec.d.ts +0 -1
  445. package/dist/math/clamp.spec.d.ts +0 -1
  446. package/dist/math/round.spec.d.ts +0 -1
  447. package/dist/math/sum.spec.d.ts +0 -1
  448. package/dist/object/omit.spec.d.ts +0 -1
  449. package/dist/object/omitBy.spec.d.ts +0 -1
  450. package/dist/object/pick.spec.d.ts +0 -1
  451. package/dist/object/pickBy.spec.d.ts +0 -1
  452. package/dist/predicate/isNil.spec.d.ts +0 -1
  453. package/dist/predicate/isNotNil.spec.d.ts +0 -1
  454. package/dist/predicate/isNull.spec.d.ts +0 -1
  455. package/dist/predicate/isUndefined.spec.d.ts +0 -1
  456. package/dist/promise/delay.spec.d.ts +0 -1
  457. package/esm/_virtual/_rollupPluginBabelHelpers.mjs +0 -163
  458. package/esm/array/_virtual/_rollupPluginBabelHelpers.mjs +0 -78
  459. package/esm/array/uniq.mjs +0 -37
  460. package/esm/array/uniqWith.mjs +0 -39
  461. package/esm/array/zip.mjs +0 -52
  462. package/esm/math/_virtual/_rollupPluginBabelHelpers.mjs +0 -66
  463. package/esm/math/sum.mjs +0 -33
  464. package/esm/object/_virtual/_rollupPluginBabelHelpers.mjs +0 -151
  465. /package/{esm/array/index.mjs → dist/array/index.d.mts} +0 -0
  466. /package/{esm/function/index.mjs → dist/function/index.d.mts} +0 -0
  467. /package/{esm/index.mjs → dist/index.d.mts} +0 -0
  468. /package/{esm/math/index.mjs → dist/math/index.d.mts} +0 -0
  469. /package/{esm/object/index.mjs → dist/object/index.d.mts} +0 -0
  470. /package/{esm/predicate/index.mjs → dist/predicate/index.d.mts} +0 -0
  471. /package/{esm/promise/index.mjs → dist/promise/index.d.mts} +0 -0
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Rounds a number to a specified precision.
3
- *
4
- * This function takes a number and an optional precision value, and returns the number rounded
3
+ *
4
+ * This function takes a number and an optional precision value, and returns the number rounded
5
5
  * to the specified number of decimal places.
6
6
  *
7
7
  * @param {number} value - The number to round.
@@ -13,10 +13,6 @@
13
13
  * const result2 = round(1.2345, 2); // result2 will be 1.23
14
14
  * const result3 = round(1.2345, 3); // result3 will be 1.235
15
15
  */
16
- function round(value) {
17
- var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
18
- var multiplier = Math.pow(10, precision);
19
- return Math.round(value * multiplier) / multiplier;
20
- }
16
+ declare function round(value: number, precision?: number): number;
21
17
 
22
18
  export { round };
@@ -13,4 +13,6 @@
13
13
  * const result2 = round(1.2345, 2); // result2 will be 1.23
14
14
  * const result3 = round(1.2345, 3); // result3 will be 1.235
15
15
  */
16
- export declare function round(value: number, precision?: number): number;
16
+ declare function round(value: number, precision?: number): number;
17
+
18
+ export { round };
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/math/round.ts
21
+ var round_exports = {};
22
+ __export(round_exports, {
23
+ round: () => round
24
+ });
25
+ module.exports = __toCommonJS(round_exports);
26
+ function round(value, precision = 0) {
27
+ const multiplier = Math.pow(10, precision);
28
+ return Math.round(value * multiplier) / multiplier;
29
+ }
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ round
33
+ });
34
+ //# sourceMappingURL=round.js.map
@@ -0,0 +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":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ round
3
+ } from "../chunk-LAZNLIBJ.mjs";
4
+ import "../chunk-2MM5EJJX.mjs";
5
+ export {
6
+ round
7
+ };
8
+ //# sourceMappingURL=round.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Calculates the sum of an array of numbers.
3
+ *
4
+ * This function takes an array of numbers and returns the sum of all the elements in the array.
5
+ *
6
+ * @param {number[]} nums - An array of numbers to be summed.
7
+ * @returns {number} The sum of all the numbers in the array.
8
+ *
9
+ * @example
10
+ * * const numbers = [1, 2, 3, 4, 5];
11
+ * const result = sum(numbers);
12
+ * // result will be 15
13
+ */
14
+ declare function sum(nums: number[]): number;
15
+
16
+ export { sum };
@@ -11,4 +11,6 @@
11
11
  * const result = sum(numbers);
12
12
  * // result will be 15
13
13
  */
14
- export declare function sum(nums: number[]): number;
14
+ declare function sum(nums: number[]): number;
15
+
16
+ export { sum };
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/math/sum.ts
21
+ var sum_exports = {};
22
+ __export(sum_exports, {
23
+ sum: () => sum
24
+ });
25
+ module.exports = __toCommonJS(sum_exports);
26
+ function sum(nums) {
27
+ let result = 0;
28
+ for (const num of nums) {
29
+ result += num;
30
+ }
31
+ return result;
32
+ }
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ sum
36
+ });
37
+ //# sourceMappingURL=sum.js.map
@@ -0,0 +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":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ sum
3
+ } from "../chunk-OBMK7JO2.mjs";
4
+ import "../chunk-2MM5EJJX.mjs";
5
+ export {
6
+ sum
7
+ };
8
+ //# sourceMappingURL=sum.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,4 @@
1
- export { omit } from './omit';
2
- export { omitBy } from './omitBy';
3
- export { pick } from './pick';
4
- export { pickBy } from './pickBy';
1
+ export { omit } from './omit.js';
2
+ export { omitBy } from './omitBy.js';
3
+ export { pick } from './pick.js';
4
+ export { pickBy } from './pickBy.js';
@@ -1,213 +1,59 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- function _iterableToArrayLimit(r, l) {
6
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
7
- if (null != t) {
8
- var e,
9
- n,
10
- i,
11
- u,
12
- a = [],
13
- f = !0,
14
- o = !1;
15
- try {
16
- if (i = (t = t.call(r)).next, 0 === l) {
17
- if (Object(t) !== t) return;
18
- f = !1;
19
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
20
- } catch (r) {
21
- o = !0, n = r;
22
- } finally {
23
- try {
24
- if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
25
- } finally {
26
- if (o) throw n;
27
- }
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __spreadValues = (a, b) => {
10
+ for (var prop in b || (b = {}))
11
+ if (__hasOwnProp.call(b, prop))
12
+ __defNormalProp(a, prop, b[prop]);
13
+ if (__getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(b)) {
15
+ if (__propIsEnum.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
28
17
  }
29
- return a;
30
- }
31
- }
32
- function ownKeys(e, r) {
33
- var t = Object.keys(e);
34
- if (Object.getOwnPropertySymbols) {
35
- var o = Object.getOwnPropertySymbols(e);
36
- r && (o = o.filter(function (r) {
37
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
38
- })), t.push.apply(t, o);
18
+ return a;
19
+ };
20
+ var __export = (target, all) => {
21
+ for (var name in all)
22
+ __defProp(target, name, { get: all[name], enumerable: true });
23
+ };
24
+ var __copyProps = (to, from, except, desc) => {
25
+ if (from && typeof from === "object" || typeof from === "function") {
26
+ for (let key of __getOwnPropNames(from))
27
+ if (!__hasOwnProp.call(to, key) && key !== except)
28
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
39
29
  }
40
- return t;
41
- }
42
- function _objectSpread2(e) {
43
- for (var r = 1; r < arguments.length; r++) {
44
- var t = null != arguments[r] ? arguments[r] : {};
45
- r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
46
- _defineProperty(e, r, t[r]);
47
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
48
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
49
- });
50
- }
51
- return e;
52
- }
53
- function _toPrimitive(t, r) {
54
- if ("object" != typeof t || !t) return t;
55
- var e = t[Symbol.toPrimitive];
56
- if (void 0 !== e) {
57
- var i = e.call(t, r || "default");
58
- if ("object" != typeof i) return i;
59
- throw new TypeError("@@toPrimitive must return a primitive value.");
60
- }
61
- return ("string" === r ? String : Number)(t);
62
- }
63
- function _toPropertyKey(t) {
64
- var i = _toPrimitive(t, "string");
65
- return "symbol" == typeof i ? i : i + "";
66
- }
67
- function _defineProperty(obj, key, value) {
68
- key = _toPropertyKey(key);
69
- if (key in obj) {
70
- Object.defineProperty(obj, key, {
71
- value: value,
72
- enumerable: true,
73
- configurable: true,
74
- writable: true
75
- });
76
- } else {
77
- obj[key] = value;
78
- }
79
- return obj;
80
- }
81
- function _slicedToArray(arr, i) {
82
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
83
- }
84
- function _arrayWithHoles(arr) {
85
- if (Array.isArray(arr)) return arr;
86
- }
87
- function _unsupportedIterableToArray(o, minLen) {
88
- if (!o) return;
89
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
90
- var n = Object.prototype.toString.call(o).slice(8, -1);
91
- if (n === "Object" && o.constructor) n = o.constructor.name;
92
- if (n === "Map" || n === "Set") return Array.from(o);
93
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
94
- }
95
- function _arrayLikeToArray(arr, len) {
96
- if (len == null || len > arr.length) len = arr.length;
97
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
98
- return arr2;
99
- }
100
- function _nonIterableRest() {
101
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
102
- }
103
- function _createForOfIteratorHelper(o, allowArrayLike) {
104
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
105
- if (!it) {
106
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
107
- if (it) o = it;
108
- var i = 0;
109
- var F = function () {};
110
- return {
111
- s: F,
112
- n: function () {
113
- if (i >= o.length) return {
114
- done: true
115
- };
116
- return {
117
- done: false,
118
- value: o[i++]
119
- };
120
- },
121
- e: function (e) {
122
- throw e;
123
- },
124
- f: F
125
- };
126
- }
127
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
128
- }
129
- var normalCompletion = true,
130
- didErr = false,
131
- err;
132
- return {
133
- s: function () {
134
- it = it.call(o);
135
- },
136
- n: function () {
137
- var step = it.next();
138
- normalCompletion = step.done;
139
- return step;
140
- },
141
- e: function (e) {
142
- didErr = true;
143
- err = e;
144
- },
145
- f: function () {
146
- try {
147
- if (!normalCompletion && it.return != null) it.return();
148
- } finally {
149
- if (didErr) throw err;
150
- }
151
- }
152
- };
153
- }
30
+ return to;
31
+ };
32
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+
34
+ // src/object/index.ts
35
+ var object_exports = {};
36
+ __export(object_exports, {
37
+ omit: () => omit,
38
+ omitBy: () => omitBy,
39
+ pick: () => pick,
40
+ pickBy: () => pickBy
41
+ });
42
+ module.exports = __toCommonJS(object_exports);
154
43
 
155
- /**
156
- * Creates a new object with specified keys omitted.
157
- *
158
- * This function takes an object and an array of keys, and returns a new object that
159
- * excludes the properties corresponding to the specified keys.
160
- *
161
- * @param {T} obj - The object to omit keys from.
162
- * @param {K[]} keys - An array of keys to be omitted from the object.
163
- * @returns {Omit<T, K>} A new object with the specified keys omitted.
164
- *
165
- * @example
166
- * * const obj = { a: 1, b: 2, c: 3 };
167
- * const result = omit(obj, ['b', 'c']);
168
- * // result will be { a: 1 }
169
- */
44
+ // src/object/omit.ts
170
45
  function omit(obj, keys) {
171
- var result = _objectSpread2({}, obj);
172
- var _iterator = _createForOfIteratorHelper(keys),
173
- _step;
174
- try {
175
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
176
- var key = _step.value;
177
- delete result[key];
178
- }
179
- } catch (err) {
180
- _iterator.e(err);
181
- } finally {
182
- _iterator.f();
46
+ const result = __spreadValues({}, obj);
47
+ for (const key of keys) {
48
+ delete result[key];
183
49
  }
184
50
  return result;
185
51
  }
186
52
 
187
- /**
188
- * Creates a new object composed of the properties that do not satisfy the predicate function.
189
- *
190
- * This function takes an object and a predicate function, and returns a new object that
191
- * includes only the properties for which the predicate function returns false.
192
- *
193
- * @param {T} obj - The object to omit properties from.
194
- * @param {(value: T[string], key: string) => boolean} shouldOmit - A predicate function that determines
195
- * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`
196
- * if the property should be omitted, and `false` otherwise.
197
- * @returns {Partial<T>} A new object with the properties that do not satisfy the predicate function.
198
- *
199
- * @example
200
- * const obj = { a: 1, b: 'omit', c: 3 };
201
- * const shouldOmit = (key, value) => typeof value === 'string';
202
- * const result = omitBy(obj, shouldOmit);
203
- * // result will be { a: 1, c: 3 }
204
- */
53
+ // src/object/omitBy.ts
205
54
  function omitBy(obj, shouldOmit) {
206
- var result = {};
207
- for (var _i = 0, _Object$entries = Object.entries(obj); _i < _Object$entries.length; _i++) {
208
- var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
209
- key = _Object$entries$_i[0],
210
- value = _Object$entries$_i[1];
55
+ const result = {};
56
+ for (const [key, value] of Object.entries(obj)) {
211
57
  if (shouldOmit(value, key)) {
212
58
  continue;
213
59
  }
@@ -216,62 +62,19 @@ function omitBy(obj, shouldOmit) {
216
62
  return result;
217
63
  }
218
64
 
219
- /**
220
- * Creates a new object composed of the picked object properties.
221
- *
222
- * This function takes an object and an array of keys, and returns a new object that
223
- * includes only the properties corresponding to the specified keys.
224
- *
225
- * @param {T} obj - The object to pick keys from.
226
- * @param {K[]} keys - An array of keys to be picked from the object.
227
- * @returns {Pick<T, K>} A new object with the specified keys picked.
228
- *
229
- * @example
230
- * * const obj = { a: 1, b: 2, c: 3 };
231
- * const result = pick(obj, ['a', 'c']);
232
- * // result will be { a: 1, c: 3 }
233
- */
65
+ // src/object/pick.ts
234
66
  function pick(obj, keys) {
235
- var result = {};
236
- var _iterator = _createForOfIteratorHelper(keys),
237
- _step;
238
- try {
239
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
240
- var key = _step.value;
241
- result[key] = obj[key];
242
- }
243
- } catch (err) {
244
- _iterator.e(err);
245
- } finally {
246
- _iterator.f();
67
+ const result = {};
68
+ for (const key of keys) {
69
+ result[key] = obj[key];
247
70
  }
248
71
  return result;
249
72
  }
250
73
 
251
- /**
252
- * Creates a new object composed of the properties that satisfy the predicate function.
253
- *
254
- * This function takes an object and a predicate function, and returns a new object that
255
- * includes only the properties for which the predicate function returns true.
256
- *
257
- * @param {T} obj - The object to pick properties from.
258
- * @param {(value: T[keyof T], key: string) => boolean} shouldPick - A predicate function that determines
259
- * whether a property should be picked. It takes the property's key and value as arguments and returns `true`
260
- * if the property should be picked, and `false` otherwise.
261
- * @returns {Partial<T>} A new object with the properties that satisfy the predicate function.
262
- *
263
- * @example
264
- * const obj = { a: 1, b: 'pick', c: 3 };
265
- * const shouldPick = (value) => typeof value === 'string';
266
- * const result = pickBy(obj, shouldPick);
267
- * // result will be { b: 'pick' }
268
- */
74
+ // src/object/pickBy.ts
269
75
  function pickBy(obj, shouldPick) {
270
- var result = {};
271
- for (var _i = 0, _Object$entries = Object.entries(obj); _i < _Object$entries.length; _i++) {
272
- var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
273
- key = _Object$entries$_i[0],
274
- value = _Object$entries$_i[1];
76
+ const result = {};
77
+ for (const [key, value] of Object.entries(obj)) {
275
78
  if (!shouldPick(value, key)) {
276
79
  continue;
277
80
  }
@@ -279,8 +82,11 @@ function pickBy(obj, shouldPick) {
279
82
  }
280
83
  return result;
281
84
  }
282
-
283
- exports.omit = omit;
284
- exports.omitBy = omitBy;
285
- exports.pick = pick;
286
- exports.pickBy = pickBy;
85
+ // Annotate the CommonJS export names for ESM import in node:
86
+ 0 && (module.exports = {
87
+ omit,
88
+ omitBy,
89
+ pick,
90
+ pickBy
91
+ });
92
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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":[]}
@@ -0,0 +1,21 @@
1
+ import "../chunk-T5JCRGXA.mjs";
2
+ import {
3
+ pick
4
+ } from "../chunk-724PNXPR.mjs";
5
+ import {
6
+ pickBy
7
+ } from "../chunk-XW452I77.mjs";
8
+ import {
9
+ omit
10
+ } from "../chunk-UZP4YX7I.mjs";
11
+ import {
12
+ omitBy
13
+ } from "../chunk-Z4IO7EIH.mjs";
14
+ import "../chunk-2MM5EJJX.mjs";
15
+ export {
16
+ omit,
17
+ omitBy,
18
+ pick,
19
+ pickBy
20
+ };
21
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,9 +1,7 @@
1
- import { objectSpread2 as _objectSpread2, createForOfIteratorHelper as _createForOfIteratorHelper } from './_virtual/_rollupPluginBabelHelpers.mjs';
2
-
3
1
  /**
4
2
  * Creates a new object with specified keys omitted.
5
3
  *
6
- * This function takes an object and an array of keys, and returns a new object that
4
+ * This function takes an object and an array of keys, and returns a new object that
7
5
  * excludes the properties corresponding to the specified keys.
8
6
  *
9
7
  * @param {T} obj - The object to omit keys from.
@@ -15,21 +13,6 @@ import { objectSpread2 as _objectSpread2, createForOfIteratorHelper as _createFo
15
13
  * const result = omit(obj, ['b', 'c']);
16
14
  * // result will be { a: 1 }
17
15
  */
18
- function omit(obj, keys) {
19
- var result = _objectSpread2({}, obj);
20
- var _iterator = _createForOfIteratorHelper(keys),
21
- _step;
22
- try {
23
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
24
- var key = _step.value;
25
- delete result[key];
26
- }
27
- } catch (err) {
28
- _iterator.e(err);
29
- } finally {
30
- _iterator.f();
31
- }
32
- return result;
33
- }
16
+ declare function omit<T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
34
17
 
35
18
  export { omit };
@@ -13,4 +13,6 @@
13
13
  * const result = omit(obj, ['b', 'c']);
14
14
  * // result will be { a: 1 }
15
15
  */
16
- export declare function omit<T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
16
+ declare function omit<T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
17
+
18
+ export { omit };
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __spreadValues = (a, b) => {
10
+ for (var prop in b || (b = {}))
11
+ if (__hasOwnProp.call(b, prop))
12
+ __defNormalProp(a, prop, b[prop]);
13
+ if (__getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(b)) {
15
+ if (__propIsEnum.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ }
18
+ return a;
19
+ };
20
+ var __export = (target, all) => {
21
+ for (var name in all)
22
+ __defProp(target, name, { get: all[name], enumerable: true });
23
+ };
24
+ var __copyProps = (to, from, except, desc) => {
25
+ if (from && typeof from === "object" || typeof from === "function") {
26
+ for (let key of __getOwnPropNames(from))
27
+ if (!__hasOwnProp.call(to, key) && key !== except)
28
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
29
+ }
30
+ return to;
31
+ };
32
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+
34
+ // src/object/omit.ts
35
+ var omit_exports = {};
36
+ __export(omit_exports, {
37
+ omit: () => omit
38
+ });
39
+ module.exports = __toCommonJS(omit_exports);
40
+ function omit(obj, keys) {
41
+ const result = __spreadValues({}, obj);
42
+ for (const key of keys) {
43
+ delete result[key];
44
+ }
45
+ return result;
46
+ }
47
+ // Annotate the CommonJS export names for ESM import in node:
48
+ 0 && (module.exports = {
49
+ omit
50
+ });
51
+ //# sourceMappingURL=omit.js.map
@@ -0,0 +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":[]}