@dub/utils 0.0.27 → 0.0.28
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.
- package/dist/chunk-2DN4J7N7.mjs +1 -0
- package/dist/chunk-2J47GIUG.mjs +1 -0
- package/dist/chunk-2OJAP233.mjs +1 -0
- package/dist/chunk-34MPJURK.mjs +1 -0
- package/dist/chunk-3B5DP3T4.mjs +1 -0
- package/dist/chunk-3BUV2ANI.mjs +1 -0
- package/dist/chunk-3PRW7SAO.mjs +1 -0
- package/dist/chunk-4BN7BHOL.mjs +1 -0
- package/dist/chunk-5PD4TPH7.mjs +1 -0
- package/dist/chunk-5SU2MWLU.mjs +0 -0
- package/dist/chunk-6N3NW2JB.mjs +1 -0
- package/dist/chunk-6TFUDH7S.mjs +1 -0
- package/dist/chunk-6XPTKHZD.mjs +1 -0
- package/dist/chunk-7CR3I247.mjs +1 -0
- package/dist/chunk-7OQSL4CI.mjs +2 -0
- package/dist/chunk-AI2STCLX.mjs +1 -0
- package/dist/chunk-BE3FE22D.mjs +1 -0
- package/dist/chunk-BMMTE4CL.mjs +1 -0
- package/dist/chunk-BQ3MQSVS.mjs +1 -0
- package/dist/chunk-C7CFYTBV.mjs +1 -0
- package/dist/chunk-DHOWTHOI.mjs +3 -0
- package/dist/chunk-EMO4MGOU.mjs +1 -0
- package/dist/chunk-F6C3QYRM.mjs +1 -0
- package/dist/chunk-FCP5HRN4.mjs +1 -0
- package/dist/chunk-FLUV3ASQ.mjs +1 -0
- package/dist/chunk-GQLUSHIW.mjs +1 -0
- package/dist/chunk-GTQBILTE.mjs +1 -0
- package/dist/chunk-HX6TVXHR.mjs +1 -0
- package/dist/chunk-I5Y5DKPK.mjs +1 -0
- package/dist/chunk-IGSNFZ4Y.mjs +1 -0
- package/dist/chunk-J6V4PKNC.mjs +1 -0
- package/dist/chunk-KL7VCF4Y.mjs +1 -0
- package/dist/chunk-L2SFRDQT.mjs +1 -0
- package/dist/chunk-L7JSRS6V.mjs +1 -0
- package/dist/chunk-LXJVNY3R.mjs +1 -0
- package/dist/chunk-MPU6JRPV.mjs +1 -0
- package/dist/chunk-MT3GLHZG.mjs +1 -0
- package/dist/chunk-NEIHTFSW.mjs +1 -0
- package/dist/chunk-OANHZJ6X.mjs +1 -0
- package/dist/chunk-OSU5S2YT.mjs +3 -0
- package/dist/chunk-PEPVOMPB.mjs +1 -0
- package/dist/chunk-QQFYILG6.mjs +1 -0
- package/dist/chunk-QYPFWXDY.mjs +1 -0
- package/dist/chunk-SKVYWWBC.mjs +3 -0
- package/dist/chunk-SPSUTBZ7.mjs +0 -0
- package/dist/chunk-TXEDXHC5.mjs +1 -0
- package/dist/chunk-UBCCNLBS.mjs +1 -0
- package/dist/chunk-UUWTKITJ.mjs +1 -0
- package/dist/chunk-VZYPOBKB.mjs +1 -0
- package/dist/chunk-W5LUKKPM.mjs +1 -0
- package/dist/chunk-WCUHRXGZ.mjs +1 -0
- package/dist/chunk-XWSEDYR7.mjs +1 -0
- package/dist/chunk-YUMUNL66.mjs +1 -0
- package/dist/chunk-YXHGPHL2.mjs +1 -0
- package/dist/chunk-YY4NGU5S.mjs +1 -0
- package/dist/chunk-ZBBENF7Y.mjs +1 -0
- package/dist/chunk-ZECUYKGD.mjs +1 -0
- package/dist/chunk-ZJKRLIJQ.mjs +1 -0
- package/dist/constants/cctlds.d.ts +1 -1
- package/dist/constants/cctlds.mjs +1 -1
- package/dist/constants/countries.d.ts +1 -1
- package/dist/constants/countries.mjs +1 -1
- package/dist/constants/index.d.ts +119 -6
- package/dist/constants/index.mjs +1 -1
- package/dist/functions/capitalize.d.ts +3 -0
- package/dist/functions/capitalize.mjs +1 -0
- package/dist/functions/chunk.d.ts +3 -0
- package/dist/functions/chunk.mjs +1 -0
- package/dist/functions/cn.d.ts +5 -0
- package/dist/functions/cn.mjs +1 -0
- package/dist/functions/construct-metadata.d.ts +11 -0
- package/dist/functions/construct-metadata.mjs +1 -0
- package/dist/functions/datetime.d.ts +11 -0
- package/dist/functions/datetime.mjs +1 -0
- package/dist/functions/deep-equal.d.ts +4 -0
- package/dist/functions/deep-equal.mjs +1 -0
- package/dist/functions/domains.d.ts +10 -0
- package/dist/functions/domains.mjs +1 -0
- package/dist/functions/fetch-with-timeout.d.ts +3 -0
- package/dist/functions/fetch-with-timeout.mjs +1 -0
- package/dist/functions/fetcher.d.ts +3 -0
- package/dist/functions/fetcher.mjs +1 -0
- package/dist/functions/hash.d.ts +3 -0
- package/dist/functions/hash.mjs +1 -0
- package/dist/functions/index.d.ts +21 -0
- package/dist/functions/index.mjs +1 -0
- package/dist/functions/is-iframeable.d.ts +6 -0
- package/dist/functions/is-iframeable.mjs +1 -0
- package/dist/functions/link-constructor.d.ts +9 -0
- package/dist/functions/link-constructor.mjs +1 -0
- package/dist/functions/log.d.ts +7 -0
- package/dist/functions/log.mjs +1 -0
- package/dist/functions/misc.d.ts +112 -0
- package/dist/functions/misc.mjs +1 -0
- package/dist/functions/nanoid.d.ts +3 -0
- package/dist/functions/nanoid.mjs +1 -0
- package/dist/functions/nformatter.d.ts +6 -0
- package/dist/functions/nformatter.mjs +1 -0
- package/dist/functions/time-ago.d.ts +5 -0
- package/dist/functions/time-ago.mjs +1 -0
- package/dist/functions/truncate.d.ts +3 -0
- package/dist/functions/truncate.mjs +1 -0
- package/dist/functions/urls.d.ts +13 -0
- package/dist/functions/urls.mjs +1 -0
- package/dist/index.d.ts +24 -181
- package/dist/index.mjs +1 -1
- package/dist/is-iframeable-4cf55b9f.d.ts +6 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,181 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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, 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, FREE_PLAN, FREE_PROJECTS_LIMIT, 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';
|
|
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
|
+
import 'clsx';
|
|
24
|
+
import 'next';
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import"./chunk-SPSUTBZ7.mjs";import{a as ho}from"./chunk-5PD4TPH7.mjs";import{a as io}from"./chunk-PEPVOMPB.mjs";import{a as jo}from"./chunk-FLUV3ASQ.mjs";import{a as ko}from"./chunk-KL7VCF4Y.mjs";import{a as lo}from"./chunk-I5Y5DKPK.mjs";import{a as no}from"./chunk-MPU6JRPV.mjs";import{a as qo}from"./chunk-ZJKRLIJQ.mjs";import{a as O,b as P,c as Q,d as R,e as S,f as T}from"./chunk-LXJVNY3R.mjs";import{a as U}from"./chunk-ZECUYKGD.mjs";import{a as oo,b as ro,c as eo,d as fo,e as mo,f as po,g as to,h as xo}from"./chunk-J6V4PKNC.mjs";import{a as V,b as W,c as X,d as Y,e as Z,f as _,g as $}from"./chunk-UUWTKITJ.mjs";import{a as ao}from"./chunk-EMO4MGOU.mjs";import{a as bo}from"./chunk-6XPTKHZD.mjs";import{a as co}from"./chunk-XWSEDYR7.mjs";import{a as go}from"./chunk-3BUV2ANI.mjs";import{a as K}from"./chunk-GTQBILTE.mjs";import{a as L}from"./chunk-2OJAP233.mjs";import{a as M}from"./chunk-NEIHTFSW.mjs";import{a as N}from"./chunk-C7CFYTBV.mjs";import{A as C,B as D,C as E,D as F,E as G,F as H,G as I,H as J,a as e,b as f,c as m,d as p,e as t,f as x,g as a,h as b,i as c,j as d,k as g,l as h,m as i,n as j,o as k,p as l,q as n,r as q,s,t as u,u as v,v as w,w as y,x as z,y as A,z as B}from"./chunk-F6C3QYRM.mjs";import{a as o}from"./chunk-YUMUNL66.mjs";import{a as r}from"./chunk-UBCCNLBS.mjs";export{s as ADMIN_HOSTNAMES,F as ALL_TOOLS,q as API_DOMAIN,n as API_HOSTNAMES,k as APP_DOMAIN,l as APP_DOMAIN_WITH_NGROK,j as APP_HOSTNAMES,r as COUNTRIES,I as DEFAULT_LINK_PROPS,u as DEFAULT_REDIRECTS,E as DUB_DOMAINS,v as DUB_HEADERS,y as DUB_LOGO,A as DUB_PROJECT_ID,z as DUB_THUMBNAIL,d as FADE_IN_ANIMATION_SETTINGS,a as FRAMER_MOTION_LIST_ITEM_VARIANTS,f as FREE_PLAN,p as FREE_PROJECTS_LIMIT,w as GOOGLE_FAVICON_URL,D as HIDE_BACKGROUND_SEGMENTS,i as HOME_DOMAIN,B as LEGAL_PROJECT_ID,C as LEGAL_USER_ID,t as LOCALHOST_GEO_DATA,x as LOCALHOST_IP,g as PAGINATION_LIMIT,e as PLANS,J as SAML_PROVIDERS,G as SECOND_LEVEL_DOMAINS,m as SELF_SERVE_PAID_PLANS,h as SHORT_DOMAIN,H as SPECIAL_APEX_DOMAINS,b as STAGGER_CHILD_VARIANTS,c as SWIPE_REVEAL_ANIMATION_SETTINGS,K as capitalize,o as ccTLDs,L as chunk,M as cn,N as constructMetadata,Z as constructURLFromUTMParams,U as deepEqual,ao as fetchWithTimeout,bo as fetcher,P as formatDate,oo as generateDomainFromName,co as generateMD5Hash,S as getAdjustedBillingCycleStart,po as getApexDomain,T as getBillingStartDate,O as getDateTimeLocal,to as getDomainWithoutWWW,Q as getFirstAndLastDay,R as getLastDayOfMonth,Y as getParamsFromURL,jo as getPlanFromPriceId,X as getSearchParams,mo as getSubdomain,W as getUrlFromString,$ as getUrlWithoutUTMParams,xo as isDubDomain,go as isIframeable,V as isValidUrl,ho as linkConstructor,io as log,lo as nFormatter,ko as nanoid,_ as paramsMetadata,no as timeAgo,qo as truncate,ro as validDomainRegex,eo as validKeyRegex,fo as validSlugRegex};
|