@dub/utils 0.0.27 → 0.0.29

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 (234) hide show
  1. package/dist/chunk-2CBXK3IX.mjs +1 -0
  2. package/dist/chunk-2DN4J7N7.mjs +1 -0
  3. package/dist/chunk-2J47GIUG.mjs +1 -0
  4. package/dist/chunk-2JOG52JO.mjs +1 -0
  5. package/dist/chunk-2OJAP233.mjs +1 -0
  6. package/dist/chunk-2RCZ6Q6L.mjs +1 -0
  7. package/dist/chunk-2SICE2ZS.mjs +1 -0
  8. package/dist/chunk-2TURBZEL.mjs +1 -0
  9. package/dist/chunk-34MPJURK.mjs +1 -0
  10. package/dist/chunk-3B5DP3T4.mjs +1 -0
  11. package/dist/chunk-3BUV2ANI.mjs +1 -0
  12. package/dist/chunk-3C2XEUEU.mjs +1 -0
  13. package/dist/chunk-3OOMLTJU.mjs +1 -0
  14. package/dist/chunk-3PRW7SAO.mjs +1 -0
  15. package/dist/chunk-3UBZ222G.mjs +1 -0
  16. package/dist/chunk-4BN7BHOL.mjs +1 -0
  17. package/dist/chunk-4M6WGMF5.mjs +1 -0
  18. package/dist/chunk-4Q6OLEY4.mjs +1 -0
  19. package/dist/chunk-4VHMU2SN.mjs +1 -0
  20. package/dist/chunk-5FPTMLJS.mjs +1 -0
  21. package/dist/chunk-5IKS3MYC.mjs +1 -0
  22. package/dist/chunk-5KZBTOIK.mjs +1 -0
  23. package/dist/chunk-5PD4TPH7.mjs +1 -0
  24. package/dist/chunk-5SBJ6SVD.mjs +1 -0
  25. package/dist/chunk-5SU2MWLU.mjs +0 -0
  26. package/dist/chunk-5UMPAJJX.mjs +1 -0
  27. package/dist/chunk-5VUO5P2B.mjs +1 -0
  28. package/dist/chunk-6MXR5XLJ.mjs +1 -0
  29. package/dist/chunk-6N3NW2JB.mjs +1 -0
  30. package/dist/chunk-6Q2MCPZP.mjs +1 -0
  31. package/dist/chunk-6SBJPILW.mjs +1 -0
  32. package/dist/chunk-6TFUDH7S.mjs +1 -0
  33. package/dist/chunk-6XPTKHZD.mjs +1 -0
  34. package/dist/chunk-6ZJZL5CL.mjs +1 -0
  35. package/dist/chunk-76VXH2L6.mjs +1 -0
  36. package/dist/chunk-7CR3I247.mjs +1 -0
  37. package/dist/chunk-7OQSL4CI.mjs +2 -0
  38. package/dist/chunk-A4FADA67.mjs +1 -0
  39. package/dist/chunk-AI2STCLX.mjs +1 -0
  40. package/dist/chunk-AIRQ6LHD.mjs +1 -0
  41. package/dist/chunk-ARUFZ3N7.mjs +1 -0
  42. package/dist/chunk-B4R2MH5C.mjs +1 -0
  43. package/dist/chunk-BE3FE22D.mjs +1 -0
  44. package/dist/chunk-BF4VFD3F.mjs +1 -0
  45. package/dist/chunk-BMMTE4CL.mjs +1 -0
  46. package/dist/chunk-BQ3MQSVS.mjs +1 -0
  47. package/dist/chunk-C7CFYTBV.mjs +1 -0
  48. package/dist/chunk-CFRAJHSR.mjs +1 -0
  49. package/dist/chunk-CGKMNADD.mjs +1 -0
  50. package/dist/chunk-CLZKQYIL.mjs +1 -0
  51. package/dist/chunk-CWX6UGU4.mjs +1 -0
  52. package/dist/chunk-DHOWTHOI.mjs +3 -0
  53. package/dist/chunk-DNDRN3T4.mjs +1 -0
  54. package/dist/chunk-DWGAAIZ7.mjs +1 -0
  55. package/dist/chunk-DZ5GL4XN.mjs +1 -0
  56. package/dist/chunk-E67KYH6T.mjs +1 -0
  57. package/dist/chunk-EEEOYXQI.mjs +1 -0
  58. package/dist/chunk-EMGP7EVH.mjs +1 -0
  59. package/dist/chunk-EMO4MGOU.mjs +1 -0
  60. package/dist/chunk-F6C3QYRM.mjs +1 -0
  61. package/dist/chunk-FCP5HRN4.mjs +1 -0
  62. package/dist/chunk-FKZO6ZCE.mjs +1 -0
  63. package/dist/chunk-FLUV3ASQ.mjs +1 -0
  64. package/dist/chunk-FYXE2IZT.mjs +1 -0
  65. package/dist/chunk-GDTIZXZ3.mjs +1 -0
  66. package/dist/chunk-GLUCCYWG.mjs +1 -0
  67. package/dist/chunk-GQLUSHIW.mjs +1 -0
  68. package/dist/chunk-GSO7S5NU.mjs +1 -0
  69. package/dist/chunk-GTQBILTE.mjs +1 -0
  70. package/dist/chunk-GVB72EOZ.mjs +1 -0
  71. package/dist/chunk-H2EZ5ZIA.mjs +1 -0
  72. package/dist/chunk-H3CKT4E4.mjs +1 -0
  73. package/dist/chunk-HBI3VUWA.mjs +1 -0
  74. package/dist/chunk-HCAIWJBW.mjs +1 -0
  75. package/dist/chunk-HHZK2W6M.mjs +1 -0
  76. package/dist/chunk-HTKASIVN.mjs +1 -0
  77. package/dist/chunk-HX6TVXHR.mjs +1 -0
  78. package/dist/chunk-I5Y5DKPK.mjs +1 -0
  79. package/dist/chunk-IGSNFZ4Y.mjs +1 -0
  80. package/dist/chunk-IOI3AZRU.mjs +1 -0
  81. package/dist/chunk-IX5HENBH.mjs +1 -0
  82. package/dist/chunk-J6V4PKNC.mjs +1 -0
  83. package/dist/chunk-JD46NPAZ.mjs +1 -0
  84. package/dist/chunk-JGFJKSKU.mjs +1 -0
  85. package/dist/chunk-JQHV2HJR.mjs +1 -0
  86. package/dist/chunk-JUE3IN3O.mjs +1 -0
  87. package/dist/chunk-KKQDG22H.mjs +1 -0
  88. package/dist/chunk-KKUAJ54V.mjs +1 -0
  89. package/dist/chunk-KL7VCF4Y.mjs +1 -0
  90. package/dist/chunk-L2SFRDQT.mjs +1 -0
  91. package/dist/chunk-L7JSRS6V.mjs +1 -0
  92. package/dist/chunk-LBQJ5TZQ.mjs +1 -0
  93. package/dist/chunk-LKZUZTIO.mjs +1 -0
  94. package/dist/chunk-LPIDPOIS.mjs +1 -0
  95. package/dist/chunk-LREWF6LN.mjs +1 -0
  96. package/dist/chunk-LVZK27B4.mjs +1 -0
  97. package/dist/chunk-LXJVNY3R.mjs +1 -0
  98. package/dist/chunk-M36MRN4N.mjs +1 -0
  99. package/dist/chunk-MPU6JRPV.mjs +1 -0
  100. package/dist/chunk-MT3GLHZG.mjs +1 -0
  101. package/dist/chunk-MW23UGKA.mjs +1 -0
  102. package/dist/chunk-MWIL2V7E.mjs +1 -0
  103. package/dist/chunk-NDZIEH7M.mjs +1 -0
  104. package/dist/chunk-NEIHTFSW.mjs +1 -0
  105. package/dist/chunk-NI6IFTE4.mjs +1 -0
  106. package/dist/chunk-NQUREBTN.mjs +1 -0
  107. package/dist/chunk-NZ6LIVRY.mjs +1 -0
  108. package/dist/chunk-OANHZJ6X.mjs +1 -0
  109. package/dist/chunk-OBU4KABJ.mjs +1 -0
  110. package/dist/chunk-OQD4PMKZ.mjs +1 -0
  111. package/dist/chunk-OQGZM33B.mjs +1 -0
  112. package/dist/chunk-OSU5S2YT.mjs +3 -0
  113. package/dist/chunk-OWYWG4M6.mjs +1 -0
  114. package/dist/chunk-PCCGH2UI.mjs +1 -0
  115. package/dist/chunk-PEPVOMPB.mjs +1 -0
  116. package/dist/chunk-PUFZASP4.mjs +1 -0
  117. package/dist/chunk-QGTFY7PK.mjs +1 -0
  118. package/dist/chunk-QQFYILG6.mjs +1 -0
  119. package/dist/chunk-QU7V46PO.mjs +1 -0
  120. package/dist/chunk-QYPFWXDY.mjs +1 -0
  121. package/dist/chunk-QYTC2VMO.mjs +1 -0
  122. package/dist/chunk-R3RG2UW3.mjs +1 -0
  123. package/dist/chunk-RDVXOO55.mjs +1 -0
  124. package/dist/chunk-RQYMBQ7I.mjs +1 -0
  125. package/dist/chunk-S62WENCB.mjs +1 -0
  126. package/dist/chunk-SKVYWWBC.mjs +3 -0
  127. package/dist/chunk-SL5QAJSF.mjs +1 -0
  128. package/dist/chunk-SPSUTBZ7.mjs +0 -0
  129. package/dist/chunk-SQXHJWOE.mjs +1 -0
  130. package/dist/chunk-SYT2IXG6.mjs +1 -0
  131. package/dist/chunk-T3EPQH24.mjs +1 -0
  132. package/dist/chunk-TLVFY24T.mjs +1 -0
  133. package/dist/chunk-TVYDH6QM.mjs +1 -0
  134. package/dist/chunk-TXEDXHC5.mjs +1 -0
  135. package/dist/chunk-UAGJDHMS.mjs +1 -0
  136. package/dist/chunk-UBCCNLBS.mjs +1 -0
  137. package/dist/chunk-UD2ICHSZ.mjs +1 -0
  138. package/dist/chunk-UHFP5VHY.mjs +1 -0
  139. package/dist/chunk-ULWVKJS4.mjs +1 -0
  140. package/dist/chunk-UQ5D3U6Z.mjs +1 -0
  141. package/dist/chunk-UUWTKITJ.mjs +1 -0
  142. package/dist/chunk-V2RYRJWZ.mjs +1 -0
  143. package/dist/chunk-VCVRICBE.mjs +1 -0
  144. package/dist/chunk-VEUP2DC6.mjs +1 -0
  145. package/dist/chunk-VJZP4EP5.mjs +1 -0
  146. package/dist/chunk-VOGFN73W.mjs +1 -0
  147. package/dist/chunk-VT32LSIK.mjs +1 -0
  148. package/dist/chunk-VTLX43W7.mjs +1 -0
  149. package/dist/chunk-VZYPOBKB.mjs +1 -0
  150. package/dist/chunk-W5LUKKPM.mjs +1 -0
  151. package/dist/chunk-W7MK4ZQS.mjs +1 -0
  152. package/dist/chunk-WCOSO55V.mjs +1 -0
  153. package/dist/chunk-WCUHRXGZ.mjs +1 -0
  154. package/dist/chunk-WE5LUVZO.mjs +1 -0
  155. package/dist/chunk-WEC6YZEP.mjs +1 -0
  156. package/dist/chunk-WJXI5YEO.mjs +1 -0
  157. package/dist/chunk-XCPPFNWE.mjs +1 -0
  158. package/dist/chunk-XEJNQ2MU.mjs +1 -0
  159. package/dist/chunk-XLREFEL6.mjs +1 -0
  160. package/dist/chunk-XP4JQI4P.mjs +1 -0
  161. package/dist/chunk-XWSEDYR7.mjs +1 -0
  162. package/dist/chunk-YUMUNL66.mjs +1 -0
  163. package/dist/chunk-YXHGPHL2.mjs +1 -0
  164. package/dist/chunk-YY4NGU5S.mjs +1 -0
  165. package/dist/chunk-ZBBENF7Y.mjs +1 -0
  166. package/dist/chunk-ZECUYKGD.mjs +1 -0
  167. package/dist/chunk-ZJKRLIJQ.mjs +1 -0
  168. package/dist/chunk-ZM4JP5B2.mjs +1 -0
  169. package/dist/chunk-ZQST7SKH.mjs +1 -0
  170. package/dist/constants/cctlds.d.ts +1 -1
  171. package/dist/constants/cctlds.mjs +1 -1
  172. package/dist/constants/countries.d.ts +1 -1
  173. package/dist/constants/countries.mjs +1 -1
  174. package/dist/constants/domains.d.ts +4 -0
  175. package/dist/constants/domains.mjs +1 -0
  176. package/dist/constants/framer-motion.d.ts +58 -0
  177. package/dist/constants/framer-motion.mjs +1 -0
  178. package/dist/constants/index.d.ts +132 -121
  179. package/dist/constants/index.mjs +1 -1
  180. package/dist/constants/layout.d.ts +11 -0
  181. package/dist/constants/layout.mjs +1 -0
  182. package/dist/constants/localhost.d.ts +10 -0
  183. package/dist/constants/localhost.mjs +1 -0
  184. package/dist/constants/middleware.d.ts +21 -0
  185. package/dist/constants/middleware.mjs +1 -0
  186. package/dist/constants/misc.d.ts +21 -0
  187. package/dist/constants/misc.mjs +1 -0
  188. package/dist/constants/saml.d.ts +14 -0
  189. package/dist/constants/saml.mjs +1 -0
  190. package/dist/functions/capitalize.d.ts +3 -0
  191. package/dist/functions/capitalize.mjs +1 -0
  192. package/dist/functions/chunk.d.ts +3 -0
  193. package/dist/functions/chunk.mjs +1 -0
  194. package/dist/functions/cn.d.ts +5 -0
  195. package/dist/functions/cn.mjs +1 -0
  196. package/dist/functions/construct-metadata.d.ts +11 -0
  197. package/dist/functions/construct-metadata.mjs +1 -0
  198. package/dist/functions/datetime.d.ts +11 -0
  199. package/dist/functions/datetime.mjs +1 -0
  200. package/dist/functions/deep-equal.d.ts +4 -0
  201. package/dist/functions/deep-equal.mjs +1 -0
  202. package/dist/functions/domains.d.ts +10 -0
  203. package/dist/functions/domains.mjs +1 -0
  204. package/dist/functions/fetch-with-timeout.d.ts +3 -0
  205. package/dist/functions/fetch-with-timeout.mjs +1 -0
  206. package/dist/functions/fetcher.d.ts +3 -0
  207. package/dist/functions/fetcher.mjs +1 -0
  208. package/dist/functions/hash.d.ts +3 -0
  209. package/dist/functions/hash.mjs +1 -0
  210. package/dist/functions/index.d.ts +21 -0
  211. package/dist/functions/index.mjs +1 -0
  212. package/dist/functions/is-iframeable.d.ts +6 -0
  213. package/dist/functions/is-iframeable.mjs +1 -0
  214. package/dist/functions/link-constructor.d.ts +9 -0
  215. package/dist/functions/link-constructor.mjs +1 -0
  216. package/dist/functions/log.d.ts +7 -0
  217. package/dist/functions/log.mjs +1 -0
  218. package/dist/functions/misc.d.ts +115 -0
  219. package/dist/functions/misc.mjs +1 -0
  220. package/dist/functions/nanoid.d.ts +3 -0
  221. package/dist/functions/nanoid.mjs +1 -0
  222. package/dist/functions/nformatter.d.ts +6 -0
  223. package/dist/functions/nformatter.mjs +1 -0
  224. package/dist/functions/time-ago.d.ts +5 -0
  225. package/dist/functions/time-ago.mjs +1 -0
  226. package/dist/functions/truncate.d.ts +3 -0
  227. package/dist/functions/truncate.mjs +1 -0
  228. package/dist/functions/urls.d.ts +13 -0
  229. package/dist/functions/urls.mjs +1 -0
  230. package/dist/index.d.ts +31 -181
  231. package/dist/index.mjs +1 -1
  232. package/dist/is-iframeable-4cf55b9f.d.ts +6 -0
  233. package/dist/url-to-deeplink-ac84c7cb.d.ts +6 -0
  234. package/package.json +3 -3
@@ -0,0 +1,21 @@
1
+ export { capitalize } from './capitalize.js';
2
+ export { chunk } from './chunk.js';
3
+ export { cn } from './cn.js';
4
+ export { constructMetadata } from './construct-metadata.js';
5
+ export { formatDate, getAdjustedBillingCycleStart, getBillingStartDate, getDateTimeLocal, getFirstAndLastDay, getLastDayOfMonth } from './datetime.js';
6
+ export { deepEqual } from './deep-equal.js';
7
+ export { generateDomainFromName, getApexDomain, getDomainWithoutWWW, getSubdomain, isDubDomain, validDomainRegex, validKeyRegex, validSlugRegex } from './domains.js';
8
+ export { fetchWithTimeout } from './fetch-with-timeout.js';
9
+ export { fetcher } from './fetcher.js';
10
+ export { generateMD5Hash } from './hash.js';
11
+ export { isIframeable } from './is-iframeable.js';
12
+ export { linkConstructor } from './link-constructor.js';
13
+ export { log } from './log.js';
14
+ export { getPlanFromPriceId } from './misc.js';
15
+ export { nanoid } from './nanoid.js';
16
+ export { nFormatter } from './nformatter.js';
17
+ export { timeAgo } from './time-ago.js';
18
+ export { truncate } from './truncate.js';
19
+ export { constructURLFromUTMParams, getParamsFromURL, getSearchParams, getUrlFromString, getUrlWithoutUTMParams, isValidUrl, paramsMetadata } from './urls.js';
20
+ import 'clsx';
21
+ import 'next';
@@ -0,0 +1 @@
1
+ import"../chunk-SPSUTBZ7.mjs";import{a as F}from"../chunk-PEPVOMPB.mjs";import{a as G}from"../chunk-6Q2MCPZP.mjs";import{a as H}from"../chunk-OWYWG4M6.mjs";import{a as I}from"../chunk-I5Y5DKPK.mjs";import{a as J}from"../chunk-MPU6JRPV.mjs";import{a as K}from"../chunk-ZJKRLIJQ.mjs";import{a as k}from"../chunk-ZECUYKGD.mjs";import{a as s,b as t,c as u,d as v,e as w,f as x,g as y,h as z}from"../chunk-VEUP2DC6.mjs";import{a as l,b as m,c as n,d as o,e as p,f as q,g as r}from"../chunk-UUWTKITJ.mjs";import{a as A}from"../chunk-EMO4MGOU.mjs";import{a as B}from"../chunk-6XPTKHZD.mjs";import{a as C}from"../chunk-XWSEDYR7.mjs";import{a as D}from"../chunk-3BUV2ANI.mjs";import{a as E}from"../chunk-5PD4TPH7.mjs";import{a}from"../chunk-GTQBILTE.mjs";import{a as b}from"../chunk-2OJAP233.mjs";import{a as c}from"../chunk-NEIHTFSW.mjs";import{a as d}from"../chunk-2TURBZEL.mjs";import{a as e,b as f,c as g,d as h,e as i,f as j}from"../chunk-LXJVNY3R.mjs";import"../chunk-VTLX43W7.mjs";import"../chunk-5VUO5P2B.mjs";import"../chunk-5FPTMLJS.mjs";import"../chunk-PUFZASP4.mjs";import"../chunk-YUMUNL66.mjs";import"../chunk-2RCZ6Q6L.mjs";import"../chunk-SYT2IXG6.mjs";import"../chunk-2SICE2ZS.mjs";import"../chunk-WE5LUVZO.mjs";import"../chunk-FYXE2IZT.mjs";export{a as capitalize,b as chunk,c as cn,d as constructMetadata,p as constructURLFromUTMParams,k as deepEqual,A as fetchWithTimeout,B as fetcher,f as formatDate,s as generateDomainFromName,C as generateMD5Hash,i as getAdjustedBillingCycleStart,x as getApexDomain,j as getBillingStartDate,e as getDateTimeLocal,y as getDomainWithoutWWW,g as getFirstAndLastDay,h as getLastDayOfMonth,o as getParamsFromURL,G as getPlanFromPriceId,n as getSearchParams,w as getSubdomain,m as getUrlFromString,r as getUrlWithoutUTMParams,z as isDubDomain,D as isIframeable,l as isValidUrl,E as linkConstructor,F as log,I as nFormatter,H as nanoid,q as paramsMetadata,J as timeAgo,K as truncate,t as validDomainRegex,u as validKeyRegex,v as validSlugRegex};
@@ -0,0 +1,6 @@
1
+ declare const isIframeable: ({ url, requestDomain, }: {
2
+ url: string;
3
+ requestDomain: string;
4
+ }) => Promise<boolean>;
5
+
6
+ export { isIframeable };
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-3BUV2ANI.mjs";export{a as isIframeable};
@@ -0,0 +1,9 @@
1
+ declare function linkConstructor({ domain, key, localhost, pretty, noDomain, }: {
2
+ domain?: string;
3
+ key?: string;
4
+ localhost?: boolean;
5
+ pretty?: boolean;
6
+ noDomain?: boolean;
7
+ }): string;
8
+
9
+ export { linkConstructor };
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-5PD4TPH7.mjs";export{a as linkConstructor};
@@ -0,0 +1,7 @@
1
+ declare const log: ({ message, type, mention, }: {
2
+ message: string;
3
+ type: "alerts" | "cron" | "links" | "errors";
4
+ mention?: boolean | undefined;
5
+ }) => Promise<Response | undefined>;
6
+
7
+ export { log };
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-PEPVOMPB.mjs";export{a as log};
@@ -0,0 +1,115 @@
1
+ declare const getPlanFromPriceId: (priceId: string) => {
2
+ name: string;
3
+ tagline: string;
4
+ price: {
5
+ monthly: number;
6
+ yearly: number;
7
+ ids?: undefined;
8
+ };
9
+ limits: {
10
+ links: number;
11
+ clicks: number;
12
+ domains: number;
13
+ tags: number;
14
+ users: number;
15
+ };
16
+ colors: {
17
+ bg: string;
18
+ text: string;
19
+ };
20
+ cta: {
21
+ text: string;
22
+ href: string;
23
+ color: string;
24
+ shortText?: undefined;
25
+ };
26
+ featureTitle: string;
27
+ features: ({
28
+ text: string;
29
+ footnote?: undefined;
30
+ } | {
31
+ text: string;
32
+ footnote: string;
33
+ } | {
34
+ text: string;
35
+ footnote: {
36
+ title: string;
37
+ cta: string;
38
+ href: string;
39
+ };
40
+ })[];
41
+ link?: undefined;
42
+ } | {
43
+ name: string;
44
+ tagline: string;
45
+ link: string;
46
+ price: {
47
+ monthly: number;
48
+ yearly: number;
49
+ ids: string[];
50
+ };
51
+ limits: {
52
+ links: number;
53
+ clicks: number;
54
+ domains: number;
55
+ tags: number;
56
+ users: number;
57
+ };
58
+ colors: {
59
+ bg: string;
60
+ text: string;
61
+ };
62
+ cta: {
63
+ text: string;
64
+ shortText: string;
65
+ href: string;
66
+ color: string;
67
+ };
68
+ featureTitle: string;
69
+ features: ({
70
+ text: string;
71
+ footnote?: undefined;
72
+ } | {
73
+ text: string;
74
+ footnote: string;
75
+ } | {
76
+ text: string;
77
+ footnote: {
78
+ title: string;
79
+ cta: string;
80
+ href: string;
81
+ };
82
+ })[];
83
+ } | {
84
+ name: string;
85
+ tagline: string;
86
+ link: string;
87
+ price: {
88
+ monthly: null;
89
+ yearly: null;
90
+ ids?: undefined;
91
+ };
92
+ limits: {
93
+ links: null;
94
+ clicks: null;
95
+ domains: null;
96
+ tags?: undefined;
97
+ users?: undefined;
98
+ };
99
+ colors: {
100
+ bg: string;
101
+ text: string;
102
+ };
103
+ cta: {
104
+ text: string;
105
+ href: string;
106
+ color: string;
107
+ shortText?: undefined;
108
+ };
109
+ featureTitle: string;
110
+ features: {
111
+ text: string;
112
+ }[];
113
+ } | null;
114
+
115
+ export { getPlanFromPriceId };
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-6Q2MCPZP.mjs";import"../chunk-VTLX43W7.mjs";import"../chunk-5VUO5P2B.mjs";import"../chunk-5FPTMLJS.mjs";import"../chunk-PUFZASP4.mjs";import"../chunk-YUMUNL66.mjs";import"../chunk-2RCZ6Q6L.mjs";import"../chunk-SYT2IXG6.mjs";import"../chunk-2SICE2ZS.mjs";import"../chunk-WE5LUVZO.mjs";import"../chunk-FYXE2IZT.mjs";export{a as getPlanFromPriceId};
@@ -0,0 +1,3 @@
1
+ declare const nanoid: (chars?: number) => string;
2
+
3
+ export { nanoid };
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-OWYWG4M6.mjs";export{a as nanoid};
@@ -0,0 +1,6 @@
1
+ declare function nFormatter(num?: number, opts?: {
2
+ digits?: number;
3
+ full?: boolean;
4
+ }): string;
5
+
6
+ export { nFormatter };
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-I5Y5DKPK.mjs";export{a as nFormatter};
@@ -0,0 +1,5 @@
1
+ declare const timeAgo: (timestamp: Date | null, { withAgo, }?: {
2
+ withAgo?: boolean | undefined;
3
+ }) => string;
4
+
5
+ export { timeAgo };
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-MPU6JRPV.mjs";export{a as timeAgo};
@@ -0,0 +1,3 @@
1
+ declare const truncate: (str: string | null, length: number) => string | null;
2
+
3
+ export { truncate };
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-ZJKRLIJQ.mjs";export{a as truncate};
@@ -0,0 +1,13 @@
1
+ declare const isValidUrl: (url: string) => boolean;
2
+ declare const getUrlFromString: (str: string) => string | null | undefined;
3
+ declare const getSearchParams: (url: string) => Record<string, string>;
4
+ declare const getParamsFromURL: (url: string) => Record<string, string>;
5
+ declare const constructURLFromUTMParams: (url: string, utmParams: Record<string, string>) => string;
6
+ declare const paramsMetadata: {
7
+ display: string;
8
+ key: string;
9
+ examples: string;
10
+ }[];
11
+ declare const getUrlWithoutUTMParams: (url: string) => string;
12
+
13
+ export { constructURLFromUTMParams, getParamsFromURL, getSearchParams, getUrlFromString, getUrlWithoutUTMParams, isValidUrl, paramsMetadata };
@@ -0,0 +1 @@
1
+ import{a,b,c,d,e,f,g}from"../chunk-UUWTKITJ.mjs";export{e as constructURLFromUTMParams,d as getParamsFromURL,c as getSearchParams,b as getUrlFromString,g as getUrlWithoutUTMParams,a as isValidUrl,f as paramsMetadata};
package/dist/index.d.ts CHANGED
@@ -1,181 +1,31 @@
1
- import { ClassValue } from 'clsx';
2
- import { Metadata } from 'next';
3
- export { ADMIN_HOSTNAMES, ALL_TOOLS, API_DOMAIN, API_HOSTNAMES, APP_DOMAIN, APP_DOMAIN_WITH_NGROK, APP_HOSTNAMES, DEFAULT_LINK_PROPS, DEFAULT_REDIRECTS, DUB_DOMAINS, DUB_HEADERS, DUB_LOGO, DUB_PROJECT_ID, DUB_THUMBNAIL, FADE_IN_ANIMATION_SETTINGS, FRAMER_MOTION_LIST_ITEM_VARIANTS, GOOGLE_FAVICON_URL, HIDE_BACKGROUND_SEGMENTS, HOME_DOMAIN, LEGAL_PROJECT_ID, LEGAL_USER_ID, LOCALHOST_GEO_DATA, LOCALHOST_IP, PAGINATION_LIMIT, PLANS, SAML_PROVIDERS, SECOND_LEVEL_DOMAINS, SELF_SERVE_PAID_PLANS, SHORT_DOMAIN, SPECIAL_APEX_DOMAINS, STAGGER_CHILD_VARIANTS, SWIPE_REVEAL_ANIMATION_SETTINGS } from './constants/index.js';
4
- export { default as ccTLDs } from './constants/cctlds.js';
5
- export { default as COUNTRIES } from './constants/countries.js';
6
-
7
- declare function cn(...inputs: ClassValue[]): string;
8
- declare function constructMetadata({ title, description, image, icons, noIndex, }?: {
9
- title?: string;
10
- description?: string;
11
- image?: string;
12
- icons?: Metadata["icons"];
13
- noIndex?: boolean;
14
- }): Metadata;
15
- declare const nanoid: (size?: number | undefined) => string;
16
- declare function fetcher<JSON = any>(input: RequestInfo, init?: RequestInit): Promise<JSON>;
17
- declare function nFormatter(num?: number, opts?: {
18
- digits?: number;
19
- full?: boolean;
20
- }): string;
21
- declare function capitalize(str?: string | null): string | null | undefined;
22
- declare const chunk: <T>(array: T[], chunk_size: number) => T[][];
23
- declare function linkConstructor({ domain, key, localhost, pretty, noDomain, }: {
24
- domain?: string;
25
- key?: string;
26
- localhost?: boolean;
27
- pretty?: boolean;
28
- noDomain?: boolean;
29
- }): string;
30
- declare const timeAgo: (timestamp: Date | null, { withAgo, }?: {
31
- withAgo?: boolean | undefined;
32
- }) => string;
33
- declare const getDateTimeLocal: (timestamp?: Date) => string;
34
- declare const formatDate: (dateString: string) => string;
35
- declare const getFirstAndLastDay: (day: number) => {
36
- firstDay: Date;
37
- lastDay: Date;
38
- };
39
- declare const getLastDayOfMonth: () => number;
40
- declare const getAdjustedBillingCycleStart: (billingCycleStart: number) => number;
41
- declare const getBillingStartDate: (billingCycleStart: number) => Date;
42
- declare const getPlanFromPriceId: (priceId: string) => {
43
- name: string;
44
- tagline: string;
45
- price: {
46
- monthly: number;
47
- yearly: number;
48
- ids?: undefined;
49
- };
50
- limits: {
51
- links: number;
52
- clicks: number;
53
- domains: number;
54
- tags: number;
55
- users: number;
56
- };
57
- colors: {
58
- bg: string;
59
- text: string;
60
- };
61
- cta: {
62
- text: string;
63
- href: string;
64
- color: string;
65
- shortText?: undefined;
66
- };
67
- featureTitle: string;
68
- features: ({
69
- text: string;
70
- footnote?: undefined;
71
- } | {
72
- text: string;
73
- footnote: string;
74
- } | {
75
- text: string;
76
- footnote: {
77
- title: string;
78
- cta: string;
79
- href: string;
80
- };
81
- })[];
82
- } | {
83
- name: string;
84
- tagline: string;
85
- price: {
86
- monthly: number;
87
- yearly: number;
88
- ids: string[];
89
- };
90
- limits: {
91
- links: number;
92
- clicks: number;
93
- domains: number;
94
- tags: number;
95
- users: number;
96
- };
97
- colors: {
98
- bg: string;
99
- text: string;
100
- };
101
- cta: {
102
- text: string;
103
- shortText: string;
104
- href: string;
105
- color: string;
106
- };
107
- featureTitle: string;
108
- features: ({
109
- text: string;
110
- footnote?: undefined;
111
- } | {
112
- text: string;
113
- footnote: string;
114
- } | {
115
- text: string;
116
- footnote: {
117
- title: string;
118
- cta: string;
119
- href: string;
120
- };
121
- })[];
122
- } | {
123
- name: string;
124
- price: {
125
- monthly: null;
126
- yearly: null;
127
- ids?: undefined;
128
- };
129
- limits: {
130
- links: null;
131
- clicks: null;
132
- domains: null;
133
- tags?: undefined;
134
- users?: undefined;
135
- };
136
- colors: {
137
- bg: string;
138
- text: string;
139
- };
140
- cta: {
141
- text: string;
142
- href: string;
143
- color: string;
144
- shortText?: undefined;
145
- };
146
- featureTitle: string;
147
- features: {
148
- text: string;
149
- }[];
150
- tagline?: undefined;
151
- } | null;
152
- declare const generateDomainFromName: (name: string) => string;
153
- declare const validDomainRegex: RegExp;
154
- declare const validKeyRegex: RegExp;
155
- declare const validSlugRegex: RegExp;
156
- declare const getSubdomain: (name: string, apexName: string) => string | null;
157
- declare const getApexDomain: (url: string) => string;
158
- declare const isValidUrl: (url: string) => boolean;
159
- declare const getUrlFromString: (str: string) => string | null | undefined;
160
- declare const getDomainWithoutWWW: (url: string) => string | null | undefined;
161
- declare const isDubDomain: (domain: string) => boolean;
162
- declare const getSearchParams: (url: string) => Record<string, string>;
163
- declare const truncate: (str: string | null, length: number) => string | null;
164
- declare const getParamsFromURL: (url: string) => Record<string, string>;
165
- declare const constructURLFromUTMParams: (url: string, utmParams: Record<string, string>) => string;
166
- declare const paramsMetadata: {
167
- display: string;
168
- key: string;
169
- examples: string;
170
- }[];
171
- declare const getUrlWithoutUTMParams: (url: string) => string;
172
- declare function generateMD5Hash(message: string): Promise<string>;
173
- declare const log: ({ message, type, mention, }: {
174
- message: string;
175
- type: "cron" | "links";
176
- mention?: boolean | undefined;
177
- }) => Promise<Response | undefined>;
178
- type DeepEqual = (obj1: Record<string, any>, obj2: Record<string, any>) => boolean;
179
- declare const deepEqual: DeepEqual;
180
-
181
- export { capitalize, chunk, cn, constructMetadata, constructURLFromUTMParams, deepEqual, fetcher, formatDate, generateDomainFromName, generateMD5Hash, getAdjustedBillingCycleStart, getApexDomain, getBillingStartDate, getDateTimeLocal, getDomainWithoutWWW, getFirstAndLastDay, getLastDayOfMonth, getParamsFromURL, getPlanFromPriceId, getSearchParams, getSubdomain, getUrlFromString, getUrlWithoutUTMParams, isDubDomain, isValidUrl, linkConstructor, log, nFormatter, nanoid, paramsMetadata, timeAgo, truncate, validDomainRegex, validKeyRegex, validSlugRegex };
1
+ export { ADMIN_HOSTNAMES, API_DOMAIN, API_HOSTNAMES, APP_DOMAIN, APP_DOMAIN_WITH_NGROK, APP_HOSTNAMES, APP_NAME, DEMO_LINK_ID, DUB_DOMAINS, DUB_LOGO, DUB_PROJECT_ID, DUB_THUMBNAIL, FREE_PLAN, FREE_PROJECTS_LIMIT, HOME_DOMAIN, LEGAL_PROJECT_ID, LEGAL_USER_ID, PLANS, SELF_SERVE_PAID_PLANS, SHORT_DOMAIN } from './constants/index.js';
2
+ export { capitalize } from './functions/capitalize.js';
3
+ export { chunk } from './functions/chunk.js';
4
+ export { cn } from './functions/cn.js';
5
+ export { constructMetadata } from './functions/construct-metadata.js';
6
+ export { formatDate, getAdjustedBillingCycleStart, getBillingStartDate, getDateTimeLocal, getFirstAndLastDay, getLastDayOfMonth } from './functions/datetime.js';
7
+ export { deepEqual } from './functions/deep-equal.js';
8
+ export { generateDomainFromName, getApexDomain, getDomainWithoutWWW, getSubdomain, isDubDomain, validDomainRegex, validKeyRegex, validSlugRegex } from './functions/domains.js';
9
+ export { fetchWithTimeout } from './functions/fetch-with-timeout.js';
10
+ export { fetcher } from './functions/fetcher.js';
11
+ export { generateMD5Hash } from './functions/hash.js';
12
+ export { isIframeable } from './functions/is-iframeable.js';
13
+ export { linkConstructor } from './functions/link-constructor.js';
14
+ export { log } from './functions/log.js';
15
+ export { getPlanFromPriceId } from './functions/misc.js';
16
+ export { nanoid } from './functions/nanoid.js';
17
+ export { nFormatter } from './functions/nformatter.js';
18
+ export { timeAgo } from './functions/time-ago.js';
19
+ export { truncate } from './functions/truncate.js';
20
+ export { constructURLFromUTMParams, getParamsFromURL, getSearchParams, getUrlFromString, getUrlWithoutUTMParams, isValidUrl, paramsMetadata } from './functions/urls.js';
21
+ export { ccTLDs } from './constants/cctlds.js';
22
+ export { COUNTRIES } from './constants/countries.js';
23
+ export { SECOND_LEVEL_DOMAINS, SPECIAL_APEX_DOMAINS } from './constants/domains.js';
24
+ export { FADE_IN_ANIMATION_SETTINGS, FRAMER_MOTION_LIST_ITEM_VARIANTS, STAGGER_CHILD_VARIANTS, SWIPE_REVEAL_ANIMATION_SETTINGS } from './constants/framer-motion.js';
25
+ export { ALL_TOOLS, COMPARE_PAGES, HIDE_BACKGROUND_SEGMENTS } from './constants/layout.js';
26
+ export { LOCALHOST_GEO_DATA, LOCALHOST_IP } from './constants/localhost.js';
27
+ export { DEFAULT_REDIRECTS, DUB_HEADERS } from './constants/middleware.js';
28
+ export { DEFAULT_LINK_PROPS, GOOGLE_FAVICON_URL, PAGINATION_LIMIT } from './constants/misc.js';
29
+ export { SAML_PROVIDERS } from './constants/saml.js';
30
+ import 'clsx';
31
+ import 'next';
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{A as p,B as J,C as q,D as V,E as G,F as X,a as c,b as L,c as R,d as k,e as v,f as A,g as O,h as E,i as T,j as $,k as l,l as N,m as P,n as C,o as F,p as I,q as z,r as K,s as B,t as j,u as H,v as Y,w as Z,x as u,y as W,z as g}from"./chunk-MK4UFVOH.mjs";import{a as i}from"./chunk-MODISIUH.mjs";import{a as _}from"./chunk-3P54C65P.mjs";import h from"@sindresorhus/slugify";import{clsx as d}from"clsx";import y from"ms";import{customAlphabet as x}from"nanoid";import{twMerge as D}from"tailwind-merge";function se(...e){return D(d(e))}function ae({title:e=`${process.env.NEXT_PUBLIC_APP_NAME} - Link Management for Modern Marketing Teams`,description:t=`${process.env.NEXT_PUBLIC_APP_NAME} is the open-source link management infrastructure for modern marketing teams to create, share, and track short links.`,image:n="https://dub.co/_static/thumbnail.png",icons:o=[{rel:"apple-touch-icon",sizes:"32x32",url:"/apple-touch-icon.png"},{rel:"icon",type:"image/png",sizes:"32x32",url:"/favicon-32x32.png"},{rel:"icon",type:"image/png",sizes:"16x16",url:"/favicon-16x16.png"}],noIndex:r=!1}={}){return{title:e,description:t,openGraph:{title:e,description:t,images:[{url:n}]},twitter:{card:"summary_large_image",title:e,description:t,images:[n],creator:"@dubdotco"},icons:o,metadataBase:new URL(l),...r&&{robots:{index:!1,follow:!1}}}}var ie=x("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);async function ce(e,t){let n=await fetch(e,t);if(!n.ok){let o=await n.text(),r=new Error(o);throw r.status=n.status,r}return n.json()}function le(e,t={digits:1}){if(!e)return"0";if(t.full)return Intl.NumberFormat("en-US").format(e);let n=[{value:1,symbol:""},{value:1e3,symbol:"K"},{value:1e6,symbol:"M"},{value:1e9,symbol:"G"},{value:1e12,symbol:"T"},{value:1e15,symbol:"P"},{value:1e18,symbol:"E"}],o=/\.0+$|(\.[0-9]*[1-9])0+$/;var r=n.slice().reverse().find(function(s){return e>=s.value});return r?(e/r.value).toFixed(t.digits).replace(o,"$1")+r.symbol:"0"}function ue(e){return!e||typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}var ge=(e,t)=>e.reduce((n,o,r)=>{let s=Math.floor(r/t);return n[s]||(n[s]=[]),n[s].push(o),n},[]);function pe({domain:e="dub.sh",key:t,localhost:n,pretty:o,noDomain:r}){let s=`${n?"http://home.localhost:8888":`https://${e}`}${t&&t!=="_root"?`/${t}`:""}`;return r?`/${t}`:o?s.replace(/^https?:\/\//,""):s}var me=(e,{withAgo:t}={})=>{if(!e)return"Never";let n=Date.now()-new Date(e).getTime();return n<1e3?"Just now":n>828e5?new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:new Date(e).getFullYear()!==new Date().getFullYear()?"numeric":void 0}):`${y(n)}${t?" ago":""}`},fe=e=>{let t=e?new Date(e):new Date;return t.toString()==="Invalid Date"?"":new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().split(":").slice(0,2).join(":")},he=e=>new Date(`${e}T00:00:00Z`).toLocaleDateString("en-US",{day:"numeric",month:"long",year:"numeric",timeZone:"UTC"}),de=e=>{let t=new Date,n=t.getDate(),o=t.getMonth(),r=t.getFullYear();if(n>=e)return{firstDay:new Date(r,o,e),lastDay:new Date(r,o+1,e-1)};{let s=o===0?r-1:r,a=o===0?11:o-1;return{firstDay:new Date(s,a,e),lastDay:new Date(r,o,e-1)}}},w=()=>{let e=new Date;return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()},b=e=>{let t=w();return e>t?t:e},ye=e=>{let t=new Date,n=t.getDate(),o=t.getMonth(),r=t.getFullYear(),s=b(e);if(n<=s){let a=o===0?11:o-1,f=o===0?r-1:r;return new Date(f,a,s)}else return new Date(r,o,s)},xe=e=>c.find(t=>{var n;return(n=t.price.ids)==null?void 0:n.includes(e)})||null,De=e=>{let t=h(e,{separator:""});if(t.length<3)return"";if(i.has(t.slice(-2)))return`${t.slice(0,-2)}.${t.slice(-2)}`;let n=t.replace(/[aeiou]/g,"");return n.length>=3&&i.has(n.slice(-2))?`${n.slice(0,-2)}.${n.slice(-2)}`:`${[t,n].reduce((r,s)=>r.length<s.length?r:s)}.to`},we=new RegExp(/^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/),be=new RegExp(/^[0-9A-Za-z\u0080-\uFFFF\/\-]*$/u),Se=new RegExp(/^[a-zA-Z0-9\-]+$/),Ue=(e,t)=>e===t?null:e.slice(0,e.length-t.length-1),Me=e=>{let t;try{t=new URL(e.replace(/^[a-zA-Z]+:\/\//,"https://")).hostname}catch{return""}if(t==="youtu.be")return"youtube.com";if(t==="raw.githubusercontent.com")return"github.com";if(t.endsWith(".vercel.app"))return"vercel.app";let n=t.split(".");return n.length>2?g.has(n[n.length-2])&&i.has(n[n.length-1])||p.has(n.slice(-2).join("."))?n.slice(-3).join("."):n.slice(-2).join("."):t},m=e=>{try{return new URL(e),!0}catch{return!1}},_e=e=>{if(m(e))return new URL(e).toString();try{if(e.includes(".")&&!e.includes(" "))return new URL(`https://${e}`).toString()}catch{return null}},Le=e=>{if(m(e))return new URL(e).hostname.replace(/^www\./,"");try{if(e.includes(".")&&!e.includes(" "))return new URL(`https://${e}`).hostname.replace(/^www\./,"")}catch{return null}},Re=e=>u.some(t=>t.slug===e),ke=e=>{let t={};return new URL(e).searchParams.forEach(function(n,o){t[o]=n}),t},ve=(e,t)=>!e||e.length<=t?e:`${e.slice(0,t-3)}...`,Ae=e=>{if(!e)return{};try{let t=new URL(e).searchParams,n={};for(let[o,r]of t.entries())r&&r!==""&&(n[o]=r);return n}catch{return{}}},Oe=(e,t)=>{if(!e)return"";try{let n=new URL(e);for(let[o,r]of Object.entries(t))r===""?n.searchParams.delete(o):n.searchParams.set(o,r);return n.toString()}catch{return""}},S=[{display:"Referral (ref)",key:"ref",examples:"twitter, facebook"},{display:"UTM Source",key:"utm_source",examples:"twitter, facebook"},{display:"UTM Medium",key:"utm_medium",examples:"social, email"},{display:"UTM Campaign",key:"utm_campaign",examples:"summer_sale"},{display:"UTM Term",key:"utm_term",examples:"blue_shoes"},{display:"UTM Content",key:"utm_content",examples:"logolink"}],Ee=e=>{try{let t=new URL(e);return S.forEach(n=>t.searchParams.delete(n.key)),t.toString()}catch{return e}};async function Te(e){let n=new TextEncoder().encode(e),o=await crypto.subtle.digest("MD5",n);return Array.from(new Uint8Array(o)).map(a=>a.toString(16).padStart(2,"0")).join("")}var U={cron:process.env.DUB_SLACK_HOOK_CRON,links:process.env.DUB_SLACK_HOOK_LINKS},$e=async({message:e,type:t,mention:n=!1})=>{(process.env.NODE_ENV==="development"||!process.env.DUB_SLACK_HOOK_CRON||!process.env.DUB_SLACK_HOOK_LINKS)&&console.log(e);let o=U[t];if(!!o)try{return await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({blocks:[{type:"section",text:{type:"mrkdwn",text:`${n?"<@U0404G6J3NJ> ":""}${e}`}}]})})}catch(r){console.log(`Failed to log to Dub Slack. Error: ${r}`)}},M=(e,t)=>{if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let r of n)if(!o.includes(r)||!M(e[r],t[r]))return!1;return!0};export{z as ADMIN_HOSTNAMES,W as ALL_TOOLS,I as API_DOMAIN,F as API_HOSTNAMES,P as APP_DOMAIN,C as APP_DOMAIN_WITH_NGROK,N as APP_HOSTNAMES,_ as COUNTRIES,J as DEFAULT_LINK_PROPS,K as DEFAULT_REDIRECTS,u as DUB_DOMAINS,B as DUB_HEADERS,H as DUB_LOGO,q as DUB_PROJECT_ID,Y as DUB_THUMBNAIL,E as FADE_IN_ANIMATION_SETTINGS,v as FRAMER_MOTION_LIST_ITEM_VARIANTS,j as GOOGLE_FAVICON_URL,Z as HIDE_BACKGROUND_SEGMENTS,l as HOME_DOMAIN,V as LEGAL_PROJECT_ID,G as LEGAL_USER_ID,R as LOCALHOST_GEO_DATA,k as LOCALHOST_IP,T as PAGINATION_LIMIT,c as PLANS,X as SAML_PROVIDERS,g as SECOND_LEVEL_DOMAINS,L as SELF_SERVE_PAID_PLANS,$ as SHORT_DOMAIN,p as SPECIAL_APEX_DOMAINS,A as STAGGER_CHILD_VARIANTS,O as SWIPE_REVEAL_ANIMATION_SETTINGS,ue as capitalize,i as ccTLDs,ge as chunk,se as cn,ae as constructMetadata,Oe as constructURLFromUTMParams,M as deepEqual,ce as fetcher,he as formatDate,De as generateDomainFromName,Te as generateMD5Hash,b as getAdjustedBillingCycleStart,Me as getApexDomain,ye as getBillingStartDate,fe as getDateTimeLocal,Le as getDomainWithoutWWW,de as getFirstAndLastDay,w as getLastDayOfMonth,Ae as getParamsFromURL,xe as getPlanFromPriceId,ke as getSearchParams,Ue as getSubdomain,_e as getUrlFromString,Ee as getUrlWithoutUTMParams,Re as isDubDomain,m as isValidUrl,pe as linkConstructor,$e as log,le as nFormatter,ie as nanoid,S as paramsMetadata,me as timeAgo,ve as truncate,we as validDomainRegex,be as validKeyRegex,Se as validSlugRegex};
1
+ import"./chunk-SPSUTBZ7.mjs";import{a as lo}from"./chunk-PEPVOMPB.mjs";import{a as no}from"./chunk-6Q2MCPZP.mjs";import{a as qo}from"./chunk-OWYWG4M6.mjs";import{a as so}from"./chunk-I5Y5DKPK.mjs";import{a as uo}from"./chunk-MPU6JRPV.mjs";import{a as vo}from"./chunk-ZJKRLIJQ.mjs";import{a as X}from"./chunk-ZECUYKGD.mjs";import{a as fo,b as mo,c as po,d as to,e as xo,f as ao,g as bo,h as co}from"./chunk-VEUP2DC6.mjs";import{a as Y,b as Z,c as _,d as $,e as oo,f as ro,g as eo}from"./chunk-UUWTKITJ.mjs";import{a as go}from"./chunk-EMO4MGOU.mjs";import{a as ho}from"./chunk-6XPTKHZD.mjs";import{a as io}from"./chunk-XWSEDYR7.mjs";import{a as jo}from"./chunk-3BUV2ANI.mjs";import{a as ko}from"./chunk-5PD4TPH7.mjs";import{a as N}from"./chunk-GTQBILTE.mjs";import{a as O}from"./chunk-2OJAP233.mjs";import{a as P}from"./chunk-NEIHTFSW.mjs";import{a as Q}from"./chunk-2TURBZEL.mjs";import{a as R,b as S,c as T,d as U,e as V,f as W}from"./chunk-LXJVNY3R.mjs";import{a as n,b as q,c as s,d as u,e as w,f as y,g as z,h as A,i as B,j as C,k as D,l as E,m as F,n as G,o as H,p as I,q as J,r as K,s as L,t as M}from"./chunk-VTLX43W7.mjs";import{a as h,b as i}from"./chunk-5VUO5P2B.mjs";import{a as j,b as k,c as l}from"./chunk-5FPTMLJS.mjs";import{a as v}from"./chunk-PUFZASP4.mjs";import{a as o}from"./chunk-YUMUNL66.mjs";import{a as r}from"./chunk-2RCZ6Q6L.mjs";import{a as e,b as f}from"./chunk-SYT2IXG6.mjs";import{a as m,b as p,c as t,d as x}from"./chunk-2SICE2ZS.mjs";import{a,b,c}from"./chunk-WE5LUVZO.mjs";import{a as d,b as g}from"./chunk-FYXE2IZT.mjs";export{F as ADMIN_HOSTNAMES,b as ALL_TOOLS,E as API_DOMAIN,D as API_HOSTNAMES,B as APP_DOMAIN,C as APP_DOMAIN_WITH_NGROK,A as APP_HOSTNAMES,w as APP_NAME,c as COMPARE_PAGES,r as COUNTRIES,j as DEFAULT_LINK_PROPS,h as DEFAULT_REDIRECTS,I as DEMO_LINK_ID,M as DUB_DOMAINS,i as DUB_HEADERS,G as DUB_LOGO,J as DUB_PROJECT_ID,H as DUB_THUMBNAIL,x as FADE_IN_ANIMATION_SETTINGS,m as FRAMER_MOTION_LIST_ITEM_VARIANTS,q as FREE_PLAN,u as FREE_PROJECTS_LIMIT,k as GOOGLE_FAVICON_URL,a as HIDE_BACKGROUND_SEGMENTS,z as HOME_DOMAIN,K as LEGAL_PROJECT_ID,L as LEGAL_USER_ID,d as LOCALHOST_GEO_DATA,g as LOCALHOST_IP,l as PAGINATION_LIMIT,n as PLANS,v as SAML_PROVIDERS,e as SECOND_LEVEL_DOMAINS,s as SELF_SERVE_PAID_PLANS,y as SHORT_DOMAIN,f as SPECIAL_APEX_DOMAINS,p as STAGGER_CHILD_VARIANTS,t as SWIPE_REVEAL_ANIMATION_SETTINGS,N as capitalize,o as ccTLDs,O as chunk,P as cn,Q as constructMetadata,oo as constructURLFromUTMParams,X as deepEqual,go as fetchWithTimeout,ho as fetcher,S as formatDate,fo as generateDomainFromName,io as generateMD5Hash,V as getAdjustedBillingCycleStart,ao as getApexDomain,W as getBillingStartDate,R as getDateTimeLocal,bo as getDomainWithoutWWW,T as getFirstAndLastDay,U as getLastDayOfMonth,$ as getParamsFromURL,no as getPlanFromPriceId,_ as getSearchParams,xo as getSubdomain,Z as getUrlFromString,eo as getUrlWithoutUTMParams,co as isDubDomain,jo as isIframeable,Y as isValidUrl,ko as linkConstructor,lo as log,so as nFormatter,qo as nanoid,ro as paramsMetadata,uo as timeAgo,vo as truncate,mo as validDomainRegex,po as validKeyRegex,to as validSlugRegex};
@@ -0,0 +1,6 @@
1
+ declare const isIframeable: ({ url, requestDomain, }: {
2
+ url: string;
3
+ requestDomain: string;
4
+ }) => Promise<boolean>;
5
+
6
+ export { isIframeable as i };
@@ -0,0 +1,6 @@
1
+ declare const urlToDeeplink: ({ url, os, }: {
2
+ url: string;
3
+ os: "ios" | "android";
4
+ }) => string;
5
+
6
+ export { urlToDeeplink as u };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dub/utils",
3
3
  "description": "Utility functions and constants for Dub.co",
4
- "version": "0.0.27",
4
+ "version": "0.0.29",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -31,10 +31,10 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@sindresorhus/slugify": "^2.2.1",
34
- "clsx": "^1.2.1",
34
+ "clsx": "^2.1.0",
35
35
  "ms": "^2.1.3",
36
36
  "nanoid": "^5.0.1",
37
- "tailwind-merge": "^1.13.2"
37
+ "tailwind-merge": "^2.2.1"
38
38
  },
39
39
  "author": "Steven Tey <stevensteel97@gmail.com>",
40
40
  "homepage": "https://dub.co",