@stryke/helpers 0.9.14 → 0.9.22

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 (394) hide show
  1. package/CHANGELOG.md +419 -0
  2. package/README.md +33 -25
  3. package/dist/{arg-identity.d.ts → arg-identity-BIir8uzO.d.mts} +5 -1
  4. package/dist/arg-identity-BIir8uzO.d.mts.map +1 -0
  5. package/dist/arg-identity-BfviduMt.mjs +2 -0
  6. package/dist/arg-identity-BfviduMt.mjs.map +1 -0
  7. package/dist/arg-identity-C-pVjd0u.d.cts +14 -0
  8. package/dist/arg-identity-C-pVjd0u.d.cts.map +1 -0
  9. package/dist/arg-identity-dlKw6BsD.cjs +1 -0
  10. package/dist/arg-identity.cjs +1 -9
  11. package/dist/arg-identity.d.cts +2 -0
  12. package/dist/arg-identity.d.mts +2 -0
  13. package/dist/arg-identity.mjs +1 -1
  14. package/dist/debounce-C5O3IDKy.mjs +2 -0
  15. package/dist/debounce-C5O3IDKy.mjs.map +1 -0
  16. package/dist/{debounce.d.ts → debounce-CIMf8-Yr.d.mts} +10 -4
  17. package/dist/debounce-CIMf8-Yr.d.mts.map +1 -0
  18. package/dist/debounce-CLb-VvJv.d.cts +47 -0
  19. package/dist/debounce-CLb-VvJv.d.cts.map +1 -0
  20. package/dist/debounce-SIYbhEOF.cjs +1 -0
  21. package/dist/debounce.cjs +1 -24
  22. package/dist/debounce.d.cts +2 -0
  23. package/dist/debounce.d.mts +2 -0
  24. package/dist/debounce.mjs +1 -1
  25. package/dist/deep-clone-BlN5QTtW.mjs +2 -0
  26. package/dist/deep-clone-BlN5QTtW.mjs.map +1 -0
  27. package/dist/deep-clone-CoUy-Hrt.cjs +1 -0
  28. package/dist/{deep-clone.d.ts → deep-clone-CpLJcTgz.d.mts} +11 -12
  29. package/dist/deep-clone-CpLJcTgz.d.mts.map +1 -0
  30. package/dist/deep-clone-jRNy1xoj.d.cts +65 -0
  31. package/dist/deep-clone-jRNy1xoj.d.cts.map +1 -0
  32. package/dist/deep-clone.cjs +1 -62
  33. package/dist/deep-clone.d.cts +2 -0
  34. package/dist/deep-clone.d.mts +2 -0
  35. package/dist/deep-clone.mjs +1 -1
  36. package/dist/deep-merge-BDZ6c79O.mjs +2 -0
  37. package/dist/deep-merge-BDZ6c79O.mjs.map +1 -0
  38. package/dist/deep-merge-BpFjvumi.cjs +1 -0
  39. package/dist/deep-merge-C9qDSleg.d.cts +26 -0
  40. package/dist/deep-merge-C9qDSleg.d.cts.map +1 -0
  41. package/dist/deep-merge-eCT712Cv.d.mts +26 -0
  42. package/dist/deep-merge-eCT712Cv.d.mts.map +1 -0
  43. package/dist/deep-merge.cjs +1 -36
  44. package/dist/deep-merge.d.cts +2 -0
  45. package/dist/deep-merge.d.mts +2 -0
  46. package/dist/deep-merge.mjs +1 -1
  47. package/dist/{delay.d.ts → delay-Bd_sGzMj.d.mts} +9 -4
  48. package/dist/delay-Bd_sGzMj.d.mts.map +1 -0
  49. package/dist/delay-UwR_fCwt.cjs +1 -0
  50. package/dist/delay-VkcrQf1l.d.cts +77 -0
  51. package/dist/delay-VkcrQf1l.d.cts.map +1 -0
  52. package/dist/delay-wdNbY6sk.mjs +2 -0
  53. package/dist/delay-wdNbY6sk.mjs.map +1 -0
  54. package/dist/delay.cjs +1 -28
  55. package/dist/delay.d.cts +2 -0
  56. package/dist/delay.d.mts +2 -0
  57. package/dist/delay.mjs +1 -1
  58. package/dist/errors-BXYY8wXj.cjs +1 -0
  59. package/dist/errors-DWX9ET_b.mjs +2 -0
  60. package/dist/errors-DWX9ET_b.mjs.map +1 -0
  61. package/dist/errors.cjs +1 -18
  62. package/dist/errors.d.cts +16 -0
  63. package/dist/errors.d.cts.map +1 -0
  64. package/dist/errors.d.mts +16 -0
  65. package/dist/errors.d.mts.map +1 -0
  66. package/dist/errors.mjs +1 -1
  67. package/dist/filter-empty-5_nMg04e.cjs +1 -0
  68. package/dist/filter-empty-BMtd0K07.d.mts +5 -0
  69. package/dist/filter-empty-BMtd0K07.d.mts.map +1 -0
  70. package/dist/filter-empty-C2fq9M7o.d.cts +5 -0
  71. package/dist/filter-empty-C2fq9M7o.d.cts.map +1 -0
  72. package/dist/filter-empty-Dsc1ymCj.mjs +2 -0
  73. package/dist/filter-empty-Dsc1ymCj.mjs.map +1 -0
  74. package/dist/filter-empty.cjs +1 -9
  75. package/dist/filter-empty.d.cts +2 -0
  76. package/dist/filter-empty.d.mts +2 -0
  77. package/dist/filter-empty.mjs +1 -1
  78. package/dist/{flatten-object.d.ts → flatten-object-Bk2VT-b2.d.mts} +8 -6
  79. package/dist/flatten-object-Bk2VT-b2.d.mts.map +1 -0
  80. package/dist/flatten-object-D-EbEZqR.cjs +1 -0
  81. package/dist/flatten-object-DFCZmly9.mjs +2 -0
  82. package/dist/flatten-object-DFCZmly9.mjs.map +1 -0
  83. package/dist/{unflatten-object.d.ts → flatten-object-DjaJJaY0.d.cts} +8 -6
  84. package/dist/flatten-object-DjaJJaY0.d.cts.map +1 -0
  85. package/dist/flatten-object.cjs +1 -20
  86. package/dist/flatten-object.d.cts +2 -0
  87. package/dist/flatten-object.d.mts +2 -0
  88. package/dist/flatten-object.mjs +1 -1
  89. package/dist/{get-field.d.ts → get-field-5XqtknPs.d.mts} +25 -22
  90. package/dist/get-field-5XqtknPs.d.mts.map +1 -0
  91. package/dist/get-field-D4F_p-Ov.cjs +1 -0
  92. package/dist/get-field-ngQ9O38X.mjs +2 -0
  93. package/dist/get-field-ngQ9O38X.mjs.map +1 -0
  94. package/dist/get-field-oltWWNRO.d.cts +254 -0
  95. package/dist/get-field-oltWWNRO.d.cts.map +1 -0
  96. package/dist/get-field.cjs +1 -43
  97. package/dist/get-field.d.cts +2 -0
  98. package/dist/get-field.d.mts +2 -0
  99. package/dist/get-field.mjs +1 -1
  100. package/dist/get-object-tag-D53RvMgo.cjs +1 -0
  101. package/dist/get-object-tag-oBoWkttN.mjs +2 -0
  102. package/dist/get-object-tag-oBoWkttN.mjs.map +1 -0
  103. package/dist/{get-ordered-by.d.ts → get-ordered-by-C45FfW2T.d.mts} +5 -2
  104. package/dist/get-ordered-by-C45FfW2T.d.mts.map +1 -0
  105. package/dist/get-ordered-by-CBKKJr4R.mjs +2 -0
  106. package/dist/get-ordered-by-CBKKJr4R.mjs.map +1 -0
  107. package/dist/get-ordered-by-D2Sr6vUN.cjs +1 -0
  108. package/dist/get-ordered-by-DuD7QRma.d.cts +39 -0
  109. package/dist/get-ordered-by-DuD7QRma.d.cts.map +1 -0
  110. package/dist/get-ordered-by.cjs +1 -18
  111. package/dist/get-ordered-by.d.cts +2 -0
  112. package/dist/get-ordered-by.d.mts +2 -0
  113. package/dist/get-ordered-by.mjs +1 -1
  114. package/dist/get-unique-BOiakY6A.cjs +1 -0
  115. package/dist/{get-unique.d.ts → get-unique-C0SBPUBv.d.cts} +6 -2
  116. package/dist/get-unique-C0SBPUBv.d.cts.map +1 -0
  117. package/dist/get-unique-DZ6E1Kvc.d.mts +26 -0
  118. package/dist/get-unique-DZ6E1Kvc.d.mts.map +1 -0
  119. package/dist/get-unique-DzZ7Z34U.mjs +2 -0
  120. package/dist/get-unique-DzZ7Z34U.mjs.map +1 -0
  121. package/dist/get-unique.cjs +1 -17
  122. package/dist/get-unique.d.cts +2 -0
  123. package/dist/get-unique.d.mts +2 -0
  124. package/dist/get-unique.mjs +1 -1
  125. package/dist/{identity.d.ts → identity-B_cGeF8o.d.mts} +5 -1
  126. package/dist/identity-B_cGeF8o.d.mts.map +1 -0
  127. package/dist/identity-DBwwvmGU.mjs +2 -0
  128. package/dist/identity-DBwwvmGU.mjs.map +1 -0
  129. package/dist/identity-DRhIvbPG.d.cts +18 -0
  130. package/dist/identity-DRhIvbPG.d.cts.map +1 -0
  131. package/dist/identity-z2xaIqpe.cjs +1 -0
  132. package/dist/identity.cjs +1 -9
  133. package/dist/identity.d.cts +2 -0
  134. package/dist/identity.d.mts +2 -0
  135. package/dist/identity.mjs +1 -1
  136. package/dist/index.cjs +1 -346
  137. package/dist/index.d.cts +32 -0
  138. package/dist/index.d.mts +32 -0
  139. package/dist/index.mjs +1 -1
  140. package/dist/is-empty-C7vlSVFD.mjs +2 -0
  141. package/dist/is-empty-C7vlSVFD.mjs.map +1 -0
  142. package/dist/is-empty-DZZDqzjD.cjs +1 -0
  143. package/dist/is-equal-0Z-K2uIG.mjs +2 -0
  144. package/dist/is-equal-0Z-K2uIG.mjs.map +1 -0
  145. package/dist/is-equal-BJgVhUVS.cjs +1 -0
  146. package/dist/{is-equal.d.ts → is-equal-BMlMHlVi.d.cts} +5 -1
  147. package/dist/is-equal-BMlMHlVi.d.cts.map +1 -0
  148. package/dist/is-equal-Baqurdpn.d.mts +22 -0
  149. package/dist/is-equal-Baqurdpn.d.mts.map +1 -0
  150. package/dist/is-equal.cjs +1 -61
  151. package/dist/is-equal.d.cts +2 -0
  152. package/dist/is-equal.d.mts +2 -0
  153. package/dist/is-equal.mjs +1 -1
  154. package/dist/is-number-BcjxCzDM.cjs +1 -0
  155. package/dist/is-number-bwhfkHlC.mjs +2 -0
  156. package/dist/is-number-bwhfkHlC.mjs.map +1 -0
  157. package/dist/is-plain-object-BQuFhL4M.cjs +1 -0
  158. package/dist/is-plain-object-D8GSMOhY.mjs +2 -0
  159. package/dist/is-plain-object-D8GSMOhY.mjs.map +1 -0
  160. package/dist/is-set-B9o0NIT4.mjs +2 -0
  161. package/dist/is-set-B9o0NIT4.mjs.map +1 -0
  162. package/dist/is-set-ByJOY6h2.cjs +1 -0
  163. package/dist/is-set-string-48_jZFw0.cjs +1 -0
  164. package/dist/is-set-string-Dr1MlMk0.mjs +2 -0
  165. package/dist/is-set-string-Dr1MlMk0.mjs.map +1 -0
  166. package/dist/is-string-CvmuuuDj.mjs +2 -0
  167. package/dist/is-string-CvmuuuDj.mjs.map +1 -0
  168. package/dist/is-string-DPanLeA_.cjs +1 -0
  169. package/dist/lru-cache-CzQ_kKXk.d.mts +103 -0
  170. package/dist/lru-cache-CzQ_kKXk.d.mts.map +1 -0
  171. package/dist/lru-cache-D4VEIgtR.d.cts +103 -0
  172. package/dist/lru-cache-D4VEIgtR.d.cts.map +1 -0
  173. package/dist/lru-cache-DLY_yZRN.mjs +2 -0
  174. package/dist/lru-cache-DLY_yZRN.mjs.map +1 -0
  175. package/dist/lru-cache-DgTSGx5W.cjs +1 -0
  176. package/dist/lru-cache.cjs +1 -82
  177. package/dist/lru-cache.d.cts +2 -0
  178. package/dist/lru-cache.d.mts +2 -0
  179. package/dist/lru-cache.mjs +1 -1
  180. package/dist/match-sorter-B9_7YvTo.mjs +2 -0
  181. package/dist/match-sorter-B9_7YvTo.mjs.map +1 -0
  182. package/dist/match-sorter-BjnWjkKu.cjs +1 -0
  183. package/dist/{match-sorter.d.ts → match-sorter-CMYN3GuY.d.cts} +44 -43
  184. package/dist/match-sorter-CMYN3GuY.d.cts.map +1 -0
  185. package/dist/match-sorter-DCRerxVe.d.mts +78 -0
  186. package/dist/match-sorter-DCRerxVe.d.mts.map +1 -0
  187. package/dist/match-sorter.cjs +1 -184
  188. package/dist/match-sorter.d.cts +2 -0
  189. package/dist/match-sorter.d.mts +2 -0
  190. package/dist/match-sorter.mjs +1 -1
  191. package/dist/memoize-Cr5jFKxi.mjs +2 -0
  192. package/dist/memoize-Cr5jFKxi.mjs.map +1 -0
  193. package/dist/memoize-TyrmWrfR.d.mts +11 -0
  194. package/dist/memoize-TyrmWrfR.d.mts.map +1 -0
  195. package/dist/memoize-qxvbI-0y.cjs +1 -0
  196. package/dist/memoize-tSTYY522.d.cts +11 -0
  197. package/dist/memoize-tSTYY522.d.cts.map +1 -0
  198. package/dist/memoize.cjs +1 -12
  199. package/dist/memoize.d.cts +2 -0
  200. package/dist/memoize.d.mts +2 -0
  201. package/dist/memoize.mjs +1 -1
  202. package/dist/mutex-CnQQBndt.cjs +1 -0
  203. package/dist/mutex-DAZduiSP.d.mts +72 -0
  204. package/dist/mutex-DAZduiSP.d.mts.map +1 -0
  205. package/dist/mutex-DCyX7B66.d.cts +72 -0
  206. package/dist/mutex-DCyX7B66.d.cts.map +1 -0
  207. package/dist/mutex-TqoKHosg.mjs +2 -0
  208. package/dist/mutex-TqoKHosg.mjs.map +1 -0
  209. package/dist/mutex.cjs +1 -20
  210. package/dist/mutex.d.cts +2 -0
  211. package/dist/mutex.d.mts +2 -0
  212. package/dist/mutex.mjs +1 -1
  213. package/dist/noop-B7OetrhD.mjs +2 -0
  214. package/dist/noop-B7OetrhD.mjs.map +1 -0
  215. package/dist/{noop.d.ts → noop-BnXKMH6Z.d.mts} +6 -2
  216. package/dist/noop-BnXKMH6Z.d.mts.map +1 -0
  217. package/dist/noop-CnJXOCpF.d.cts +22 -0
  218. package/dist/noop-CnJXOCpF.d.cts.map +1 -0
  219. package/dist/noop-Dpf7hIui.cjs +1 -0
  220. package/dist/noop.cjs +1 -10
  221. package/dist/noop.d.cts +2 -0
  222. package/dist/noop.d.mts +2 -0
  223. package/dist/noop.mjs +1 -1
  224. package/dist/object-CHmrmQna.d.mts +160 -0
  225. package/dist/object-CHmrmQna.d.mts.map +1 -0
  226. package/dist/object-D8HGAGMr.d.cts +160 -0
  227. package/dist/object-D8HGAGMr.d.cts.map +1 -0
  228. package/dist/omit-A0uVyAS4.cjs +1 -0
  229. package/dist/omit-BROsDK0D.mjs +2 -0
  230. package/dist/omit-BROsDK0D.mjs.map +1 -0
  231. package/dist/{omit.d.ts → omit-D1FKiOYz.d.cts} +5 -1
  232. package/dist/omit-D1FKiOYz.d.cts.map +1 -0
  233. package/dist/omit-DpqOAtKt.d.mts +22 -0
  234. package/dist/omit-DpqOAtKt.d.mts.map +1 -0
  235. package/dist/omit.cjs +1 -16
  236. package/dist/omit.d.cts +2 -0
  237. package/dist/omit.d.mts +2 -0
  238. package/dist/omit.mjs +1 -1
  239. package/dist/once-DNPPQd3P.d.mts +13 -0
  240. package/dist/once-DNPPQd3P.d.mts.map +1 -0
  241. package/dist/once-DZCwmdkv.cjs +1 -0
  242. package/dist/once-DqmxXwEB.d.cts +13 -0
  243. package/dist/once-DqmxXwEB.d.cts.map +1 -0
  244. package/dist/once-txoW63yJ.mjs +2 -0
  245. package/dist/once-txoW63yJ.mjs.map +1 -0
  246. package/dist/once.cjs +1 -17
  247. package/dist/once.d.cts +2 -0
  248. package/dist/once.d.mts +2 -0
  249. package/dist/once.mjs +1 -1
  250. package/dist/pick-CuXTvXaw.mjs +2 -0
  251. package/dist/pick-CuXTvXaw.mjs.map +1 -0
  252. package/dist/{pick.d.ts → pick-DXREvZBr.d.cts} +5 -1
  253. package/dist/pick-DXREvZBr.d.cts.map +1 -0
  254. package/dist/pick-GDOwAh6I.cjs +1 -0
  255. package/dist/pick-ZrWD4de2.d.mts +22 -0
  256. package/dist/pick-ZrWD4de2.d.mts.map +1 -0
  257. package/dist/pick.cjs +1 -14
  258. package/dist/pick.d.cts +2 -0
  259. package/dist/pick.d.mts +2 -0
  260. package/dist/pick.mjs +1 -1
  261. package/dist/remove-accents-BFmyvTRZ.mjs +2 -0
  262. package/dist/remove-accents-BFmyvTRZ.mjs.map +1 -0
  263. package/dist/remove-accents-C4C0A2ex.d.mts +12 -0
  264. package/dist/remove-accents-C4C0A2ex.d.mts.map +1 -0
  265. package/dist/remove-accents-CXBUC-Id.cjs +1 -0
  266. package/dist/remove-accents-Yo3-2jWO.d.cts +12 -0
  267. package/dist/remove-accents-Yo3-2jWO.d.cts.map +1 -0
  268. package/dist/remove-accents.cjs +1 -411
  269. package/dist/remove-accents.d.cts +2 -0
  270. package/dist/remove-accents.d.mts +2 -0
  271. package/dist/remove-accents.mjs +1 -1
  272. package/dist/remove-empty-items-BglsRCyG.d.cts +11 -0
  273. package/dist/remove-empty-items-BglsRCyG.d.cts.map +1 -0
  274. package/dist/remove-empty-items-BzI9Vid9.mjs +2 -0
  275. package/dist/remove-empty-items-BzI9Vid9.mjs.map +1 -0
  276. package/dist/remove-empty-items-COwdCPHC.d.mts +11 -0
  277. package/dist/remove-empty-items-COwdCPHC.d.mts.map +1 -0
  278. package/dist/remove-empty-items-CjTxJuyS.cjs +1 -0
  279. package/dist/remove-empty-items.cjs +1 -8
  280. package/dist/remove-empty-items.d.cts +2 -0
  281. package/dist/remove-empty-items.d.mts +2 -0
  282. package/dist/remove-empty-items.mjs +1 -1
  283. package/dist/semaphore-4zJqtox8.mjs +2 -0
  284. package/dist/semaphore-4zJqtox8.mjs.map +1 -0
  285. package/dist/semaphore-CsGTxqsW.d.cts +86 -0
  286. package/dist/semaphore-CsGTxqsW.d.cts.map +1 -0
  287. package/dist/semaphore-DkHqPlow.cjs +1 -0
  288. package/dist/semaphore-WaZBtCk5.d.mts +86 -0
  289. package/dist/semaphore-WaZBtCk5.d.mts.map +1 -0
  290. package/dist/semaphore.cjs +1 -32
  291. package/dist/semaphore.d.cts +2 -0
  292. package/dist/semaphore.d.mts +2 -0
  293. package/dist/semaphore.mjs +1 -1
  294. package/dist/set-field-CUgbKEjW.mjs +2 -0
  295. package/dist/set-field-CUgbKEjW.mjs.map +1 -0
  296. package/dist/set-field-CcCiXZNl.d.cts +16 -0
  297. package/dist/set-field-CcCiXZNl.d.cts.map +1 -0
  298. package/dist/set-field-DyvXgpNP.d.mts +16 -0
  299. package/dist/set-field-DyvXgpNP.d.mts.map +1 -0
  300. package/dist/set-field-mr4GkhFb.cjs +1 -0
  301. package/dist/set-field.cjs +1 -21
  302. package/dist/set-field.d.cts +2 -0
  303. package/dist/set-field.d.mts +2 -0
  304. package/dist/set-field.mjs +1 -1
  305. package/dist/throttle-BOKOTo3m.cjs +1 -0
  306. package/dist/{throttle.d.ts → throttle-BWPQuZty.d.cts} +5 -1
  307. package/dist/throttle-BWPQuZty.d.cts.map +1 -0
  308. package/dist/throttle-BgU4k6qs.d.mts +32 -0
  309. package/dist/throttle-BgU4k6qs.d.mts.map +1 -0
  310. package/dist/throttle-CYK3F0mZ.mjs +2 -0
  311. package/dist/throttle-CYK3F0mZ.mjs.map +1 -0
  312. package/dist/throttle.cjs +1 -13
  313. package/dist/throttle.d.cts +2 -0
  314. package/dist/throttle.d.mts +2 -0
  315. package/dist/throttle.mjs +1 -1
  316. package/dist/timeout-43rG9ETK.mjs +2 -0
  317. package/dist/timeout-43rG9ETK.mjs.map +1 -0
  318. package/dist/{timeout.d.ts → timeout-CLhwG-oo.d.mts} +5 -1
  319. package/dist/timeout-CLhwG-oo.d.mts.map +1 -0
  320. package/dist/timeout-CoYbhliP.cjs +1 -0
  321. package/dist/timeout-DC38jHR8.d.cts +12 -0
  322. package/dist/timeout-DC38jHR8.d.cts.map +1 -0
  323. package/dist/timeout.cjs +1 -11
  324. package/dist/timeout.d.cts +2 -0
  325. package/dist/timeout.d.mts +2 -0
  326. package/dist/timeout.mjs +1 -1
  327. package/dist/to-deep-key-Cma9aiEz.cjs +1 -0
  328. package/dist/to-deep-key-D8uDBd6T.mjs +2 -0
  329. package/dist/to-deep-key-D8uDBd6T.mjs.map +1 -0
  330. package/dist/{to-deep-key.d.ts → to-deep-key-DO-Z0Zjs.d.mts} +6 -2
  331. package/dist/to-deep-key-DO-Z0Zjs.d.mts.map +1 -0
  332. package/dist/to-deep-key-DlsE4ziE.d.cts +42 -0
  333. package/dist/to-deep-key-DlsE4ziE.d.cts.map +1 -0
  334. package/dist/to-deep-key.cjs +1 -15
  335. package/dist/to-deep-key.d.cts +2 -0
  336. package/dist/to-deep-key.d.mts +2 -0
  337. package/dist/to-deep-key.mjs +1 -1
  338. package/dist/{to-path.d.ts → to-path-BajxeMmo.d.mts} +5 -1
  339. package/dist/to-path-BajxeMmo.d.mts.map +1 -0
  340. package/dist/to-path-CdOFd4od.cjs +1 -0
  341. package/dist/to-path-D2zWXeYc.d.cts +24 -0
  342. package/dist/to-path-D2zWXeYc.d.cts.map +1 -0
  343. package/dist/to-path-Dm1fe-Ix.mjs +2 -0
  344. package/dist/to-path-Dm1fe-Ix.mjs.map +1 -0
  345. package/dist/to-path.cjs +1 -23
  346. package/dist/to-path.d.cts +2 -0
  347. package/dist/to-path.d.mts +2 -0
  348. package/dist/to-path.mjs +1 -1
  349. package/dist/unflatten-object-C7TE8J80.mjs +2 -0
  350. package/dist/unflatten-object-C7TE8J80.mjs.map +1 -0
  351. package/dist/unflatten-object-CPJIUozj.d.mts +35 -0
  352. package/dist/unflatten-object-CPJIUozj.d.mts.map +1 -0
  353. package/dist/unflatten-object-CvZj41LG.cjs +1 -0
  354. package/dist/unflatten-object-Cvbj7Q__.d.cts +35 -0
  355. package/dist/unflatten-object-Cvbj7Q__.d.cts.map +1 -0
  356. package/dist/unflatten-object.cjs +1 -10
  357. package/dist/unflatten-object.d.cts +2 -0
  358. package/dist/unflatten-object.d.mts +2 -0
  359. package/dist/unflatten-object.mjs +1 -1
  360. package/dist/{union.d.ts → union-BMOMEzO-.d.cts} +5 -1
  361. package/dist/union-BMOMEzO-.d.cts.map +1 -0
  362. package/dist/union-C-2CRoFc.mjs +2 -0
  363. package/dist/union-C-2CRoFc.mjs.map +1 -0
  364. package/dist/union-D4bbjM2i.d.mts +24 -0
  365. package/dist/union-D4bbjM2i.d.mts.map +1 -0
  366. package/dist/union-EwdcZzNT.cjs +1 -0
  367. package/dist/union.cjs +1 -10
  368. package/dist/union.d.cts +2 -0
  369. package/dist/union.d.mts +2 -0
  370. package/dist/union.mjs +1 -1
  371. package/dist/{with-timeout.d.ts → with-timeout-BPaAIZtS.d.cts} +5 -1
  372. package/dist/with-timeout-BPaAIZtS.d.cts.map +1 -0
  373. package/dist/with-timeout-BoZYdcOg.d.mts +24 -0
  374. package/dist/with-timeout-BoZYdcOg.d.mts.map +1 -0
  375. package/dist/with-timeout-CAuUr1ck.mjs +2 -0
  376. package/dist/with-timeout-CAuUr1ck.mjs.map +1 -0
  377. package/dist/with-timeout-CPUBGT4X.cjs +1 -0
  378. package/dist/with-timeout.cjs +1 -10
  379. package/dist/with-timeout.d.cts +2 -0
  380. package/dist/with-timeout.d.mts +2 -0
  381. package/dist/with-timeout.mjs +1 -1
  382. package/package.json +91 -440
  383. package/dist/deep-merge.d.ts +0 -22
  384. package/dist/errors.d.ts +0 -12
  385. package/dist/filter-empty.d.ts +0 -1
  386. package/dist/index.d.ts +0 -31
  387. package/dist/lru-cache.d.ts +0 -99
  388. package/dist/memoize.d.ts +0 -7
  389. package/dist/mutex.d.ts +0 -68
  390. package/dist/once.d.ts +0 -9
  391. package/dist/remove-accents.d.ts +0 -8
  392. package/dist/remove-empty-items.d.ts +0 -7
  393. package/dist/semaphore.d.ts +0 -82
  394. package/dist/set-field.d.ts +0 -10
@@ -0,0 +1,47 @@
1
+ //#region src/debounce.d.ts
2
+ interface DebounceOptions {
3
+ signal?: AbortSignal;
4
+ }
5
+ /**
6
+ * Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds
7
+ * have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`
8
+ * method to cancel any pending execution.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * const debouncedFunction = debounce(() => {
13
+ * console.log('Function executed');
14
+ * }, 1000);
15
+ *
16
+ * // Will log 'Function executed' after 1 second if not called again in that time
17
+ * debouncedFunction();
18
+ *
19
+ * // Will not log anything as the previous call is canceled
20
+ * debouncedFunction.cancel();
21
+ *
22
+ * // With AbortSignal
23
+ * const controller = new AbortController();
24
+ * const signal = controller.signal;
25
+ * const debouncedWithSignal = debounce(() => {
26
+ * console.log('Function executed');
27
+ * }, 1000, { signal });
28
+ *
29
+ * debouncedWithSignal();
30
+ *
31
+ * // Will cancel the debounced function call
32
+ * controller.abort();
33
+ * ```
34
+ *
35
+ * @param func - The function to debounce.
36
+ * @param debounceMs - The number of milliseconds to delay.
37
+ * @param options - The options object.
38
+ * @returns A new debounced function with a `cancel` method.
39
+ */
40
+ declare function debounce<F extends (...args: any[]) => void>(func: F, debounceMs: number, {
41
+ signal
42
+ }?: DebounceOptions): F & {
43
+ cancel: () => void;
44
+ };
45
+ //#endregion
46
+ export { debounce as n, DebounceOptions as t };
47
+ //# sourceMappingURL=debounce-CLb-VvJv.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounce-CLb-VvJv.d.cts","names":[],"sources":["../src/debounce.ts"],"sourcesContent":[],"mappings":";UAiBiB,eAAA;EAAA,MAAA,CAAA,EACN,WADqB;AAuChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,mDACR;;IAEM,kBACX"}
@@ -0,0 +1 @@
1
+ function e(e,t,{signal:n}={}){let r=null,i=((...i)=>{r!==null&&clearTimeout(r),!n?.aborted&&(r=setTimeout(()=>{e(...i),r=null},t))});return i.cancel=()=>{r!==null&&(clearTimeout(r),r=null)},n?.addEventListener(`abort`,()=>{i.cancel()},{once:!0}),i}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
package/dist/debounce.cjs CHANGED
@@ -1,24 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.debounce = debounce;
7
- function debounce(o, u, {
8
- signal: t
9
- } = {}) {
10
- let e = null;
11
- const n = (...r) => {
12
- e !== null && clearTimeout(e), !t?.aborted && (e = setTimeout(() => {
13
- o(...r), e = null;
14
- }, u));
15
- },
16
- l = () => {
17
- n.cancel();
18
- };
19
- return n.cancel = () => {
20
- e !== null && (clearTimeout(e), e = null);
21
- }, t?.addEventListener("abort", l, {
22
- once: !0
23
- }), n;
24
- }
1
+ const e=require(`./debounce-SIYbhEOF.cjs`);exports.debounce=e.t;
@@ -0,0 +1,2 @@
1
+ import { n as debounce, t as DebounceOptions } from "./debounce-CLb-VvJv.cjs";
2
+ export { DebounceOptions, debounce };
@@ -0,0 +1,2 @@
1
+ import { n as debounce, t as DebounceOptions } from "./debounce-CIMf8-Yr.mjs";
2
+ export { DebounceOptions, debounce };
package/dist/debounce.mjs CHANGED
@@ -1 +1 @@
1
- export function debounce(o,u,{signal:t}={}){let e=null;const n=((...r)=>{e!==null&&clearTimeout(e),!t?.aborted&&(e=setTimeout(()=>{o(...r),e=null},u))}),l=()=>{n.cancel()};return n.cancel=()=>{e!==null&&(clearTimeout(e),e=null)},t?.addEventListener("abort",l,{once:!0}),n}
1
+ import{t as e}from"./debounce-C5O3IDKy.mjs";export{e as debounce};
@@ -0,0 +1,2 @@
1
+ const e=e=>{try{return e==null||typeof e!=`object`&&typeof e!=`function`}catch{return!1}};function t(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof BigUint64Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof BigInt64Array||e instanceof Float32Array||e instanceof Float64Array}function n(i){if(e(i))return i;if(Array.isArray(i))return i.map(e=>n(e));if(i instanceof Date)return new Date(i.getTime());if(i instanceof RegExp)return new RegExp(i.source,i.flags);if(i instanceof Map){let e=new Map;for(let[t,r]of i.entries())e.set(t,n(r));return e}if(i instanceof Set){let e=new Set;for(let t of i.values())e.add(n(t));return e}if(t(i)){let e=new(Object.getPrototypeOf(i)).constructor(i.length);for(let[t,r]of i.entries())e[t]=n(r);return e}if(i instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&i instanceof SharedArrayBuffer)return[...i];if(i instanceof DataView){let e=new DataView([...i.buffer]);return r(i,e),e}if(typeof File<`u`&&i instanceof File){let e=new File([i],i.name,{type:i.type});return r(i,e),e}if(i instanceof Blob){let e=new Blob([i],{type:i.type});return r(i,e),e}if(i instanceof Error){let e=new i.constructor;return e.message=i.message,e.name=i.name,e.stack=i.stack,e.cause=i.cause,r(i,e),e}if(typeof i==`object`&&i){let e={};return r(i,e),e}return i}function r(e,t){let r=Object.keys(e);for(let i of r){let r=Object.getOwnPropertyDescriptor(e,i);(r?.writable||r?.set)&&(t[i]=n(e[i]))}}export{n as t};
2
+ //# sourceMappingURL=deep-clone-BlN5QTtW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep-clone-BlN5QTtW.mjs","names":[],"sources":["../../type-checks/src/is-primitive.ts","../../type-checks/src/is-typed-array.ts","../src/deep-clone.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isPrimitive = (value: unknown): boolean => {\n try {\n return (\n value === undefined ||\n value === null ||\n (typeof value !== \"object\" && typeof value !== \"function\")\n );\n } catch {\n return false;\n }\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport function isTypedArray(\n obj: any\n): obj is\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | BigUint64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | BigInt64Array\n | Float32Array\n | Float64Array {\n return (\n obj instanceof Uint8Array ||\n obj instanceof Uint8ClampedArray ||\n obj instanceof Uint16Array ||\n obj instanceof Uint32Array ||\n obj instanceof BigUint64Array ||\n obj instanceof Int8Array ||\n obj instanceof Int16Array ||\n obj instanceof Int32Array ||\n obj instanceof BigInt64Array ||\n obj instanceof Float32Array ||\n obj instanceof Float64Array\n );\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isPrimitive } from \"@stryke/type-checks/is-primitive\";\nimport { isTypedArray } from \"@stryke/type-checks/is-typed-array\";\n\nexport type Resolved<T> =\n Equal<T, ResolvedMain<T>> extends true ? T : ResolvedMain<T>;\n\ntype Equal<X, Y> = X extends Y ? (Y extends X ? true : false) : false;\n\ntype ResolvedMain<T> = T extends [never]\n ? never // (special trick for jsonable | null) type\n : ValueOf<T> extends boolean | number | bigint | string\n ? ValueOf<T>\n : T extends (...args: any[]) => any\n ? never\n : T extends object\n ? ResolvedObject<T>\n : ValueOf<T>;\n\ntype ResolvedObject<T extends object> = T extends (infer U)[]\n ? IsTuple<T> extends true\n ? ResolvedTuple<T>\n : ResolvedMain<U>[]\n : T extends Set<infer U>\n ? Set<ResolvedMain<U>>\n : T extends Map<infer K, infer V>\n ? Map<ResolvedMain<K>, ResolvedMain<V>>\n : T extends WeakSet<any> | WeakMap<any, any>\n ? never\n : T extends\n | Date\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | BigUint64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | BigInt64Array\n | Float32Array\n | Float64Array\n | ArrayBuffer\n | SharedArrayBuffer\n | DataView\n | Blob\n | File\n ? T\n : {\n [P in keyof T]: ResolvedMain<T[P]>;\n };\n\ntype ResolvedTuple<T extends readonly any[]> = T extends []\n ? []\n : T extends [infer F]\n ? [ResolvedMain<F>]\n : T extends [infer F, ...infer Rest extends readonly any[]]\n ? [ResolvedMain<F>, ...ResolvedTuple<Rest>]\n : T extends [(infer F)?]\n ? [ResolvedMain<F>?]\n : T extends [(infer F)?, ...infer Rest extends readonly any[]]\n ? [ResolvedMain<F>?, ...ResolvedTuple<Rest>]\n : [];\n\ntype IsTuple<T extends readonly any[] | { length: number }> = [T] extends [\n never\n]\n ? false\n : T extends readonly any[]\n ? number extends T[\"length\"]\n ? false\n : true\n : false;\n\ntype ValueOf<Instance> =\n IsValueOf<Instance, boolean> extends true\n ? boolean\n : IsValueOf<Instance, number> extends true\n ? number\n : IsValueOf<Instance, string> extends true\n ? string\n : Instance;\n\ntype IsValueOf<Instance, O extends ValueOfInterface<any>> = Instance extends O\n ? O extends ValueOfInterface<infer Primitive>\n ? Instance extends Primitive\n ? false\n : true // not Primitive, but Object\n : false // cannot be\n : false;\n\ninterface ValueOfInterface<T> {\n valueOf: () => T;\n}\n\n/**\n * Creates a deep clone of the given object.\n *\n * @remarks\n * This function creates a deep clone of the given object, including nested objects and arrays. The resulting output will be of type `Resolved<T>`, which is a type that resolves to the most specific type possible for the given input type `T`. **If you are just looking for a way to copy an object deeply, use {@link deepCopy} instead.**\n *\n * @example\n * ```typescript\n * // Clone a primitive values\n * const num = 29;\n * const clonedNum = clone(num);\n * console.log(clonedNum); // 29\n * console.log(clonedNum === num) ; // true\n *\n * // Clone an array\n * const arr = [1, 2, 3];\n * const clonedArr = clone(arr);\n * console.log(clonedArr); // [1, 2, 3]\n * console.log(clonedArr === arr); // false\n *\n * // Clone an array with nested objects\n * const arr = [1, { a: 1 }, [1, 2, 3]];\n * const clonedArr = clone(arr);\n * arr[1].a = 2;\n * console.log(arr); // [2, { a: 2 }, [1, 2, 3]]\n * console.log(clonedArr); // [1, { a: 1 }, [1, 2, 3]]\n * console.log(clonedArr === arr); // false\n *\n * // Clone an object\n * const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };\n * const clonedObj = clone(obj);\n * console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }\n * console.log(clonedObj === obj); // false\n *\n *\n * // Clone an object with nested objects\n * const obj = { a: 1, b: { c: 1 } };\n * const clonedObj = clone(obj);\n * obj.b.c = 2;\n * console.log(obj); // { a: 1, b: { c: 2 } }\n * console.log(clonedObj); // { a: 1, b: { c: 1 } }\n * console.log(clonedObj === obj); // false\n * ```\n *\n * @param obj - The object to clone.\n * @returns A deep clone of the given object.\n */\nexport function deepClone<T>(obj: T): Resolved<T> {\n if (isPrimitive(obj)) {\n return obj as Resolved<T>;\n }\n\n if (Array.isArray(obj)) {\n return obj.map(item => deepClone(item)) as Resolved<T>;\n }\n\n if (obj instanceof Date) {\n return new Date(obj.getTime()) as Resolved<T>;\n }\n\n if (obj instanceof RegExp) {\n return new RegExp(obj.source, obj.flags) as Resolved<T>;\n }\n\n if (obj instanceof Map) {\n const result = new Map();\n for (const [key, value] of obj.entries()) {\n result.set(key, deepClone(value));\n }\n return result as Resolved<T>;\n }\n\n if (obj instanceof Set) {\n const result = new Set();\n for (const value of obj.values()) {\n result.add(deepClone(value));\n }\n return result as Resolved<T>;\n }\n\n if (isTypedArray(obj)) {\n // eslint-disable-next-line ts/no-unsafe-call\n const result = new (Object.getPrototypeOf(obj).constructor)(obj.length);\n // eslint-disable-next-line ts/naming-convention\n for (const [i, element_] of obj.entries()) {\n result[i] = deepClone(element_);\n }\n return result as Resolved<T>;\n }\n\n if (\n obj instanceof ArrayBuffer ||\n (typeof SharedArrayBuffer !== \"undefined\" &&\n obj instanceof SharedArrayBuffer)\n ) {\n return [...(obj as any)] as Resolved<T>;\n }\n\n if (obj instanceof DataView) {\n const result = new DataView([...(obj.buffer as any)] as any);\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n // For legacy NodeJS support\n if (typeof File !== \"undefined\" && obj instanceof File) {\n const result = new File([obj], obj.name, { type: obj.type });\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n if (obj instanceof Blob) {\n const result = new Blob([obj], { type: obj.type });\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n if (obj instanceof Error) {\n const result = new (obj.constructor as new () => Error)();\n result.message = obj.message;\n result.name = obj.name;\n result.stack = obj.stack;\n result.cause = obj.cause;\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n if (typeof obj === \"object\" && obj !== null) {\n const result = {};\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n return obj as Resolved<T>;\n}\n\nfunction cloneDeepHelper(obj: any, clonedObj: any): void {\n const keys = Object.keys(obj);\n\n for (const key of keys) {\n const descriptor = Object.getOwnPropertyDescriptor(obj, key);\n\n if (descriptor?.writable || descriptor?.set) {\n clonedObj[key] = deepClone(obj[key]);\n }\n }\n}\n"],"mappings":"AAkBA,MAAa,EAAe,GAA4B,CACtD,GAAI,CACF,OACE,GACU,MACT,OAAO,GAAU,UAAY,OAAO,GAAU,gBAE3C,CACN,MAAO,KCRX,SAAgB,EACd,EAYe,CACf,OACE,aAAe,YACf,aAAe,mBACf,aAAe,aACf,aAAe,aACf,aAAe,gBACf,aAAe,WACf,aAAe,YACf,aAAe,YACf,aAAe,eACf,aAAe,cACf,aAAe,aCoHnB,SAAgB,EAAa,EAAqB,CAChD,GAAI,EAAY,EAAI,CAClB,OAAO,EAGT,GAAI,MAAM,QAAQ,EAAI,CACpB,OAAO,EAAI,IAAI,GAAQ,EAAU,EAAK,CAAC,CAGzC,GAAI,aAAe,KACjB,OAAO,IAAI,KAAK,EAAI,SAAS,CAAC,CAGhC,GAAI,aAAe,OACjB,OAAO,IAAI,OAAO,EAAI,OAAQ,EAAI,MAAM,CAG1C,GAAI,aAAe,IAAK,CACtB,IAAM,EAAS,IAAI,IACnB,IAAK,GAAM,CAAC,EAAK,KAAU,EAAI,SAAS,CACtC,EAAO,IAAI,EAAK,EAAU,EAAM,CAAC,CAEnC,OAAO,EAGT,GAAI,aAAe,IAAK,CACtB,IAAM,EAAS,IAAI,IACnB,IAAK,IAAM,KAAS,EAAI,QAAQ,CAC9B,EAAO,IAAI,EAAU,EAAM,CAAC,CAE9B,OAAO,EAGT,GAAI,EAAa,EAAI,CAAE,CAErB,IAAM,EAAS,IAAK,OAAO,eAAe,EAAI,EAAC,YAAa,EAAI,OAAO,CAEvE,IAAK,GAAM,CAAC,EAAG,KAAa,EAAI,SAAS,CACvC,EAAO,GAAK,EAAU,EAAS,CAEjC,OAAO,EAGT,GACE,aAAe,aACd,OAAO,kBAAsB,KAC5B,aAAe,kBAEjB,MAAO,CAAC,GAAI,EAAY,CAG1B,GAAI,aAAe,SAAU,CAC3B,IAAM,EAAS,IAAI,SAAS,CAAC,GAAI,EAAI,OAAe,CAAQ,CAE5D,OADA,EAAgB,EAAK,EAAO,CACrB,EAIT,GAAI,OAAO,KAAS,KAAe,aAAe,KAAM,CACtD,IAAM,EAAS,IAAI,KAAK,CAAC,EAAI,CAAE,EAAI,KAAM,CAAE,KAAM,EAAI,KAAM,CAAC,CAE5D,OADA,EAAgB,EAAK,EAAO,CACrB,EAGT,GAAI,aAAe,KAAM,CACvB,IAAM,EAAS,IAAI,KAAK,CAAC,EAAI,CAAE,CAAE,KAAM,EAAI,KAAM,CAAC,CAElD,OADA,EAAgB,EAAK,EAAO,CACrB,EAGT,GAAI,aAAe,MAAO,CACxB,IAAM,EAAS,IAAK,EAAI,YAMxB,MALA,GAAO,QAAU,EAAI,QACrB,EAAO,KAAO,EAAI,KAClB,EAAO,MAAQ,EAAI,MACnB,EAAO,MAAQ,EAAI,MACnB,EAAgB,EAAK,EAAO,CACrB,EAGT,GAAI,OAAO,GAAQ,UAAY,EAAc,CAC3C,IAAM,EAAS,EAAE,CAEjB,OADA,EAAgB,EAAK,EAAO,CACrB,EAGT,OAAO,EAGT,SAAS,EAAgB,EAAU,EAAsB,CACvD,IAAM,EAAO,OAAO,KAAK,EAAI,CAE7B,IAAK,IAAM,KAAO,EAAM,CACtB,IAAM,EAAa,OAAO,yBAAyB,EAAK,EAAI,EAExD,GAAY,UAAY,GAAY,OACtC,EAAU,GAAO,EAAU,EAAI,GAAK"}
@@ -0,0 +1 @@
1
+ const e=e=>{try{return e==null||typeof e!=`object`&&typeof e!=`function`}catch{return!1}};function t(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof BigUint64Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof BigInt64Array||e instanceof Float32Array||e instanceof Float64Array}function n(i){if(e(i))return i;if(Array.isArray(i))return i.map(e=>n(e));if(i instanceof Date)return new Date(i.getTime());if(i instanceof RegExp)return new RegExp(i.source,i.flags);if(i instanceof Map){let e=new Map;for(let[t,r]of i.entries())e.set(t,n(r));return e}if(i instanceof Set){let e=new Set;for(let t of i.values())e.add(n(t));return e}if(t(i)){let e=new(Object.getPrototypeOf(i)).constructor(i.length);for(let[t,r]of i.entries())e[t]=n(r);return e}if(i instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&i instanceof SharedArrayBuffer)return[...i];if(i instanceof DataView){let e=new DataView([...i.buffer]);return r(i,e),e}if(typeof File<`u`&&i instanceof File){let e=new File([i],i.name,{type:i.type});return r(i,e),e}if(i instanceof Blob){let e=new Blob([i],{type:i.type});return r(i,e),e}if(i instanceof Error){let e=new i.constructor;return e.message=i.message,e.name=i.name,e.stack=i.stack,e.cause=i.cause,r(i,e),e}if(typeof i==`object`&&i){let e={};return r(i,e),e}return i}function r(e,t){let r=Object.keys(e);for(let i of r){let r=Object.getOwnPropertyDescriptor(e,i);(r?.writable||r?.set)&&(t[i]=n(e[i]))}}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
@@ -1,19 +1,16 @@
1
- export type Resolved<T> = Equal<T, ResolvedMain<T>> extends true ? T : ResolvedMain<T>;
1
+ //#region src/deep-clone.d.ts
2
+ type Resolved<T> = Equal<T, ResolvedMain<T>> extends true ? T : ResolvedMain<T>;
2
3
  type Equal<X, Y> = X extends Y ? (Y extends X ? true : false) : false;
3
- type ResolvedMain<T> = T extends [never] ? never : ValueOf<T> extends boolean | number | bigint | string ? ValueOf<T> : T extends (...args: any[]) => any ? never : T extends object ? ResolvedObject<T> : ValueOf<T>;
4
- type ResolvedObject<T extends object> = T extends (infer U)[] ? IsTuple<T> extends true ? ResolvedTuple<T> : ResolvedMain<U>[] : T extends Set<infer U> ? Set<ResolvedMain<U>> : T extends Map<infer K, infer V> ? Map<ResolvedMain<K>, ResolvedMain<V>> : T extends WeakSet<any> | WeakMap<any, any> ? never : T extends Date | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | BigUint64Array | Int8Array | Int16Array | Int32Array | BigInt64Array | Float32Array | Float64Array | ArrayBuffer | SharedArrayBuffer | DataView | Blob | File ? T : {
5
- [P in keyof T]: ResolvedMain<T[P]>;
6
- };
4
+ type ResolvedMain<T> = T extends [never] ? never : ValueOf<T> extends boolean | number | bigint | string ? ValueOf<T> : T extends ((...args: any[]) => any) ? never : T extends object ? ResolvedObject<T> : ValueOf<T>;
5
+ type ResolvedObject<T extends object> = T extends (infer U)[] ? IsTuple<T> extends true ? ResolvedTuple<T> : ResolvedMain<U>[] : T extends Set<infer U> ? Set<ResolvedMain<U>> : T extends Map<infer K, infer V> ? Map<ResolvedMain<K>, ResolvedMain<V>> : T extends WeakSet<any> | WeakMap<any, any> ? never : T extends Date | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | BigUint64Array | Int8Array | Int16Array | Int32Array | BigInt64Array | Float32Array | Float64Array | ArrayBuffer | SharedArrayBuffer | DataView | Blob | File ? T : { [P in keyof T]: ResolvedMain<T[P]> };
7
6
  type ResolvedTuple<T extends readonly any[]> = T extends [] ? [] : T extends [infer F] ? [ResolvedMain<F>] : T extends [infer F, ...infer Rest extends readonly any[]] ? [ResolvedMain<F>, ...ResolvedTuple<Rest>] : T extends [(infer F)?] ? [ResolvedMain<F>?] : T extends [(infer F)?, ...infer Rest extends readonly any[]] ? [ResolvedMain<F>?, ...ResolvedTuple<Rest>] : [];
8
7
  type IsTuple<T extends readonly any[] | {
9
- length: number;
10
- }> = [T] extends [
11
- never
12
- ] ? false : T extends readonly any[] ? number extends T["length"] ? false : true : false;
8
+ length: number;
9
+ }> = [T] extends [never] ? false : T extends readonly any[] ? number extends T["length"] ? false : true : false;
13
10
  type ValueOf<Instance> = IsValueOf<Instance, boolean> extends true ? boolean : IsValueOf<Instance, number> extends true ? number : IsValueOf<Instance, string> extends true ? string : Instance;
14
11
  type IsValueOf<Instance, O extends ValueOfInterface<any>> = Instance extends O ? O extends ValueOfInterface<infer Primitive> ? Instance extends Primitive ? false : true : false : false;
15
12
  interface ValueOfInterface<T> {
16
- valueOf: () => T;
13
+ valueOf: () => T;
17
14
  }
18
15
  /**
19
16
  * Creates a deep clone of the given object.
@@ -62,5 +59,7 @@ interface ValueOfInterface<T> {
62
59
  * @param obj - The object to clone.
63
60
  * @returns A deep clone of the given object.
64
61
  */
65
- export declare function deepClone<T>(obj: T): Resolved<T>;
66
- export {};
62
+ declare function deepClone<T>(obj: T): Resolved<T>;
63
+ //#endregion
64
+ export { deepClone as n, Resolved as t };
65
+ //# sourceMappingURL=deep-clone-CpLJcTgz.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep-clone-CpLJcTgz.d.mts","names":[],"sources":["../src/deep-clone.ts"],"sourcesContent":[],"mappings":";KAqBY,cACV,MAAM,GAAG,aAAa,mBAAmB,IAAI,aAAa;AAD5D,KAGK,KAHO,CAAA,CAAA,EAAA,CAAQ,CAAA,GAGD,CAHC,SAGS,CAHT,GAAA,CAGc,CAHd,SAGwB,CAHxB,GAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA;KAKf,YAJG,CAAA,CAAA,CAAA,GAIe,CAJf,SAAA,CAAA,KAAA,CAAA,GAAA,KAAA,GAMJ,OANI,CAMI,CANJ,CAAA,SAAA,OAAA,GAAA,MAAA,GAAA,MAAA,GAAA,MAAA,GAOF,OAPE,CAOM,CAPN,CAAA,GAQF,CARE,UAAA,CAAA,GAAA,IAAA,EAAA,GAAA,EAAA,EAAA,GAAA,GAAA,IAAA,KAAA,GAUA,CAVA,SAAA,MAAA,GAWE,cAXF,CAWiB,CAXjB,CAAA,GAYE,OAZF,CAYU,CAZV,CAAA;KAcH,cAdmB,CAAA,UAAA,MAAA,CAAA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AA,CAAA,CAAA,CAAA;EAAC,OAAA,EAAA,GAAA,GAqF5B,CArF4B;AAAA;;;;;;;;;;;;;AAU5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBD,iBAqGA,SArGA,CAAA,CAAA,CAAA,CAAA,GAAA,EAqGkB,CArGlB,CAAA,EAqGsB,QArGtB,CAqG+B,CArG/B,CAAA"}
@@ -0,0 +1,65 @@
1
+ //#region src/deep-clone.d.ts
2
+ type Resolved<T> = Equal<T, ResolvedMain<T>> extends true ? T : ResolvedMain<T>;
3
+ type Equal<X, Y> = X extends Y ? (Y extends X ? true : false) : false;
4
+ type ResolvedMain<T> = T extends [never] ? never : ValueOf<T> extends boolean | number | bigint | string ? ValueOf<T> : T extends ((...args: any[]) => any) ? never : T extends object ? ResolvedObject<T> : ValueOf<T>;
5
+ type ResolvedObject<T extends object> = T extends (infer U)[] ? IsTuple<T> extends true ? ResolvedTuple<T> : ResolvedMain<U>[] : T extends Set<infer U> ? Set<ResolvedMain<U>> : T extends Map<infer K, infer V> ? Map<ResolvedMain<K>, ResolvedMain<V>> : T extends WeakSet<any> | WeakMap<any, any> ? never : T extends Date | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | BigUint64Array | Int8Array | Int16Array | Int32Array | BigInt64Array | Float32Array | Float64Array | ArrayBuffer | SharedArrayBuffer | DataView | Blob | File ? T : { [P in keyof T]: ResolvedMain<T[P]> };
6
+ type ResolvedTuple<T extends readonly any[]> = T extends [] ? [] : T extends [infer F] ? [ResolvedMain<F>] : T extends [infer F, ...infer Rest extends readonly any[]] ? [ResolvedMain<F>, ...ResolvedTuple<Rest>] : T extends [(infer F)?] ? [ResolvedMain<F>?] : T extends [(infer F)?, ...infer Rest extends readonly any[]] ? [ResolvedMain<F>?, ...ResolvedTuple<Rest>] : [];
7
+ type IsTuple<T extends readonly any[] | {
8
+ length: number;
9
+ }> = [T] extends [never] ? false : T extends readonly any[] ? number extends T["length"] ? false : true : false;
10
+ type ValueOf<Instance> = IsValueOf<Instance, boolean> extends true ? boolean : IsValueOf<Instance, number> extends true ? number : IsValueOf<Instance, string> extends true ? string : Instance;
11
+ type IsValueOf<Instance, O extends ValueOfInterface<any>> = Instance extends O ? O extends ValueOfInterface<infer Primitive> ? Instance extends Primitive ? false : true : false : false;
12
+ interface ValueOfInterface<T> {
13
+ valueOf: () => T;
14
+ }
15
+ /**
16
+ * Creates a deep clone of the given object.
17
+ *
18
+ * @remarks
19
+ * This function creates a deep clone of the given object, including nested objects and arrays. The resulting output will be of type `Resolved<T>`, which is a type that resolves to the most specific type possible for the given input type `T`. **If you are just looking for a way to copy an object deeply, use {@link deepCopy} instead.**
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * // Clone a primitive values
24
+ * const num = 29;
25
+ * const clonedNum = clone(num);
26
+ * console.log(clonedNum); // 29
27
+ * console.log(clonedNum === num) ; // true
28
+ *
29
+ * // Clone an array
30
+ * const arr = [1, 2, 3];
31
+ * const clonedArr = clone(arr);
32
+ * console.log(clonedArr); // [1, 2, 3]
33
+ * console.log(clonedArr === arr); // false
34
+ *
35
+ * // Clone an array with nested objects
36
+ * const arr = [1, { a: 1 }, [1, 2, 3]];
37
+ * const clonedArr = clone(arr);
38
+ * arr[1].a = 2;
39
+ * console.log(arr); // [2, { a: 2 }, [1, 2, 3]]
40
+ * console.log(clonedArr); // [1, { a: 1 }, [1, 2, 3]]
41
+ * console.log(clonedArr === arr); // false
42
+ *
43
+ * // Clone an object
44
+ * const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };
45
+ * const clonedObj = clone(obj);
46
+ * console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }
47
+ * console.log(clonedObj === obj); // false
48
+ *
49
+ *
50
+ * // Clone an object with nested objects
51
+ * const obj = { a: 1, b: { c: 1 } };
52
+ * const clonedObj = clone(obj);
53
+ * obj.b.c = 2;
54
+ * console.log(obj); // { a: 1, b: { c: 2 } }
55
+ * console.log(clonedObj); // { a: 1, b: { c: 1 } }
56
+ * console.log(clonedObj === obj); // false
57
+ * ```
58
+ *
59
+ * @param obj - The object to clone.
60
+ * @returns A deep clone of the given object.
61
+ */
62
+ declare function deepClone<T>(obj: T): Resolved<T>;
63
+ //#endregion
64
+ export { deepClone as n, Resolved as t };
65
+ //# sourceMappingURL=deep-clone-jRNy1xoj.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep-clone-jRNy1xoj.d.cts","names":[],"sources":["../src/deep-clone.ts"],"sourcesContent":[],"mappings":";KAqBY,cACV,MAAM,GAAG,aAAa,mBAAmB,IAAI,aAAa;AAD5D,KAGK,KAHO,CAAA,CAAA,EAAA,CAAQ,CAAA,GAGD,CAHC,SAGS,CAHT,GAAA,CAGc,CAHd,SAGwB,CAHxB,GAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA;KAKf,YAJG,CAAA,CAAA,CAAA,GAIe,CAJf,SAAA,CAAA,KAAA,CAAA,GAAA,KAAA,GAMJ,OANI,CAMI,CANJ,CAAA,SAAA,OAAA,GAAA,MAAA,GAAA,MAAA,GAAA,MAAA,GAOF,OAPE,CAOM,CAPN,CAAA,GAQF,CARE,UAAA,CAAA,GAAA,IAAA,EAAA,GAAA,EAAA,EAAA,GAAA,GAAA,IAAA,KAAA,GAUA,CAVA,SAAA,MAAA,GAWE,cAXF,CAWiB,CAXjB,CAAA,GAYE,OAZF,CAYU,CAZV,CAAA;KAcH,cAdmB,CAAA,UAAA,MAAA,CAAA,GAcgB,CAdhB,SAAA,CAAA,KAAA,EAAA,CAAA,EAAA,GAepB,OAfoB,CAeZ,CAfY,CAAA,SAAA,IAAA,GAgBlB,aAhBkB,CAgBJ,CAhBI,CAAA,GAiBlB,YAjBkB,CAiBL,CAjBK,CAAA,EAAA,GAkBpB,CAlBoB,SAkBV,GAlBU,CAAA,KAAA,EAAA,CAAA,GAmBlB,GAnBkB,CAmBd,YAnBc,CAmBD,CAnBC,CAAA,CAAA,GAoBlB,CApBkB,SA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true
5
- });
6
- exports.deepClone = deepClone;
7
- var _isPrimitive = require("@stryke/type-checks/is-primitive");
8
- var _isTypedArray = require("@stryke/type-checks/is-typed-array");
9
- function deepClone(e) {
10
- if ((0, _isPrimitive.isPrimitive)(e)) return e;
11
- if (Array.isArray(e)) return e.map(n => deepClone(n));
12
- if (e instanceof Date) return new Date(e.getTime());
13
- if (e instanceof RegExp) return new RegExp(e.source, e.flags);
14
- if (e instanceof Map) {
15
- const n = new Map();
16
- for (const [t, s] of e.entries()) n.set(t, deepClone(s));
17
- return n;
18
- }
19
- if (e instanceof Set) {
20
- const n = new Set();
21
- for (const t of e.values()) n.add(deepClone(t));
22
- return n;
23
- }
24
- if ((0, _isTypedArray.isTypedArray)(e)) {
25
- const n = new (Object.getPrototypeOf(e).constructor)(e.length);
26
- for (const [t, s] of e.entries()) n[t] = deepClone(s);
27
- return n;
28
- }
29
- if (e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer) return [...e];
30
- if (e instanceof DataView) {
31
- const n = new DataView([...e.buffer]);
32
- return r(e, n), n;
33
- }
34
- if (typeof File < "u" && e instanceof File) {
35
- const n = new File([e], e.name, {
36
- type: e.type
37
- });
38
- return r(e, n), n;
39
- }
40
- if (e instanceof Blob) {
41
- const n = new Blob([e], {
42
- type: e.type
43
- });
44
- return r(e, n), n;
45
- }
46
- if (e instanceof Error) {
47
- const n = new e.constructor();
48
- return n.message = e.message, n.name = e.name, n.stack = e.stack, n.cause = e.cause, r(e, n), n;
49
- }
50
- if (typeof e == "object" && e !== null) {
51
- const n = {};
52
- return r(e, n), n;
53
- }
54
- return e;
55
- }
56
- function r(e, n) {
57
- const t = Object.keys(e);
58
- for (const s of t) {
59
- const a = Object.getOwnPropertyDescriptor(e, s);
60
- (a?.writable || a?.set) && (n[s] = deepClone(e[s]));
61
- }
62
- }
1
+ const e=require(`./deep-clone-CoUy-Hrt.cjs`);exports.deepClone=e.t;
@@ -0,0 +1,2 @@
1
+ import { n as deepClone, t as Resolved } from "./deep-clone-jRNy1xoj.cjs";
2
+ export { Resolved, deepClone };
@@ -0,0 +1,2 @@
1
+ import { n as deepClone, t as Resolved } from "./deep-clone-CpLJcTgz.mjs";
2
+ export { Resolved, deepClone };
@@ -1 +1 @@
1
- import{isPrimitive as l}from"@stryke/type-checks/is-primitive";import{isTypedArray as i}from"@stryke/type-checks/is-typed-array";export function deepClone(e){if(l(e))return e;if(Array.isArray(e))return e.map(n=>deepClone(n));if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){const n=new Map;for(const[t,s]of e.entries())n.set(t,deepClone(s));return n}if(e instanceof Set){const n=new Set;for(const t of e.values())n.add(deepClone(t));return n}if(i(e)){const n=new(Object.getPrototypeOf(e)).constructor(e.length);for(const[t,s]of e.entries())n[t]=deepClone(s);return n}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return[...e];if(e instanceof DataView){const n=new DataView([...e.buffer]);return r(e,n),n}if(typeof File<"u"&&e instanceof File){const n=new File([e],e.name,{type:e.type});return r(e,n),n}if(e instanceof Blob){const n=new Blob([e],{type:e.type});return r(e,n),n}if(e instanceof Error){const n=new e.constructor;return n.message=e.message,n.name=e.name,n.stack=e.stack,n.cause=e.cause,r(e,n),n}if(typeof e=="object"&&e!==null){const n={};return r(e,n),n}return e}function r(e,n){const t=Object.keys(e);for(const s of t){const a=Object.getOwnPropertyDescriptor(e,s);(a?.writable||a?.set)&&(n[s]=deepClone(e[s]))}}
1
+ import{t as e}from"./deep-clone-BlN5QTtW.mjs";export{e as deepClone};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./is-empty-C7vlSVFD.mjs";import{t}from"./is-plain-object-D8GSMOhY.mjs";import{t as n}from"./is-set-B9o0NIT4.mjs";const r=e=>{try{return typeof e==`object`||!!e&&e?.constructor===Object||t(e)}catch{return!1}},i=e=>n(e)&&r(e),a=e=>e.$$typeof===(typeof Symbol==`function`&&Symbol.for?Symbol.for(`react.element`):60103),o=e=>{let t=Object.prototype.toString.call(e);return t===`[object RegExp]`||t===`[object Date]`||a(e)},s=e=>i(e)&&!o(e),c=(e,t)=>{try{return r(e)&&t in e}catch{return!1}},l=(e,t)=>c(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t)),u=e=>Array.isArray(e)?[]:{},d=(e,t)=>t.clone!==!1&&t.isMergeableObject(e)?g(u(e),e,t):e,f=(e,t,n)=>[...e,...t].map(e=>d(e,n)),p=(t,n)=>{if(!n.customMerge)return g;let r=n.customMerge(t);return e(r)?r:g},m=e=>[...Object.keys(e),...Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(t=>Object.propertyIsEnumerable.call(e,t)):[]],h=(e,t,n)=>{let r={};if(n.isMergeableObject(e))for(let t of m(e))r[t]=d(e[t],n);for(let i of m(t))r[i]=l(e,i)&&n.isMergeableObject(t[i])?p(i,n)(e[i],t[i],n):d(t[i],n);return r};function g(e,t,n){if(!e||!t)return e||t;let r=n??{};r.arrayMerge??=f,r.isMergeableObject??=s,r.cloneUnlessOtherwiseSpecified??=d;let i=Array.isArray(t);return i===Array.isArray(e)?i?r.arrayMerge(e,t,r):h(e,t,r):d(t,r)}g.all=function(e,t){if(!Array.isArray(e))throw TypeError(`first argument should be an array`);return e.reduce((e,n)=>g(e,n,t),{})};export{g as t};
2
+ //# sourceMappingURL=deep-merge-BDZ6c79O.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep-merge-BDZ6c79O.mjs","names":["destination: Record<string, any>"],"sources":["../../type-checks/src/is-object.ts","../../type-checks/src/is-non-null-object.ts","../../type-checks/src/is-react-element.ts","../../type-checks/src/is-mergeable-object.ts","../../type-checks/src/property-exists.ts","../src/deep-merge.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/* eslint-disable ts/no-unsafe-function-type */\n/* eslint-disable ts/no-unsafe-call */\n\nimport type { NativeClass } from \"@stryke/types/base\";\nimport { isPlainObject } from \"./is-plain-object\";\n\n// Prepare\nconst isClassRegex = /^class\\s|^function\\s+[A-Z]/;\nconst isConventionalClassRegex = /^function\\s+[A-Z]/;\nconst isNativeClassRegex = /^class\\s/;\n\n/** Is ES6+ class */\nexport function isNativeClass(value?: any): value is NativeClass {\n // NOTE TO DEVELOPER: If any of this changes, isClass must also be updated\n return (\n typeof value === \"function\" && isNativeClassRegex.test(value.toString())\n );\n}\n\n/**\n * Check if the provided value's type is a conventional class\n *\n * @remarks\n * Is Conventional Class\n * Looks for function with capital first letter MyClass\n * First letter is the 9th character\n * If changed, isClass must also be updated\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is a conventional class\n */\nexport function isConventionalClass(value?: any): value is Function {\n return (\n typeof value === \"function\" &&\n isConventionalClassRegex.test(value.toString())\n );\n}\n\n/**\n * Check if the provided value's type is `Object`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object`\n */\nexport function isClass(value?: any): value is Function | NativeClass; // only guarantee of truth type, not of validity\nexport function isClass(value?: any): boolean {\n return typeof value === \"function\" && isClassRegex.test(value.toString());\n}\n\n/**\n * Check if the provided value's type is `Object`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object`\n */\nexport const isObject = (value: unknown): value is object => {\n try {\n return (\n typeof value === \"object\" ||\n (Boolean(value) && value?.constructor === Object) ||\n isPlainObject(value)\n );\n } catch {\n return false;\n }\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isObject } from \"./is-object\";\nimport { isSet } from \"./is-set\";\n\n/**\n * Check if the provided value's type is `Object` and is not `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object` and is not `null` or `undefined`\n */\nexport const isNonNullObject = (value: any): value is NonNullable<object> => {\n return isSet(value) && isObject(value);\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isReactElement = (value: any) => {\n return (\n value.$$typeof ===\n (typeof Symbol === \"function\" && Symbol.for\n ? Symbol.for(\"react.element\")\n : 0xea_c7)\n );\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isNonNullObject } from \"./is-non-null-object\";\nimport { isReactElement } from \"./is-react-element\";\n\nconst isSpecialType = (value: any) => {\n const stringValue = Object.prototype.toString.call(value);\n\n return (\n stringValue === \"[object RegExp]\" ||\n stringValue === \"[object Date]\" ||\n isReactElement(value)\n );\n};\n\nexport const isMergeableObject = (value: any): boolean => {\n return isNonNullObject(value) && !isSpecialType(value);\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isObject } from \"./is-object\";\n\n/**\n * Check if the provided object has the provided property\n *\n * @param object - The object to check\n * @param propertyKey - The property to check\n * @returns An indicator specifying if the object has the provided property\n */\nexport const propertyExists = (object: any, propertyKey: PropertyKey) => {\n try {\n return isObject(object) && propertyKey in object;\n } catch {\n return false;\n }\n};\n\n/**\n * Check if the provided object has the provided property and if it's safe to merge\n *\n * @param object - The object to check\n * @param propertyKey - The property to check\n * @returns An indicator specifying if the object has the provided property and if it's safe to merge\n */\nexport const propertyUnsafe = (object: any, propertyKey: PropertyKey) => {\n return (\n propertyExists(object, propertyKey) && // Properties are safe to merge if they don't exist in the target yet,\n !(\n Object.hasOwnProperty.call(object, propertyKey) && // unsafe if they exist up the prototype chain,\n Object.propertyIsEnumerable.call(object, propertyKey)\n )\n ); // and also unsafe if they're non-enumerable.\n};\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isMergeableObject } from \"@stryke/type-checks/is-mergeable-object\";\nimport { propertyUnsafe } from \"@stryke/type-checks/property-exists\";\n\nconst emptyTarget = (val: any) => {\n return Array.isArray(val) ? [] : {};\n};\n\nconst cloneUnlessOtherwiseSpecified = (\n value: any,\n options: {\n clone?: boolean;\n isMergeableObject: (value: any) => boolean;\n }\n) => {\n return options.clone !== false && options.isMergeableObject(value)\n ? deepMerge(emptyTarget(value), value, options)\n : value;\n};\n\nconst defaultArrayMerge = (target: any[], source: any[], options?: any) => {\n return [...target, ...source].map(element => {\n return cloneUnlessOtherwiseSpecified(element, options);\n });\n};\n\nconst getMergeFunction = (\n key: string,\n options: {\n customMerge?: (key: string) => any;\n }\n) => {\n if (!options.customMerge) {\n return deepMerge;\n }\n const customMerge = options.customMerge(key);\n\n return isFunction(customMerge) ? customMerge : deepMerge;\n};\n\nconst getKeys = (target: Record<string, any>) => {\n return [\n ...Object.keys(target),\n ...((Object.getOwnPropertySymbols\n ? Object.getOwnPropertySymbols(target).filter(symbol => {\n return Object.propertyIsEnumerable.call(target, symbol);\n })\n : []) as unknown as string[])\n ];\n};\n\nconst mergeObject = (\n target: Record<string, any>,\n source: Record<string, any>,\n options: {\n clone?: boolean;\n customMerge?: (key: string) => any;\n isMergeableObject: (value: any) => boolean;\n cloneUnlessOtherwiseSpecified?: (\n value: any,\n options: {\n clone: boolean;\n isMergeableObject: (value: any) => boolean;\n }\n ) => any;\n }\n) => {\n const destination: Record<string, any> = {};\n if (options.isMergeableObject(target)) {\n for (const key of getKeys(target)) {\n destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n }\n }\n for (const key of getKeys(source)) {\n destination[key] =\n propertyUnsafe(target, key) && options.isMergeableObject(source[key])\n ? getMergeFunction(key, options)(target[key], source[key], options)\n : cloneUnlessOtherwiseSpecified(source[key], options);\n }\n return destination;\n};\n\nexport interface DeepMergeOptions {\n clone?: boolean;\n customMerge?: (key: string) => any;\n isMergeableObject: (value: any) => boolean;\n cloneUnlessOtherwiseSpecified: (\n value: any,\n options: {\n clone?: boolean;\n isMergeableObject: (value: any) => boolean;\n }\n ) => any;\n arrayMerge: (target: any[], source: any[], options: any) => any;\n}\n\n/**\n * Deep merge two objects\n *\n * @param target - The target object\n * @param source - The source object\n * @param options - The options object\n * @returns The merged object\n */\nexport function deepMerge<X = any | any[], Y = any | any[], Z = X & Y>(\n target: X,\n source: Y,\n options?: Partial<DeepMergeOptions>\n): Z {\n if (!target || !source) {\n return (target || source) as Z;\n }\n\n const opts = (options ?? {}) as DeepMergeOptions;\n opts.arrayMerge ??= defaultArrayMerge;\n opts.isMergeableObject ??= isMergeableObject;\n // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n // implementations can use it. The caller may not replace it.\n opts.cloneUnlessOtherwiseSpecified ??= cloneUnlessOtherwiseSpecified;\n\n const sourceIsArray = Array.isArray(source);\n const targetIsArray = Array.isArray(target);\n const sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n if (!sourceAndTargetTypesMatch) {\n return cloneUnlessOtherwiseSpecified(source, opts);\n }\n if (sourceIsArray) {\n return opts.arrayMerge(target as any[], source, opts);\n }\n return mergeObject(target, source, opts) as Z;\n}\n\ndeepMerge.all = function deepMergeAll(array: any[], options?: any) {\n if (!Array.isArray(array)) {\n throw new TypeError(\"first argument should be an array\");\n }\n\n return array.reduce((prev, next) => {\n return deepMerge(prev, next, options);\n }, {});\n};\n"],"mappings":"oIAyEA,MAAa,EAAY,GAAoC,CAC3D,GAAI,CACF,OACE,OAAO,GAAU,UAChB,EAAQ,GAAU,GAAO,cAAgB,QAC1C,EAAc,EAAM,MAEhB,CACN,MAAO,KCtDE,EAAmB,GACvB,EAAM,EAAM,E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EAA8B,EAAO,GAAM,EAAQ,CAG1E,IAAK,IAAM,KAAO,EAAQ,EAAO,CAC/B,EAAY,GACV,EAAe,EAAQ,EAAI,EAAI,EAAQ,kBAAkB,EAAO,GAAK,CACjE,EAAiB,EAAK,EAAQ,CAAC,EAAO,GAAM,EAAO,GAAM,EAAQ,CACjE,EAA8B,EAAO,GAAM,EAAQ,CAE3D,OAAO,GAyBT,SAAgB,EACd,EACA,EACA,EACG,CACH,GAAI,CAAC,GAAU,CAAC,EACd,OAAQ,GAAU,EAGpB,IAAM,EAAQ,GAAW,EAAE,CAC3B,EAAK,aAAe,EACpB,EAAK,oBAAsB,EAG3B,EAAK,gCAAkC,EAEvC,IAAM,EAAgB,MAAM,QAAQ,EAAO,CAU3C,OARkC,IADZ,MAAM,QAAQ,EAAO,CAMvC,EACK,EAAK,WAAW,EAAiB,EAAQ,EAAK,CAEhD,EAAY,EAAQ,EAAQ,EAAK,CAL/B,EAA8B,EAAQ,EAAK,CAQtD,EAAU,IAAM,SAAsB,EAAc,EAAe,CACjE,GAAI,CAAC,MAAM,QAAQ,EAAM,CACvB,MAAU,UAAU,oCAAoC,CAG1D,OAAO,EAAM,QAAQ,EAAM,IAClB,EAAU,EAAM,EAAM,EAAQ,CACpC,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ const e=require(`./is-empty-DZZDqzjD.cjs`),t=require(`./is-plain-object-BQuFhL4M.cjs`),n=require(`./is-set-ByJOY6h2.cjs`),r=e=>{try{return typeof e==`object`||!!e&&e?.constructor===Object||t.t(e)}catch{return!1}},i=e=>n.t(e)&&r(e),a=e=>e.$$typeof===(typeof Symbol==`function`&&Symbol.for?Symbol.for(`react.element`):60103),o=e=>{let t=Object.prototype.toString.call(e);return t===`[object RegExp]`||t===`[object Date]`||a(e)},s=e=>i(e)&&!o(e),c=(e,t)=>{try{return r(e)&&t in e}catch{return!1}},l=(e,t)=>c(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t)),u=e=>Array.isArray(e)?[]:{},d=(e,t)=>t.clone!==!1&&t.isMergeableObject(e)?g(u(e),e,t):e,f=(e,t,n)=>[...e,...t].map(e=>d(e,n)),p=(t,n)=>{if(!n.customMerge)return g;let r=n.customMerge(t);return e.n(r)?r:g},m=e=>[...Object.keys(e),...Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(t=>Object.propertyIsEnumerable.call(e,t)):[]],h=(e,t,n)=>{let r={};if(n.isMergeableObject(e))for(let t of m(e))r[t]=d(e[t],n);for(let i of m(t))r[i]=l(e,i)&&n.isMergeableObject(t[i])?p(i,n)(e[i],t[i],n):d(t[i],n);return r};function g(e,t,n){if(!e||!t)return e||t;let r=n??{};r.arrayMerge??=f,r.isMergeableObject??=s,r.cloneUnlessOtherwiseSpecified??=d;let i=Array.isArray(t);return i===Array.isArray(e)?i?r.arrayMerge(e,t,r):h(e,t,r):d(t,r)}g.all=function(e,t){if(!Array.isArray(e))throw TypeError(`first argument should be an array`);return e.reduce((e,n)=>g(e,n,t),{})},Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return g}});
@@ -0,0 +1,26 @@
1
+ //#region src/deep-merge.d.ts
2
+ interface DeepMergeOptions {
3
+ clone?: boolean;
4
+ customMerge?: (key: string) => any;
5
+ isMergeableObject: (value: any) => boolean;
6
+ cloneUnlessOtherwiseSpecified: (value: any, options: {
7
+ clone?: boolean;
8
+ isMergeableObject: (value: any) => boolean;
9
+ }) => any;
10
+ arrayMerge: (target: any[], source: any[], options: any) => any;
11
+ }
12
+ /**
13
+ * Deep merge two objects
14
+ *
15
+ * @param target - The target object
16
+ * @param source - The source object
17
+ * @param options - The options object
18
+ * @returns The merged object
19
+ */
20
+ declare function deepMerge<X = any | any[], Y = any | any[], Z = X & Y>(target: X, source: Y, options?: Partial<DeepMergeOptions>): Z;
21
+ declare namespace deepMerge {
22
+ var all: (array: any[], options?: any) => any;
23
+ }
24
+ //#endregion
25
+ export { deepMerge as n, DeepMergeOptions as t };
26
+ //# sourceMappingURL=deep-merge-C9qDSleg.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep-merge-C9qDSleg.d.cts","names":[],"sources":["../src/deep-merge.ts"],"sourcesContent":[],"mappings":";UAoGiB,gBAAA;EAAA,KAAA,CAAA,EAAA,OAAA;EAsBD,WAAA,CAAS,EAAA,CAAA,GAAA,EAAA,MAAA,EAAA,GAAA,GAAA;EAAuC,iBAAA,EAAA,CAAA,KAAA,EAAA,GAAA,EAAA,GAAA,OAAA;EAAI,6BAAA,EAAA,CAAA,KAAA,EAAA,GAAA,EAAA,OAAA,EAAA;IAC1D,KAAA,CAAA,EAAA,OAAA;IACA,iBAAA,EAAA,CAAA,KAAA,EAAA,GAAA,EAAA,GAAA,OAAA;EACU,CAAA,EAAA,GAAA,GAAA;EAAR,UAAA,EAAA,CAAA,MAAA,EAAA,GAAA,EAAA,EAAA,MAAA,EAAA,GAAA,EAAA,EAAA,OAAA,EAAA,GAAA,EAAA,GAAA,GAAA;;;;;;;;;;iBAHI,gDAAgD,IAAI,WAC1D,WACA,aACE,QAAQ,oBACjB;kBAJa,SAAA"}
@@ -0,0 +1,26 @@
1
+ //#region src/deep-merge.d.ts
2
+ interface DeepMergeOptions {
3
+ clone?: boolean;
4
+ customMerge?: (key: string) => any;
5
+ isMergeableObject: (value: any) => boolean;
6
+ cloneUnlessOtherwiseSpecified: (value: any, options: {
7
+ clone?: boolean;
8
+ isMergeableObject: (value: any) => boolean;
9
+ }) => any;
10
+ arrayMerge: (target: any[], source: any[], options: any) => any;
11
+ }
12
+ /**
13
+ * Deep merge two objects
14
+ *
15
+ * @param target - The target object
16
+ * @param source - The source object
17
+ * @param options - The options object
18
+ * @returns The merged object
19
+ */
20
+ declare function deepMerge<X = any | any[], Y = any | any[], Z = X & Y>(target: X, source: Y, options?: Partial<DeepMergeOptions>): Z;
21
+ declare namespace deepMerge {
22
+ var all: (array: any[], options?: any) => any;
23
+ }
24
+ //#endregion
25
+ export { deepMerge as n, DeepMergeOptions as t };
26
+ //# sourceMappingURL=deep-merge-eCT712Cv.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep-merge-eCT712Cv.d.mts","names":[],"sources":["../src/deep-merge.ts"],"sourcesContent":[],"mappings":";UAoGiB,gBAAA;EAAA,KAAA,CAAA,EAAA,OAAA;EAsBD,WAAA,CAAS,EAAA,CAAA,GAAA,EAAA,MAAA,EAAA,GAAA,GAAA;EAAuC,iBAAA,EAAA,CAAA,KAAA,EAAA,GAAA,EAAA,GAAA,OAAA;EAAI,6BAAA,EAAA,CAAA,KAAA,EAAA,GAAA,EAAA,OAAA,EAAA;IAC1D,KAAA,CAAA,EAAA,OAAA;IACA,iBAAA,EAAA,CAAA,KAAA,EAAA,GAAA,EAAA,GAAA,OAAA;EACU,CAAA,EAAA,GAAA,GAAA;EAAR,UAAA,EAAA,CAAA,MAAA,EAAA,GAAA,EAAA,EAAA,MAAA,EAAA,GAAA,EAAA,EAAA,OAAA,EAAA,GAAA,EAAA,GAAA,GAAA;;;;;;;;;;iBAHI,gDAAgD,IAAI,WAC1D,WACA,aACE,QAAQ,oBACjB;kBAJa,SAAA"}
@@ -1,36 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.deepMerge = deepMerge;
7
- var _isFunction = require("@stryke/type-checks/is-function");
8
- var _isMergeableObject = require("@stryke/type-checks/is-mergeable-object");
9
- var _propertyExists = require("@stryke/type-checks/property-exists");
10
- const b = e => Array.isArray(e) ? [] : {},
11
- o = (e, r) => r.clone !== !1 && r.isMergeableObject(e) ? deepMerge(b(e), e, r) : e,
12
- g = (e, r, n) => [...e, ...r].map(a => o(a, n)),
13
- u = (e, r) => {
14
- if (!r.customMerge) return deepMerge;
15
- const n = r.customMerge(e);
16
- return (0, _isFunction.isFunction)(n) ? n : deepMerge;
17
- },
18
- s = e => [...Object.keys(e), ...(Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(r => Object.propertyIsEnumerable.call(e, r)) : [])],
19
- M = (e, r, n) => {
20
- const a = {};
21
- if (n.isMergeableObject(e)) for (const t of s(e)) a[t] = o(e[t], n);
22
- for (const t of s(r)) a[t] = (0, _propertyExists.propertyUnsafe)(e, t) && n.isMergeableObject(r[t]) ? u(t, n)(e[t], r[t], n) : o(r[t], n);
23
- return a;
24
- };
25
- function deepMerge(e, r, n) {
26
- if (!e || !r) return e || r;
27
- const a = n ?? {};
28
- a.arrayMerge ??= g, a.isMergeableObject ??= _isMergeableObject.isMergeableObject, a.cloneUnlessOtherwiseSpecified ??= o;
29
- const t = Array.isArray(r),
30
- y = Array.isArray(e);
31
- return t === y ? t ? a.arrayMerge(e, r, a) : M(e, r, a) : o(r, a);
32
- }
33
- deepMerge.all = function (r, n) {
34
- if (!Array.isArray(r)) throw new TypeError("first argument should be an array");
35
- return r.reduce((a, t) => deepMerge(a, t, n), {});
36
- };
1
+ const e=require(`./deep-merge-BpFjvumi.cjs`);exports.deepMerge=e.t;
@@ -0,0 +1,2 @@
1
+ import { n as deepMerge, t as DeepMergeOptions } from "./deep-merge-C9qDSleg.cjs";
2
+ export { DeepMergeOptions, deepMerge };
@@ -0,0 +1,2 @@
1
+ import { n as deepMerge, t as DeepMergeOptions } from "./deep-merge-eCT712Cv.mjs";
2
+ export { DeepMergeOptions, deepMerge };
@@ -1 +1 @@
1
- import{isFunction as c}from"@stryke/type-checks/is-function";import{isMergeableObject as i}from"@stryke/type-checks/is-mergeable-object";import{propertyUnsafe as l}from"@stryke/type-checks/property-exists";const b=e=>Array.isArray(e)?[]:{},o=(e,r)=>r.clone!==!1&&r.isMergeableObject(e)?deepMerge(b(e),e,r):e,g=(e,r,n)=>[...e,...r].map(a=>o(a,n)),u=(e,r)=>{if(!r.customMerge)return deepMerge;const n=r.customMerge(e);return c(n)?n:deepMerge},s=e=>[...Object.keys(e),...Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(r=>Object.propertyIsEnumerable.call(e,r)):[]],M=(e,r,n)=>{const a={};if(n.isMergeableObject(e))for(const t of s(e))a[t]=o(e[t],n);for(const t of s(r))a[t]=l(e,t)&&n.isMergeableObject(r[t])?u(t,n)(e[t],r[t],n):o(r[t],n);return a};export function deepMerge(e,r,n){if(!e||!r)return e||r;const a=n??{};a.arrayMerge??=g,a.isMergeableObject??=i,a.cloneUnlessOtherwiseSpecified??=o;const t=Array.isArray(r),y=Array.isArray(e);return t===y?t?a.arrayMerge(e,r,a):M(e,r,a):o(r,a)}deepMerge.all=function(r,n){if(!Array.isArray(r))throw new TypeError("first argument should be an array");return r.reduce((a,t)=>deepMerge(a,t,n),{})};
1
+ import{t as e}from"./deep-merge-BDZ6c79O.mjs";export{e as deepMerge};
@@ -1,5 +1,6 @@
1
+ //#region src/delay.d.ts
1
2
  interface DelayOptions {
2
- signal?: AbortSignal;
3
+ signal?: AbortSignal;
3
4
  }
4
5
  /**
5
6
  * Delays the execution of code for a specified number of milliseconds.
@@ -34,7 +35,9 @@ interface DelayOptions {
34
35
  * @param options - The options object.
35
36
  * @returns A Promise that resolves after the specified delay.
36
37
  */
37
- export declare function delay(ms: number, { signal }?: DelayOptions): Promise<void>;
38
+ declare function delay(ms: number, {
39
+ signal
40
+ }?: DelayOptions): Promise<void>;
38
41
  /**
39
42
  * Delays the execution of code for a specified number of milliseconds.
40
43
  *
@@ -68,5 +71,7 @@ export declare function delay(ms: number, { signal }?: DelayOptions): Promise<vo
68
71
  * @param options - The options object.
69
72
  * @returns A Promise that resolves after the specified sleep.
70
73
  */
71
- export declare function sleep(ms: number, options?: DelayOptions): Promise<void>;
72
- export {};
74
+ declare function sleep(ms: number, options?: DelayOptions): Promise<void>;
75
+ //#endregion
76
+ export { sleep as n, delay as t };
77
+ //# sourceMappingURL=delay-Bd_sGzMj.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delay-Bd_sGzMj.d.mts","names":[],"sources":["../src/delay.ts"],"sourcesContent":[],"mappings":";UAoBU,YAAA;EAAA,MAAA,CAAA,EACC,WADW;AAqCtB;;;;;AA2DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA3DsB,KAAA;;IAER,eACX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwDmB,KAAA,uBAA4B,eAAe"}
@@ -0,0 +1 @@
1
+ const e=require(`./errors-BXYY8wXj.cjs`);async function t(t,{signal:n}={}){return new Promise((r,i)=>{let a=()=>{i(new e.t)},o=()=>{clearTimeout(s),a()};if(n?.aborted)return a();let s=setTimeout(r,t);n?.addEventListener(`abort`,o,{once:!0})})}async function n(e,n){return t(e,n)}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
@@ -0,0 +1,77 @@
1
+ //#region src/delay.d.ts
2
+ interface DelayOptions {
3
+ signal?: AbortSignal;
4
+ }
5
+ /**
6
+ * Delays the execution of code for a specified number of milliseconds.
7
+ *
8
+ * This function returns a Promise that resolves after the specified delay, allowing you to use it
9
+ * with async/await to pause execution.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * async function foo() {
14
+ * console.log('Start');
15
+ * await delay(1000); // Delays execution for 1 second
16
+ * console.log('End');
17
+ * }
18
+ *
19
+ * foo();
20
+ *
21
+ * // With AbortSignal
22
+ * const controller = new AbortController();
23
+ * const { signal } = controller;
24
+ *
25
+ * setTimeout(() => controller.abort(), 50); // Will cancel the delay after 50ms
26
+ * try {
27
+ * await delay(100, { signal });
28
+ * } catch (error) {
29
+ * console.error(error); // Will log 'AbortError'
30
+ * }
31
+ * }
32
+ * ```
33
+ *
34
+ * @param ms - The number of milliseconds to delay.
35
+ * @param options - The options object.
36
+ * @returns A Promise that resolves after the specified delay.
37
+ */
38
+ declare function delay(ms: number, {
39
+ signal
40
+ }?: DelayOptions): Promise<void>;
41
+ /**
42
+ * Delays the execution of code for a specified number of milliseconds.
43
+ *
44
+ * This function returns a Promise that resolves after the specified delay, allowing you to use it
45
+ * with async/await to pause execution.
46
+ *
47
+ * @example
48
+ * ```typescript
49
+ * async function foo() {
50
+ * console.log('Start');
51
+ * await sleep(1000); // Delays execution for 1 second
52
+ * console.log('End');
53
+ * }
54
+ *
55
+ * foo();
56
+ *
57
+ * // With AbortSignal
58
+ * const controller = new AbortController();
59
+ * const { signal } = controller;
60
+ *
61
+ * setTimeout(() => controller.abort(), 50); // Will cancel the delay after 50ms
62
+ * try {
63
+ * await sleep(100, { signal });
64
+ * } catch (error) {
65
+ * console.error(error); // Will log 'AbortError'
66
+ * }
67
+ * }
68
+ * ```
69
+ *
70
+ * @param ms - The number of milliseconds to sleep.
71
+ * @param options - The options object.
72
+ * @returns A Promise that resolves after the specified sleep.
73
+ */
74
+ declare function sleep(ms: number, options?: DelayOptions): Promise<void>;
75
+ //#endregion
76
+ export { sleep as n, delay as t };
77
+ //# sourceMappingURL=delay-VkcrQf1l.d.cts.map