@herowcode/utils 1.3.5 → 1.4.8

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 (456) hide show
  1. package/dist/api/index.cjs +12 -0
  2. package/dist/api/index.cjs.map +1 -0
  3. package/dist/api/{client.d.ts → index.d.mts} +19 -8
  4. package/dist/api/index.d.ts +36 -3
  5. package/dist/api/index.js +3 -0
  6. package/dist/api/index.js.map +1 -0
  7. package/dist/array/index.cjs +16 -0
  8. package/dist/array/index.cjs.map +1 -0
  9. package/dist/array/index.d.mts +5 -0
  10. package/dist/array/index.d.ts +5 -3
  11. package/dist/array/index.js +3 -0
  12. package/dist/array/index.js.map +1 -0
  13. package/dist/chunk-2MANLCNG.cjs +23 -0
  14. package/dist/chunk-2MANLCNG.cjs.map +1 -0
  15. package/dist/chunk-2RTW37WD.js +20 -0
  16. package/dist/chunk-2RTW37WD.js.map +1 -0
  17. package/dist/chunk-2Y6M7IOG.js +250 -0
  18. package/dist/chunk-2Y6M7IOG.js.map +1 -0
  19. package/dist/chunk-3JUB2OJL.js +3 -0
  20. package/dist/chunk-3JUB2OJL.js.map +1 -0
  21. package/dist/chunk-53JMVGIG.js +187 -0
  22. package/dist/chunk-53JMVGIG.js.map +1 -0
  23. package/dist/chunk-56NHIM5J.js +151 -0
  24. package/dist/chunk-56NHIM5J.js.map +1 -0
  25. package/dist/chunk-5OLQJUNS.js +66 -0
  26. package/dist/chunk-5OLQJUNS.js.map +1 -0
  27. package/dist/chunk-5YOEKMTJ.cjs +321 -0
  28. package/dist/chunk-5YOEKMTJ.cjs.map +1 -0
  29. package/dist/chunk-6TWPZ6LL.cjs +4 -0
  30. package/dist/chunk-6TWPZ6LL.cjs.map +1 -0
  31. package/dist/chunk-AQZBHMTO.js +96 -0
  32. package/dist/chunk-AQZBHMTO.js.map +1 -0
  33. package/dist/chunk-ATWN4SRX.js +29 -0
  34. package/dist/chunk-ATWN4SRX.js.map +1 -0
  35. package/dist/chunk-GRSF4RY2.cjs +20 -0
  36. package/dist/chunk-GRSF4RY2.cjs.map +1 -0
  37. package/dist/chunk-GX5E5B4L.cjs +70 -0
  38. package/dist/chunk-GX5E5B4L.cjs.map +1 -0
  39. package/dist/chunk-HK727IAV.cjs +201 -0
  40. package/dist/chunk-HK727IAV.cjs.map +1 -0
  41. package/dist/chunk-LJ6KOZD4.cjs +154 -0
  42. package/dist/chunk-LJ6KOZD4.cjs.map +1 -0
  43. package/dist/chunk-N2DRAZ3A.cjs +29 -0
  44. package/dist/chunk-N2DRAZ3A.cjs.map +1 -0
  45. package/dist/chunk-O7SH3E3T.js +18 -0
  46. package/dist/chunk-O7SH3E3T.js.map +1 -0
  47. package/dist/chunk-P5YNRND6.cjs +4 -0
  48. package/dist/chunk-P5YNRND6.cjs.map +1 -0
  49. package/dist/chunk-QAE6Q2SA.js +317 -0
  50. package/dist/chunk-QAE6Q2SA.js.map +1 -0
  51. package/dist/chunk-QRXVUXGJ.js +378 -0
  52. package/dist/chunk-QRXVUXGJ.js.map +1 -0
  53. package/dist/chunk-SLYUARZG.cjs +99 -0
  54. package/dist/chunk-SLYUARZG.cjs.map +1 -0
  55. package/dist/chunk-SWRIT7EE.js +3 -0
  56. package/dist/chunk-SWRIT7EE.js.map +1 -0
  57. package/dist/chunk-UXEUYHBD.cjs +401 -0
  58. package/dist/chunk-UXEUYHBD.cjs.map +1 -0
  59. package/dist/chunk-V6OKXUBQ.js +22 -0
  60. package/dist/chunk-V6OKXUBQ.js.map +1 -0
  61. package/dist/chunk-VAZJXZU5.cjs +31 -0
  62. package/dist/chunk-VAZJXZU5.cjs.map +1 -0
  63. package/dist/chunk-WGSFRFRO.cjs +252 -0
  64. package/dist/chunk-WGSFRFRO.cjs.map +1 -0
  65. package/dist/date/index.cjs +56 -0
  66. package/dist/date/index.cjs.map +1 -0
  67. package/dist/date/index.d.mts +63 -0
  68. package/dist/date/index.d.ts +63 -8
  69. package/dist/date/index.js +3 -0
  70. package/dist/date/index.js.map +1 -0
  71. package/dist/extract-youtube-video-id-HSYMYXIZ.js +3 -0
  72. package/dist/extract-youtube-video-id-HSYMYXIZ.js.map +1 -0
  73. package/dist/extract-youtube-video-id-XVGNPUDX.cjs +12 -0
  74. package/dist/extract-youtube-video-id-XVGNPUDX.cjs.map +1 -0
  75. package/dist/files/index.browser.cjs +21 -0
  76. package/dist/files/index.browser.cjs.map +1 -0
  77. package/dist/files/index.browser.d.mts +14 -0
  78. package/dist/files/index.browser.d.ts +14 -0
  79. package/dist/files/index.browser.js +4 -0
  80. package/dist/files/index.browser.js.map +1 -0
  81. package/dist/files/index.cjs +31 -0
  82. package/dist/files/index.cjs.map +1 -0
  83. package/dist/files/index.d.mts +3 -0
  84. package/dist/files/index.d.ts +3 -6
  85. package/dist/files/index.js +6 -0
  86. package/dist/files/index.js.map +1 -0
  87. package/dist/files/index.node.cjs +21 -0
  88. package/dist/files/index.node.cjs.map +1 -0
  89. package/dist/files/index.node.d.mts +7 -0
  90. package/dist/files/index.node.d.ts +7 -0
  91. package/dist/files/index.node.js +4 -0
  92. package/dist/files/index.node.js.map +1 -0
  93. package/dist/format-bytes-BGjeDnvM.d.mts +3 -0
  94. package/dist/format-bytes-BGjeDnvM.d.ts +3 -0
  95. package/dist/function/index.cjs +20 -0
  96. package/dist/function/index.cjs.map +1 -0
  97. package/dist/function/index.d.mts +22 -0
  98. package/dist/function/index.d.ts +22 -4
  99. package/dist/function/index.js +3 -0
  100. package/dist/function/index.js.map +1 -0
  101. package/dist/index.cjs +188 -0
  102. package/dist/index.cjs.map +1 -0
  103. package/dist/index.d.mts +12 -0
  104. package/dist/index.d.ts +12 -8
  105. package/dist/index.js +15 -0
  106. package/dist/index.js.map +1 -0
  107. package/dist/string/index.cjs +60 -0
  108. package/dist/string/index.cjs.map +1 -0
  109. package/dist/string/index.d.mts +28 -0
  110. package/dist/string/index.d.ts +28 -14
  111. package/dist/string/index.js +3 -0
  112. package/dist/string/index.js.map +1 -0
  113. package/dist/{cjs/function/try-catch.d.ts → try-catch-B7WzqcPU.d.mts} +4 -4
  114. package/dist/{function/try-catch.d.ts → try-catch-B7WzqcPU.d.ts} +4 -4
  115. package/dist/youtube/index.browser.cjs +35 -0
  116. package/dist/youtube/index.browser.cjs.map +1 -0
  117. package/dist/youtube/index.browser.d.mts +2 -0
  118. package/dist/youtube/index.browser.d.ts +2 -0
  119. package/dist/youtube/index.browser.js +6 -0
  120. package/dist/youtube/index.browser.js.map +1 -0
  121. package/dist/youtube/index.cjs +36 -0
  122. package/dist/youtube/index.cjs.map +1 -0
  123. package/dist/youtube/index.d.mts +12 -0
  124. package/dist/youtube/index.d.ts +12 -7
  125. package/dist/youtube/index.js +7 -0
  126. package/dist/youtube/index.js.map +1 -0
  127. package/dist/youtube/index.node.cjs +26 -0
  128. package/dist/youtube/index.node.cjs.map +1 -0
  129. package/dist/youtube/index.node.d.mts +49 -0
  130. package/dist/youtube/index.node.d.ts +49 -0
  131. package/dist/youtube/index.node.js +5 -0
  132. package/dist/youtube/index.node.js.map +1 -0
  133. package/package.json +134 -47
  134. package/dist/api/client.d.ts.map +0 -1
  135. package/dist/api/index.d.ts.map +0 -1
  136. package/dist/api/wrapper.d.ts +0 -27
  137. package/dist/api/wrapper.d.ts.map +0 -1
  138. package/dist/array/index.d.ts.map +0 -1
  139. package/dist/array/shuffle.d.ts +0 -2
  140. package/dist/array/shuffle.d.ts.map +0 -1
  141. package/dist/array/unique.d.ts +0 -2
  142. package/dist/array/unique.d.ts.map +0 -1
  143. package/dist/cjs/api/client.d.ts +0 -25
  144. package/dist/cjs/api/client.d.ts.map +0 -1
  145. package/dist/cjs/api/client.js +0 -148
  146. package/dist/cjs/api/client.js.map +0 -1
  147. package/dist/cjs/api/index.d.ts +0 -3
  148. package/dist/cjs/api/index.d.ts.map +0 -1
  149. package/dist/cjs/api/index.js +0 -6
  150. package/dist/cjs/api/index.js.map +0 -1
  151. package/dist/cjs/api/wrapper.d.ts +0 -27
  152. package/dist/cjs/api/wrapper.d.ts.map +0 -1
  153. package/dist/cjs/api/wrapper.js +0 -152
  154. package/dist/cjs/api/wrapper.js.map +0 -1
  155. package/dist/cjs/array/index.d.ts +0 -3
  156. package/dist/cjs/array/index.d.ts.map +0 -1
  157. package/dist/cjs/array/index.js +0 -19
  158. package/dist/cjs/array/index.js.map +0 -1
  159. package/dist/cjs/array/shuffle.d.ts +0 -2
  160. package/dist/cjs/array/shuffle.d.ts.map +0 -1
  161. package/dist/cjs/array/shuffle.js +0 -16
  162. package/dist/cjs/array/shuffle.js.map +0 -1
  163. package/dist/cjs/array/unique.d.ts +0 -2
  164. package/dist/cjs/array/unique.d.ts.map +0 -1
  165. package/dist/cjs/array/unique.js +0 -7
  166. package/dist/cjs/array/unique.js.map +0 -1
  167. package/dist/cjs/array.js +0 -1
  168. package/dist/cjs/date/dayjs.d.ts +0 -20
  169. package/dist/cjs/date/dayjs.d.ts.map +0 -1
  170. package/dist/cjs/date/dayjs.js +0 -123
  171. package/dist/cjs/date/dayjs.js.map +0 -1
  172. package/dist/cjs/date/fix-timezone-offset.d.ts +0 -3
  173. package/dist/cjs/date/fix-timezone-offset.d.ts.map +0 -1
  174. package/dist/cjs/date/fix-timezone-offset.js +0 -9
  175. package/dist/cjs/date/fix-timezone-offset.js.map +0 -1
  176. package/dist/cjs/date/format-date.d.ts +0 -23
  177. package/dist/cjs/date/format-date.d.ts.map +0 -1
  178. package/dist/cjs/date/format-date.js +0 -71
  179. package/dist/cjs/date/format-date.js.map +0 -1
  180. package/dist/cjs/date/get-current-date-in-utc.d.ts +0 -3
  181. package/dist/cjs/date/get-current-date-in-utc.d.ts.map +0 -1
  182. package/dist/cjs/date/get-current-date-in-utc.js +0 -8
  183. package/dist/cjs/date/get-current-date-in-utc.js.map +0 -1
  184. package/dist/cjs/date/get-date-in-utc.d.ts +0 -3
  185. package/dist/cjs/date/get-date-in-utc.d.ts.map +0 -1
  186. package/dist/cjs/date/get-date-in-utc.js +0 -8
  187. package/dist/cjs/date/get-date-in-utc.js.map +0 -1
  188. package/dist/cjs/date/get-relative-time.d.ts +0 -3
  189. package/dist/cjs/date/get-relative-time.d.ts.map +0 -1
  190. package/dist/cjs/date/get-relative-time.js +0 -8
  191. package/dist/cjs/date/get-relative-time.js.map +0 -1
  192. package/dist/cjs/date/index.d.ts +0 -8
  193. package/dist/cjs/date/index.d.ts.map +0 -1
  194. package/dist/cjs/date/index.js +0 -24
  195. package/dist/cjs/date/index.js.map +0 -1
  196. package/dist/cjs/date/parse-time-spent.d.ts +0 -15
  197. package/dist/cjs/date/parse-time-spent.d.ts.map +0 -1
  198. package/dist/cjs/date/parse-time-spent.js +0 -207
  199. package/dist/cjs/date/parse-time-spent.js.map +0 -1
  200. package/dist/cjs/date.js +0 -1
  201. package/dist/cjs/files/compress-image.d.ts +0 -10
  202. package/dist/cjs/files/compress-image.d.ts.map +0 -1
  203. package/dist/cjs/files/compress-image.js +0 -61
  204. package/dist/cjs/files/compress-image.js.map +0 -1
  205. package/dist/cjs/files/download-url.d.ts +0 -2
  206. package/dist/cjs/files/download-url.d.ts.map +0 -1
  207. package/dist/cjs/files/download-url.js +0 -29
  208. package/dist/cjs/files/download-url.js.map +0 -1
  209. package/dist/cjs/files/file-delete.d.ts +0 -2
  210. package/dist/cjs/files/file-delete.d.ts.map +0 -1
  211. package/dist/cjs/files/file-delete.js +0 -20
  212. package/dist/cjs/files/file-delete.js.map +0 -1
  213. package/dist/cjs/files/file-exists.d.ts +0 -2
  214. package/dist/cjs/files/file-exists.d.ts.map +0 -1
  215. package/dist/cjs/files/file-exists.js +0 -18
  216. package/dist/cjs/files/file-exists.js.map +0 -1
  217. package/dist/cjs/files/format-bytes.d.ts +0 -2
  218. package/dist/cjs/files/format-bytes.d.ts.map +0 -1
  219. package/dist/cjs/files/format-bytes.js +0 -17
  220. package/dist/cjs/files/format-bytes.js.map +0 -1
  221. package/dist/cjs/files/index.d.ts +0 -6
  222. package/dist/cjs/files/index.d.ts.map +0 -1
  223. package/dist/cjs/files/index.js +0 -22
  224. package/dist/cjs/files/index.js.map +0 -1
  225. package/dist/cjs/files.js +0 -1
  226. package/dist/cjs/function/debounce.d.ts +0 -11
  227. package/dist/cjs/function/debounce.d.ts.map +0 -1
  228. package/dist/cjs/function/debounce.js +0 -26
  229. package/dist/cjs/function/debounce.js.map +0 -1
  230. package/dist/cjs/function/index.d.ts +0 -4
  231. package/dist/cjs/function/index.d.ts.map +0 -1
  232. package/dist/cjs/function/index.js +0 -20
  233. package/dist/cjs/function/index.js.map +0 -1
  234. package/dist/cjs/function/throttle.d.ts +0 -10
  235. package/dist/cjs/function/throttle.d.ts.map +0 -1
  236. package/dist/cjs/function/throttle.js +0 -36
  237. package/dist/cjs/function/throttle.js.map +0 -1
  238. package/dist/cjs/function/try-catch.d.ts.map +0 -1
  239. package/dist/cjs/function/try-catch.js +0 -39
  240. package/dist/cjs/function/try-catch.js.map +0 -1
  241. package/dist/cjs/function.js +0 -1
  242. package/dist/cjs/index.d.ts +0 -8
  243. package/dist/cjs/index.d.ts.map +0 -1
  244. package/dist/cjs/index.js +0 -24
  245. package/dist/cjs/index.js.map +0 -1
  246. package/dist/cjs/string/camel-case.d.ts +0 -2
  247. package/dist/cjs/string/camel-case.d.ts.map +0 -1
  248. package/dist/cjs/string/camel-case.js +0 -25
  249. package/dist/cjs/string/camel-case.js.map +0 -1
  250. package/dist/cjs/string/capitalize.d.ts +0 -2
  251. package/dist/cjs/string/capitalize.d.ts.map +0 -1
  252. package/dist/cjs/string/capitalize.js +0 -13
  253. package/dist/cjs/string/capitalize.js.map +0 -1
  254. package/dist/cjs/string/format-hms-to-seconds.d.ts +0 -2
  255. package/dist/cjs/string/format-hms-to-seconds.d.ts.map +0 -1
  256. package/dist/cjs/string/format-hms-to-seconds.js +0 -30
  257. package/dist/cjs/string/format-hms-to-seconds.js.map +0 -1
  258. package/dist/cjs/string/format-seconds-to-fragment.d.ts +0 -3
  259. package/dist/cjs/string/format-seconds-to-fragment.d.ts.map +0 -1
  260. package/dist/cjs/string/format-seconds-to-fragment.js +0 -20
  261. package/dist/cjs/string/format-seconds-to-fragment.js.map +0 -1
  262. package/dist/cjs/string/format-seconds-to-hms.d.ts +0 -2
  263. package/dist/cjs/string/format-seconds-to-hms.d.ts.map +0 -1
  264. package/dist/cjs/string/format-seconds-to-hms.js +0 -17
  265. package/dist/cjs/string/format-seconds-to-hms.js.map +0 -1
  266. package/dist/cjs/string/format-string-to-time.d.ts +0 -2
  267. package/dist/cjs/string/format-string-to-time.d.ts.map +0 -1
  268. package/dist/cjs/string/format-string-to-time.js +0 -15
  269. package/dist/cjs/string/format-string-to-time.js.map +0 -1
  270. package/dist/cjs/string/index.d.ts +0 -14
  271. package/dist/cjs/string/index.d.ts.map +0 -1
  272. package/dist/cjs/string/index.js +0 -30
  273. package/dist/cjs/string/index.js.map +0 -1
  274. package/dist/cjs/string/kebab-case.d.ts +0 -2
  275. package/dist/cjs/string/kebab-case.d.ts.map +0 -1
  276. package/dist/cjs/string/kebab-case.js +0 -15
  277. package/dist/cjs/string/kebab-case.js.map +0 -1
  278. package/dist/cjs/string/markdown-to-text.d.ts +0 -2
  279. package/dist/cjs/string/markdown-to-text.d.ts.map +0 -1
  280. package/dist/cjs/string/markdown-to-text.js +0 -70
  281. package/dist/cjs/string/markdown-to-text.js.map +0 -1
  282. package/dist/cjs/string/remove-html-tags.d.ts +0 -2
  283. package/dist/cjs/string/remove-html-tags.d.ts.map +0 -1
  284. package/dist/cjs/string/remove-html-tags.js +0 -18
  285. package/dist/cjs/string/remove-html-tags.js.map +0 -1
  286. package/dist/cjs/string/slugify.d.ts +0 -2
  287. package/dist/cjs/string/slugify.d.ts.map +0 -1
  288. package/dist/cjs/string/slugify.js +0 -13
  289. package/dist/cjs/string/slugify.js.map +0 -1
  290. package/dist/cjs/string/snake-case.d.ts +0 -2
  291. package/dist/cjs/string/snake-case.d.ts.map +0 -1
  292. package/dist/cjs/string/snake-case.js +0 -15
  293. package/dist/cjs/string/snake-case.js.map +0 -1
  294. package/dist/cjs/string/to-sentence-case.d.ts +0 -2
  295. package/dist/cjs/string/to-sentence-case.d.ts.map +0 -1
  296. package/dist/cjs/string/to-sentence-case.js +0 -13
  297. package/dist/cjs/string/to-sentence-case.js.map +0 -1
  298. package/dist/cjs/string/truncate.d.ts +0 -2
  299. package/dist/cjs/string/truncate.d.ts.map +0 -1
  300. package/dist/cjs/string/truncate.js +0 -19
  301. package/dist/cjs/string/truncate.js.map +0 -1
  302. package/dist/cjs/string.js +0 -1
  303. package/dist/cjs/youtube/extract-youtube-video-id.d.ts +0 -2
  304. package/dist/cjs/youtube/extract-youtube-video-id.d.ts.map +0 -1
  305. package/dist/cjs/youtube/extract-youtube-video-id.js +0 -30
  306. package/dist/cjs/youtube/extract-youtube-video-id.js.map +0 -1
  307. package/dist/cjs/youtube/generate-youtube-url.d.ts +0 -20
  308. package/dist/cjs/youtube/generate-youtube-url.d.ts.map +0 -1
  309. package/dist/cjs/youtube/generate-youtube-url.js +0 -86
  310. package/dist/cjs/youtube/generate-youtube-url.js.map +0 -1
  311. package/dist/cjs/youtube/get-video-duration.d.ts +0 -7
  312. package/dist/cjs/youtube/get-video-duration.d.ts.map +0 -1
  313. package/dist/cjs/youtube/get-video-duration.js +0 -150
  314. package/dist/cjs/youtube/get-video-duration.js.map +0 -1
  315. package/dist/cjs/youtube/get-youtube-thumbnail.d.ts +0 -2
  316. package/dist/cjs/youtube/get-youtube-thumbnail.d.ts.map +0 -1
  317. package/dist/cjs/youtube/get-youtube-thumbnail.js +0 -68
  318. package/dist/cjs/youtube/get-youtube-thumbnail.js.map +0 -1
  319. package/dist/cjs/youtube/get-youtube-video-info.d.ts +0 -26
  320. package/dist/cjs/youtube/get-youtube-video-info.d.ts.map +0 -1
  321. package/dist/cjs/youtube/get-youtube-video-info.js +0 -244
  322. package/dist/cjs/youtube/get-youtube-video-info.js.map +0 -1
  323. package/dist/cjs/youtube/index.d.ts +0 -7
  324. package/dist/cjs/youtube/index.d.ts.map +0 -1
  325. package/dist/cjs/youtube/index.js +0 -23
  326. package/dist/cjs/youtube/index.js.map +0 -1
  327. package/dist/cjs/youtube/validate-youtube-link.d.ts +0 -2
  328. package/dist/cjs/youtube/validate-youtube-link.d.ts.map +0 -1
  329. package/dist/cjs/youtube/validate-youtube-link.js +0 -77
  330. package/dist/cjs/youtube/validate-youtube-link.js.map +0 -1
  331. package/dist/cjs/youtube.js +0 -1
  332. package/dist/date/dayjs.d.ts +0 -20
  333. package/dist/date/dayjs.d.ts.map +0 -1
  334. package/dist/date/fix-timezone-offset.d.ts +0 -3
  335. package/dist/date/fix-timezone-offset.d.ts.map +0 -1
  336. package/dist/date/format-date.d.ts +0 -23
  337. package/dist/date/format-date.d.ts.map +0 -1
  338. package/dist/date/get-current-date-in-utc.d.ts +0 -3
  339. package/dist/date/get-current-date-in-utc.d.ts.map +0 -1
  340. package/dist/date/get-date-in-utc.d.ts +0 -3
  341. package/dist/date/get-date-in-utc.d.ts.map +0 -1
  342. package/dist/date/get-relative-time.d.ts +0 -3
  343. package/dist/date/get-relative-time.d.ts.map +0 -1
  344. package/dist/date/index.d.ts.map +0 -1
  345. package/dist/date/parse-time-spent.d.ts +0 -15
  346. package/dist/date/parse-time-spent.d.ts.map +0 -1
  347. package/dist/esm/api/client.js +0 -143
  348. package/dist/esm/api/index.js +0 -1
  349. package/dist/esm/api/wrapper.js +0 -148
  350. package/dist/esm/array/index.js +0 -2
  351. package/dist/esm/array/shuffle.js +0 -12
  352. package/dist/esm/array/unique.js +0 -3
  353. package/dist/esm/array.js +0 -1
  354. package/dist/esm/date/dayjs.js +0 -111
  355. package/dist/esm/date/fix-timezone-offset.js +0 -5
  356. package/dist/esm/date/format-date.js +0 -67
  357. package/dist/esm/date/get-current-date-in-utc.js +0 -4
  358. package/dist/esm/date/get-date-in-utc.js +0 -4
  359. package/dist/esm/date/get-relative-time.js +0 -4
  360. package/dist/esm/date/index.js +0 -7
  361. package/dist/esm/date/parse-time-spent.js +0 -203
  362. package/dist/esm/date.js +0 -1
  363. package/dist/esm/files/compress-image.js +0 -57
  364. package/dist/esm/files/download-url.js +0 -24
  365. package/dist/esm/files/file-delete.js +0 -12
  366. package/dist/esm/files/file-exists.js +0 -10
  367. package/dist/esm/files/format-bytes.js +0 -13
  368. package/dist/esm/files/index.js +0 -5
  369. package/dist/esm/files.js +0 -1
  370. package/dist/esm/function/debounce.js +0 -22
  371. package/dist/esm/function/index.js +0 -3
  372. package/dist/esm/function/throttle.js +0 -32
  373. package/dist/esm/function/try-catch.js +0 -35
  374. package/dist/esm/function.js +0 -1
  375. package/dist/esm/index.js +0 -7
  376. package/dist/esm/string/camel-case.js +0 -21
  377. package/dist/esm/string/capitalize.js +0 -9
  378. package/dist/esm/string/format-hms-to-seconds.js +0 -25
  379. package/dist/esm/string/format-seconds-to-fragment.js +0 -15
  380. package/dist/esm/string/format-seconds-to-hms.js +0 -13
  381. package/dist/esm/string/format-string-to-time.js +0 -10
  382. package/dist/esm/string/index.js +0 -13
  383. package/dist/esm/string/kebab-case.js +0 -11
  384. package/dist/esm/string/markdown-to-text.js +0 -66
  385. package/dist/esm/string/remove-html-tags.js +0 -14
  386. package/dist/esm/string/slugify.js +0 -9
  387. package/dist/esm/string/snake-case.js +0 -11
  388. package/dist/esm/string/to-sentence-case.js +0 -9
  389. package/dist/esm/string/truncate.js +0 -15
  390. package/dist/esm/string.js +0 -1
  391. package/dist/esm/youtube/extract-youtube-video-id.js +0 -26
  392. package/dist/esm/youtube/generate-youtube-url.js +0 -81
  393. package/dist/esm/youtube/get-video-duration.js +0 -146
  394. package/dist/esm/youtube/get-youtube-thumbnail.js +0 -31
  395. package/dist/esm/youtube/get-youtube-video-info.js +0 -207
  396. package/dist/esm/youtube/index.js +0 -6
  397. package/dist/esm/youtube/validate-youtube-link.js +0 -40
  398. package/dist/esm/youtube.js +0 -1
  399. package/dist/files/compress-image.d.ts +0 -10
  400. package/dist/files/compress-image.d.ts.map +0 -1
  401. package/dist/files/download-url.d.ts +0 -2
  402. package/dist/files/download-url.d.ts.map +0 -1
  403. package/dist/files/file-delete.d.ts +0 -2
  404. package/dist/files/file-delete.d.ts.map +0 -1
  405. package/dist/files/file-exists.d.ts +0 -2
  406. package/dist/files/file-exists.d.ts.map +0 -1
  407. package/dist/files/format-bytes.d.ts +0 -2
  408. package/dist/files/format-bytes.d.ts.map +0 -1
  409. package/dist/files/index.d.ts.map +0 -1
  410. package/dist/function/debounce.d.ts +0 -11
  411. package/dist/function/debounce.d.ts.map +0 -1
  412. package/dist/function/index.d.ts.map +0 -1
  413. package/dist/function/throttle.d.ts +0 -10
  414. package/dist/function/throttle.d.ts.map +0 -1
  415. package/dist/function/try-catch.d.ts.map +0 -1
  416. package/dist/index.d.ts.map +0 -1
  417. package/dist/string/camel-case.d.ts +0 -2
  418. package/dist/string/camel-case.d.ts.map +0 -1
  419. package/dist/string/capitalize.d.ts +0 -2
  420. package/dist/string/capitalize.d.ts.map +0 -1
  421. package/dist/string/format-hms-to-seconds.d.ts +0 -2
  422. package/dist/string/format-hms-to-seconds.d.ts.map +0 -1
  423. package/dist/string/format-seconds-to-fragment.d.ts +0 -3
  424. package/dist/string/format-seconds-to-fragment.d.ts.map +0 -1
  425. package/dist/string/format-seconds-to-hms.d.ts +0 -2
  426. package/dist/string/format-seconds-to-hms.d.ts.map +0 -1
  427. package/dist/string/format-string-to-time.d.ts +0 -2
  428. package/dist/string/format-string-to-time.d.ts.map +0 -1
  429. package/dist/string/index.d.ts.map +0 -1
  430. package/dist/string/kebab-case.d.ts +0 -2
  431. package/dist/string/kebab-case.d.ts.map +0 -1
  432. package/dist/string/markdown-to-text.d.ts +0 -2
  433. package/dist/string/markdown-to-text.d.ts.map +0 -1
  434. package/dist/string/remove-html-tags.d.ts +0 -2
  435. package/dist/string/remove-html-tags.d.ts.map +0 -1
  436. package/dist/string/slugify.d.ts +0 -2
  437. package/dist/string/slugify.d.ts.map +0 -1
  438. package/dist/string/snake-case.d.ts +0 -2
  439. package/dist/string/snake-case.d.ts.map +0 -1
  440. package/dist/string/to-sentence-case.d.ts +0 -2
  441. package/dist/string/to-sentence-case.d.ts.map +0 -1
  442. package/dist/string/truncate.d.ts +0 -2
  443. package/dist/string/truncate.d.ts.map +0 -1
  444. package/dist/youtube/extract-youtube-video-id.d.ts +0 -2
  445. package/dist/youtube/extract-youtube-video-id.d.ts.map +0 -1
  446. package/dist/youtube/generate-youtube-url.d.ts +0 -20
  447. package/dist/youtube/generate-youtube-url.d.ts.map +0 -1
  448. package/dist/youtube/get-video-duration.d.ts +0 -7
  449. package/dist/youtube/get-video-duration.d.ts.map +0 -1
  450. package/dist/youtube/get-youtube-thumbnail.d.ts +0 -2
  451. package/dist/youtube/get-youtube-thumbnail.d.ts.map +0 -1
  452. package/dist/youtube/get-youtube-video-info.d.ts +0 -26
  453. package/dist/youtube/get-youtube-video-info.d.ts.map +0 -1
  454. package/dist/youtube/index.d.ts.map +0 -1
  455. package/dist/youtube/validate-youtube-link.d.ts +0 -2
  456. package/dist/youtube/validate-youtube-link.d.ts.map +0 -1
@@ -1,143 +0,0 @@
1
- import { apiWrapper } from "./wrapper.js";
2
- const defaultRetryConfig = {
3
- limit: 5,
4
- methods: ["get"],
5
- statusCodes: [413],
6
- backoffLimit: 3000,
7
- };
8
- function buildQueryString(params) {
9
- const searchParams = new URLSearchParams();
10
- Object.entries(params).forEach(([key, value]) => {
11
- if (value !== null && value !== undefined) {
12
- searchParams.append(key, String(value));
13
- }
14
- });
15
- const queryString = searchParams.toString();
16
- return queryString ? `?${queryString}` : "";
17
- }
18
- async function beforeRequestHook(request, getAccessToken, getUserIP) {
19
- const token = await (getAccessToken === null || getAccessToken === void 0 ? void 0 : getAccessToken());
20
- const headers = new Headers(request.headers);
21
- if (token) {
22
- headers.set("Authorization", `Bearer ${token}`);
23
- }
24
- const userIP = await (getUserIP === null || getUserIP === void 0 ? void 0 : getUserIP());
25
- if (userIP) {
26
- headers.set("X-User-IP", userIP);
27
- }
28
- let body;
29
- try {
30
- const cloned = request.clone();
31
- const text = await cloned.text();
32
- body = text === "" ? undefined : text;
33
- }
34
- catch (_a) {
35
- body = undefined;
36
- }
37
- return new Request(request, { headers, body });
38
- }
39
- async function afterResponseHook(request, response, onSignoutUnauthorized) {
40
- const possibleSignInPaths = ["signin", "sign-in", "login"];
41
- const isSignInPath = possibleSignInPaths.some((path) => request.url.includes(path));
42
- const needsBody = response.status === 401 && !isSignInPath;
43
- let responseBody = null;
44
- let responseBodyFor401 = null;
45
- if (needsBody) {
46
- const clone = response.clone();
47
- try {
48
- responseBody = await clone.json();
49
- responseBodyFor401 = responseBody;
50
- }
51
- catch (_b) {
52
- responseBody = await clone.text();
53
- }
54
- }
55
- if (response.status === 401 && !isSignInPath) {
56
- return onSignoutUnauthorized === null || onSignoutUnauthorized === void 0 ? void 0 : onSignoutUnauthorized(responseBodyFor401);
57
- }
58
- }
59
- async function fetchWithRetry(input, init) {
60
- var _b, _c, _d, _e;
61
- const retryConfig = (init === null || init === void 0 ? void 0 : init.retry) || defaultRetryConfig;
62
- const method = ((init === null || init === void 0 ? void 0 : init.method) || "GET").toLowerCase();
63
- let attempt = 0;
64
- while (true) {
65
- attempt++;
66
- const response = await fetch(input, init);
67
- const shouldRetry = ((_b = retryConfig.statusCodes) === null || _b === void 0 ? void 0 : _b.includes(response.status)) &&
68
- ((_c = retryConfig.methods) === null || _c === void 0 ? void 0 : _c.includes(method)) &&
69
- attempt < ((_d = retryConfig.limit) !== null && _d !== void 0 ? _d : 5);
70
- if (!shouldRetry)
71
- return response;
72
- const backoff = Math.min(2 ** attempt * 100, (_e = retryConfig.backoffLimit) !== null && _e !== void 0 ? _e : 3000);
73
- await new Promise((resolve) => setTimeout(resolve, backoff));
74
- }
75
- }
76
- async function api(config, endpoint, options = {}) {
77
- var _b, _c;
78
- let url = endpoint.startsWith("http")
79
- ? endpoint
80
- : `${(_b = config.baseURL) === null || _b === void 0 ? void 0 : _b.replace(/\/$/, "")}/${endpoint.replace(/^\//, "")}`;
81
- // Add query parameters if provided
82
- if (options.params) {
83
- const queryString = buildQueryString(options.params);
84
- url += queryString;
85
- }
86
- // Apply default options
87
- const init = {
88
- credentials: "include",
89
- ...options,
90
- };
91
- let body;
92
- if (options.json !== undefined && options.json !== null) {
93
- body = JSON.stringify(options.json);
94
- // Only add Content-Type if body is not empty
95
- if (body && body !== "null" && body !== "undefined") {
96
- init.headers = {
97
- ...init.headers,
98
- "Content-Type": "application/json",
99
- };
100
- }
101
- }
102
- // Remove Content-Type application/json if there's no body
103
- if (!body) {
104
- const headers = new Headers(init.headers);
105
- if (((_c = headers.get("Content-Type")) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === "application/json") {
106
- headers.delete("Content-Type");
107
- init.headers = headers;
108
- }
109
- }
110
- // Create initial request
111
- let request = new Request(url, { ...init, body });
112
- // Run pre-request hooks
113
- request = await beforeRequestHook(request, config.getAccessToken, config.getUserIP);
114
- // Keep init headers in sync with the mutated request so fetch keeps auth headers
115
- init.headers = new Headers(request.headers);
116
- // Execute request with retry logic
117
- const response = await fetchWithRetry(request, init);
118
- // Run post-response hooks
119
- await afterResponseHook(request, response, config.onSignoutUnauthorized);
120
- if (!response.ok) {
121
- throw response;
122
- }
123
- if (response.status === 204) {
124
- return null;
125
- }
126
- const text = await response.text();
127
- if (!text) {
128
- return null;
129
- }
130
- return JSON.parse(text);
131
- }
132
- export const apiClient = (config) => {
133
- const apiConfig = {
134
- ...config,
135
- };
136
- return {
137
- get: (url, options) => apiWrapper(() => api(apiConfig, url, options)),
138
- post: (url, options) => apiWrapper(() => api(apiConfig, url, { ...options, method: "POST" })),
139
- put: (url, options) => apiWrapper(() => api(apiConfig, url, { ...options, method: "PUT" })),
140
- delete: (url, options) => apiWrapper(() => api(apiConfig, url, { ...options, method: "DELETE" })),
141
- patch: (url, options) => apiWrapper(() => api(apiConfig, url, { ...options, method: "PATCH" })),
142
- };
143
- };
@@ -1 +0,0 @@
1
- export { apiClient } from "./client.js";
@@ -1,148 +0,0 @@
1
- import { isAxiosError } from "axios";
2
- /**
3
- * Extracts error properties from Axios errors
4
- */
5
- async function extractAxiosErrorDetails(error) {
6
- var _a, _b, _c;
7
- const errorObj = {
8
- message: error.message || "Axios Error",
9
- status: (_a = error.response) === null || _a === void 0 ? void 0 : _a.status,
10
- path: (_b = error.config) === null || _b === void 0 ? void 0 : _b.url,
11
- };
12
- if (((_c = error.response) === null || _c === void 0 ? void 0 : _c.data) && typeof error.response.data === "object") {
13
- return await enrichErrorWithData(errorObj, Promise.resolve(error.response.data));
14
- }
15
- return errorObj;
16
- }
17
- /**
18
- * Extracts error properties from standard Error objects
19
- */
20
- function extractStandardErrorDetails(error) {
21
- const errorObj = {
22
- message: error.message,
23
- };
24
- // Capture any custom properties the error might have
25
- const extendedError = error;
26
- if (extendedError.code)
27
- errorObj.code = String(extendedError.code);
28
- if (extendedError.status)
29
- errorObj.status = Number(extendedError.status);
30
- if (extendedError.details)
31
- errorObj.details = extendedError.details;
32
- return errorObj;
33
- }
34
- /**
35
- * Extracts error properties from fetch Response objects
36
- */
37
- async function extractResponseErrorDetails(response) {
38
- const errorObj = {
39
- message: `HTTP Error ${response.status}: ${response.statusText}`,
40
- status: response.status,
41
- path: response.url,
42
- };
43
- try {
44
- // Clone the response to avoid consuming the body stream
45
- const clonedResponse = response.clone();
46
- const errorData = await clonedResponse.json();
47
- // Directly enrich the error object with the parsed data
48
- if (errorData && typeof errorData === "object") {
49
- if ("message" in errorData && errorData.message) {
50
- errorObj.message = String(errorData.message);
51
- }
52
- if ("code" in errorData) {
53
- errorObj.code = String(errorData.code);
54
- }
55
- if ("details" in errorData) {
56
- errorObj.details = errorData.details;
57
- }
58
- else if ("issues" in errorData) {
59
- errorObj.details = errorData.issues;
60
- }
61
- if ("timestamp" in errorData) {
62
- errorObj.timestamp = String(errorData.timestamp);
63
- }
64
- }
65
- return errorObj;
66
- }
67
- catch (_a) {
68
- // If JSON parsing fails, return the basic error object
69
- return errorObj;
70
- }
71
- }
72
- /**
73
- * Enriches an error object with additional data from response
74
- */
75
- async function enrichErrorWithData(errorObj, errorData, path) {
76
- const data = await errorData;
77
- if (data) {
78
- if ("message" in data) {
79
- errorObj.message = String(data.message);
80
- }
81
- if ("code" in data) {
82
- errorObj.code = String(data.code);
83
- }
84
- if ("details" in data) {
85
- errorObj.details = data.details;
86
- }
87
- else if ("issues" in data) {
88
- errorObj.details = data.issues;
89
- }
90
- if ("timestamp" in data) {
91
- errorObj.timestamp = String(data.timestamp);
92
- }
93
- if (path) {
94
- errorObj.path = path;
95
- }
96
- }
97
- return errorObj;
98
- }
99
- /**
100
- * Determines the type of error and routes to appropriate handler
101
- */
102
- async function processError(error) {
103
- if (error instanceof Response) {
104
- return extractResponseErrorDetails(error);
105
- }
106
- if (isAxiosError(error)) {
107
- return extractAxiosErrorDetails(error);
108
- }
109
- if (error instanceof Error) {
110
- return extractStandardErrorDetails(error);
111
- }
112
- // Handle unknown error types
113
- return {
114
- message: error ? JSON.stringify(error) : "Unknown error",
115
- };
116
- }
117
- /**
118
- * Wraps API calls with standardized error handling
119
- *
120
- * @param apiCall - The API call function to execute
121
- * @param defaultData - Optional default value to return when an error occurs
122
- * @returns A standardized result object with data or formatted error message
123
- *
124
- * @example
125
- * // Basic usage
126
- * const result = await apiWrapper(() => fetchUserData(userId));
127
- *
128
- * @example
129
- * // With default data value
130
- * const result = await apiWrapper(() => fetchPosts(), []);
131
- * // result.data will be [] instead of null on error
132
- */
133
- export async function apiWrapper(apiCall, defaultData) {
134
- try {
135
- const data = await apiCall();
136
- return {
137
- data,
138
- error: null,
139
- };
140
- }
141
- catch (error) {
142
- const errorObj = await processError(error);
143
- return {
144
- data: (defaultData !== null && defaultData !== void 0 ? defaultData : null),
145
- error: errorObj,
146
- };
147
- }
148
- }
@@ -1,2 +0,0 @@
1
- export * from "./shuffle.js";
2
- export * from "./unique.js";
@@ -1,12 +0,0 @@
1
- export function shuffle(array) {
2
- const shuffled = [...array];
3
- for (let i = shuffled.length - 1; i > 0; i--) {
4
- // Get cryptographically strong random values
5
- const randomBuffer = new Uint32Array(1);
6
- crypto.getRandomValues(randomBuffer);
7
- // Use modulo to get a value in our range
8
- const j = randomBuffer[0] % (i + 1);
9
- [shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
10
- }
11
- return shuffled;
12
- }
@@ -1,3 +0,0 @@
1
- export function unique(array) {
2
- return [...new Set(array)];
3
- }
package/dist/esm/array.js DELETED
@@ -1 +0,0 @@
1
- export * from './array/index.js'
@@ -1,111 +0,0 @@
1
- import dayJs from "dayjs";
2
- import advancedFormat from "dayjs/plugin/advancedFormat";
3
- import customParseFormat from "dayjs/plugin/customParseFormat";
4
- import localizedFormat from "dayjs/plugin/localizedFormat";
5
- import relativeTime from "dayjs/plugin/relativeTime";
6
- import timezone from "dayjs/plugin/timezone";
7
- import utc from "dayjs/plugin/utc";
8
- import "dayjs/locale/en";
9
- import "dayjs/locale/es";
10
- import "dayjs/locale/fr";
11
- import "dayjs/locale/pt-br";
12
- const DEFAULT_INTL_CONFIG = {
13
- locale: "pt-BR",
14
- options: {
15
- month: "long",
16
- day: "numeric",
17
- year: "numeric",
18
- },
19
- };
20
- let globalIntlConfig = {
21
- locale: DEFAULT_INTL_CONFIG.locale,
22
- options: { ...DEFAULT_INTL_CONFIG.options },
23
- };
24
- function mergeIntlConfigs(base, override) {
25
- var _a;
26
- if (!override) {
27
- return {
28
- locale: base.locale,
29
- options: { ...base.options },
30
- };
31
- }
32
- const mergedLocale = (_a = override.locale) !== null && _a !== void 0 ? _a : base.locale;
33
- const mergedOptions = { ...base.options };
34
- if (override.options) {
35
- for (const key of Object.keys(override.options)) {
36
- const value = override.options[key];
37
- if (value === undefined || value === null) {
38
- delete mergedOptions[key];
39
- }
40
- else {
41
- mergedOptions[key] = value;
42
- }
43
- }
44
- }
45
- return {
46
- locale: mergedLocale,
47
- options: mergedOptions,
48
- };
49
- }
50
- const intlPlugin = (pluginConfig, DayjsClass) => {
51
- if (pluginConfig) {
52
- globalIntlConfig = mergeIntlConfigs(globalIntlConfig, pluginConfig);
53
- }
54
- const formatIntl = function formatIntl(config) {
55
- const resolved = mergeIntlConfigs(globalIntlConfig, config);
56
- return new Intl.DateTimeFormat(resolved.locale, resolved.options).format(this.toDate());
57
- };
58
- const toIntlFormatter = function toIntlFormatter(config) {
59
- const resolved = mergeIntlConfigs(globalIntlConfig, config);
60
- return new Intl.DateTimeFormat(resolved.locale, resolved.options);
61
- };
62
- Object.defineProperty(DayjsClass.prototype, "formatIntl", {
63
- value: formatIntl,
64
- configurable: true,
65
- });
66
- Object.defineProperty(DayjsClass.prototype, "toIntlFormatter", {
67
- value: toIntlFormatter,
68
- configurable: true,
69
- });
70
- };
71
- export function getDayjsGlobalIntl() {
72
- return {
73
- locale: globalIntlConfig.locale,
74
- options: { ...globalIntlConfig.options },
75
- };
76
- }
77
- export function setDayjsGlobalIntl(config) {
78
- globalIntlConfig = mergeIntlConfigs(globalIntlConfig, config);
79
- return getDayjsGlobalIntl();
80
- }
81
- export function resetDayjsGlobalIntl() {
82
- globalIntlConfig = {
83
- locale: DEFAULT_INTL_CONFIG.locale,
84
- options: { ...DEFAULT_INTL_CONFIG.options },
85
- };
86
- return getDayjsGlobalIntl();
87
- }
88
- export function withDayjsGlobalIntl(config, callback) {
89
- const previous = getDayjsGlobalIntl();
90
- globalIntlConfig = mergeIntlConfigs(globalIntlConfig, config);
91
- try {
92
- return callback();
93
- }
94
- finally {
95
- globalIntlConfig = {
96
- locale: previous.locale,
97
- options: { ...previous.options },
98
- };
99
- }
100
- }
101
- export function resolveDayjsIntlConfig(config) {
102
- return mergeIntlConfigs(globalIntlConfig, config);
103
- }
104
- dayJs.extend(utc);
105
- dayJs.extend(customParseFormat);
106
- dayJs.extend(advancedFormat);
107
- dayJs.extend(timezone);
108
- dayJs.extend(localizedFormat);
109
- dayJs.extend(relativeTime);
110
- dayJs.extend(intlPlugin);
111
- export const dayjs = dayJs;
@@ -1,5 +0,0 @@
1
- import { dayjs } from "./dayjs.js";
2
- export function fixTimezoneOffset(utcDate) {
3
- const offset = new Date(utcDate).getTimezoneOffset();
4
- return dayjs(utcDate).add(offset, "minute");
5
- }
@@ -1,67 +0,0 @@
1
- import { dayjs, getDayjsGlobalIntl } from "./dayjs.js";
2
- function isFormatDateConfig(value) {
3
- return Boolean(value) && typeof value === "object" && !Array.isArray(value);
4
- }
5
- function isValidLocaleTag(value) {
6
- if (typeof Intl !== "undefined" &&
7
- typeof Intl.getCanonicalLocales === "function") {
8
- try {
9
- Intl.getCanonicalLocales(value);
10
- return true;
11
- }
12
- catch (_a) {
13
- return false;
14
- }
15
- }
16
- return /^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/.test(value);
17
- }
18
- function toDayjsLocale(locale) {
19
- if (!locale)
20
- return undefined;
21
- const first = Array.isArray(locale)
22
- ? locale[0]
23
- : locale;
24
- return typeof first === "string" ? first : String(first);
25
- }
26
- export function formatDate(date, localeOrConfig = getDayjsGlobalIntl().locale, opts) {
27
- var _a;
28
- const instance = dayjs(date);
29
- if (!instance.isValid()) {
30
- throw new RangeError("Invalid time value");
31
- }
32
- if (isFormatDateConfig(localeOrConfig)) {
33
- const { format, locale, intl, useIntl } = localeOrConfig;
34
- const baseLocale = locale !== null && locale !== void 0 ? locale : toDayjsLocale(intl === null || intl === void 0 ? void 0 : intl.locale);
35
- const workingInstance = baseLocale ? instance.locale(baseLocale) : instance;
36
- if (format && !useIntl) {
37
- return workingInstance.format(format);
38
- }
39
- const intlConfig = intl
40
- ? {
41
- locale: (_a = intl.locale) !== null && _a !== void 0 ? _a : baseLocale,
42
- options: intl.options,
43
- }
44
- : baseLocale
45
- ? {
46
- locale: baseLocale,
47
- }
48
- : undefined;
49
- return workingInstance.formatIntl(intlConfig);
50
- }
51
- if (typeof localeOrConfig === "string" && opts === undefined) {
52
- if (!isValidLocaleTag(localeOrConfig)) {
53
- return instance.format(localeOrConfig);
54
- }
55
- }
56
- const localeForDayjs = toDayjsLocale(localeOrConfig);
57
- const workingInstance = localeForDayjs
58
- ? instance.locale(localeForDayjs)
59
- : instance;
60
- const intlConfig = localeOrConfig !== undefined || opts !== undefined
61
- ? {
62
- locale: localeOrConfig,
63
- options: opts,
64
- }
65
- : undefined;
66
- return workingInstance.formatIntl(intlConfig);
67
- }
@@ -1,4 +0,0 @@
1
- import { dayjs } from "./dayjs.js";
2
- export function getCurrentDateInUTC() {
3
- return dayjs().utc();
4
- }
@@ -1,4 +0,0 @@
1
- import { dayjs } from "./dayjs.js";
2
- export function getDateInUTC(date) {
3
- return dayjs(date).utc();
4
- }
@@ -1,4 +0,0 @@
1
- import { dayjs } from "./dayjs.js";
2
- export function getRelativeTime(date, dateNow = dayjs()) {
3
- return dayjs(date).from(dateNow);
4
- }
@@ -1,7 +0,0 @@
1
- export * from "./dayjs.js";
2
- export * from "./fix-timezone-offset.js";
3
- export * from "./format-date.js";
4
- export * from "./get-current-date-in-utc.js";
5
- export * from "./get-date-in-utc.js";
6
- export * from "./get-relative-time.js";
7
- export * from "./parse-time-spent.js";