@bikiran/utils 2.0.2 → 2.0.4
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/LICENSE +21 -21
- package/README.md +168 -168
- package/dist/components/Profile/authTypes.ts +21 -21
- package/dist/components/Profile/style/LoginBtn.module.css +6 -6
- package/dist/components/Profile/style/ProfileManage.module.css +6 -6
- package/dist/components/Profile/style/ProfileMenuList.module.css +50 -50
- package/dist/components/Profile/style/ProfileMenuPopup.module.css +30 -30
- package/dist/components/Profile/style/ProfileUserInformation.module.css +26 -26
- package/dist/components/Profile/style/ProfileView.module.css +12 -12
- package/dist/components/button-wrapper/style/style.module.css +18 -18
- package/dist/components/cookie-accept-popup/style/CookieAcceptPopup.module.css +12 -12
- package/dist/components/copy-wrapper/CopyWrapper.js +5 -1
- package/dist/components/currency-selector/style/CurrencySelector.module.css +28 -28
- package/dist/components/custom-sidebar/style/CustomSidebar.module.css +21 -21
- package/dist/components/filter-wrapper/style/FilterBarWrapper.module.css +41 -41
- package/dist/components/header/header.css +61 -61
- package/dist/components/header/headerType.ts +15 -15
- package/dist/components/header/icons/icon-about-us-submenu.svg +6 -6
- package/dist/components/header/icons/icon-about-us.svg +5 -5
- package/dist/components/header/icons/icon-all-service.svg +11 -11
- package/dist/components/header/icons/icon-arrow-v2.svg +3 -3
- package/dist/components/header/icons/icon-bell-fill.svg +3 -3
- package/dist/components/header/icons/icon-bik-logo.svg +13 -13
- package/dist/components/header/icons/icon-contacts.svg +6 -6
- package/dist/components/header/icons/icon-domain.svg +4 -4
- package/dist/components/header/icons/icon-hosting.svg +5 -5
- package/dist/components/header/icons/icon-our-clients.svg +4 -4
- package/dist/components/header/sidebar/SidebarConstants.ts +55 -55
- package/dist/components/header/sidebar/sidebarStyle.css +32 -32
- package/dist/components/information-tooltip/icons.js +4 -4
- package/dist/components/information-tooltip/style/InfoTooltip.module.css +62 -62
- package/dist/components/loading-comp/style/LoadingComp.module.css +3 -3
- package/dist/components/pageLoading/style/PageLoading.module.css +7 -7
- package/dist/components/pagination2/style/Pagination.module.css +27 -27
- package/dist/components/project-selector/projectConstants.ts +23 -23
- package/dist/components/project-selector/projectTypes.ts +22 -22
- package/dist/components/project-selector/selector-icons/icon-arrow-down.svg +3 -3
- package/dist/components/project-selector/selector-icons/icon-default-app.svg +9 -9
- package/dist/components/services-popup/ServiceAppType.ts +10 -10
- package/dist/components/services-popup/icons/icon-account.svg +7 -7
- package/dist/components/services-popup/icons/icon-cross.svg +3 -3
- package/dist/components/services-popup/icons/icon-default-app.svg +9 -9
- package/dist/components/user-info/style/ToolTipUserInfo.module.css +28 -28
- package/dist/declaration.d.ts +9 -9
- package/dist/index.ts +15 -15
- package/dist/lib/types/GlobalType.ts +17 -17
- package/dist/lib/utils/Cookie.ts +58 -58
- package/dist/lib/utils/Copy.ts +37 -37
- package/dist/lib/utils/Env.ts +235 -235
- package/dist/lib/utils/capitalizeFirstLetter.ts +7 -7
- package/dist/lib/utils/cn.ts +4 -4
- package/dist/lib/utils/option.ts +7 -7
- package/dist/package.json +1 -1
- package/package.json +60 -60
package/dist/lib/utils/Env.ts
CHANGED
|
@@ -1,236 +1,236 @@
|
|
|
1
|
-
export const SUB_DOMAIN_NAMES = {
|
|
2
|
-
WWW: "www",
|
|
3
|
-
ACCOUNT: "account",
|
|
4
|
-
DOMAIN: "domain",
|
|
5
|
-
ADMANAGE: "admanage",
|
|
6
|
-
DNS: "dns",
|
|
7
|
-
HOSTING: "hosting",
|
|
8
|
-
APPOCEAN: "appocean",
|
|
9
|
-
DOCS: "docs",
|
|
10
|
-
PROBACKUP: "probackup",
|
|
11
|
-
EDUSOFT: "edusoft",
|
|
12
|
-
SUPPORT: "support",
|
|
13
|
-
ICON: "icon",
|
|
14
|
-
DRIVE: "drive",
|
|
15
|
-
API: "io",
|
|
16
|
-
API2: "api2",
|
|
17
|
-
API3: "api3",
|
|
18
|
-
} as const;
|
|
19
|
-
|
|
20
|
-
const subDomainMap: Record<string, string> = {
|
|
21
|
-
www: `http://localhost:7201`,
|
|
22
|
-
account: `http://localhost:5000`,
|
|
23
|
-
domain: `http://localhost:7203`,
|
|
24
|
-
dns: `http://localhost:7204`,
|
|
25
|
-
hosting: `http://localhost:7205`,
|
|
26
|
-
appocean: `http://localhost:7206`,
|
|
27
|
-
docs: `http://localhost:7207`,
|
|
28
|
-
admanage: `http://localhost:7208`,
|
|
29
|
-
probackup: `http://localhost:7209`,
|
|
30
|
-
edusoft: `http://localhost:7210`,
|
|
31
|
-
icon: `http://localhost:7211`,
|
|
32
|
-
drive: `http://localhost:7212`,
|
|
33
|
-
support: `http://localhost:7216`,
|
|
34
|
-
api: `https://io.bikiran.win`,
|
|
35
|
-
api2:
|
|
36
|
-
process.env.NEXT_PUBLIC_LOCAL_API === "true"
|
|
37
|
-
? `http://localhost:5010`
|
|
38
|
-
: `https://api2.bikiran.win`,
|
|
39
|
-
api3:
|
|
40
|
-
process.env.NEXT_PUBLIC_LOCAL_API === "true"
|
|
41
|
-
? `http://localhost:7301`
|
|
42
|
-
: `https://api3.bikiran.win`,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const isDev = process.env.NEXT_PUBLIC_MODE === "dev";
|
|
46
|
-
export function getMode(): "dev" | "win" | "com" {
|
|
47
|
-
if (isDev) {
|
|
48
|
-
return "dev";
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const isWin = process.env.NEXT_PUBLIC_MODE === "win";
|
|
52
|
-
if (isWin) {
|
|
53
|
-
return "win";
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return "com";
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const getDomain = (): string => {
|
|
60
|
-
return process.env.NEXT_PUBLIC_DOMAIN || "";
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
interface DomainObject {
|
|
64
|
-
sub: string;
|
|
65
|
-
name: string;
|
|
66
|
-
tld: string;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const getDomainObject = (): DomainObject => {
|
|
70
|
-
const domainParts = getDomain().split(".");
|
|
71
|
-
return {
|
|
72
|
-
sub: domainParts[0],
|
|
73
|
-
name: domainParts[1],
|
|
74
|
-
tld: domainParts[2],
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export const getBaseDomain = (): string => {
|
|
79
|
-
const mode = getMode();
|
|
80
|
-
if (mode === "dev") {
|
|
81
|
-
return "localhost";
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const d = getDomainObject();
|
|
85
|
-
return `${d.name}.${mode}`;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// https://www.bikiran.com/
|
|
89
|
-
export function getBikiranUrl(): string {
|
|
90
|
-
const d = getDomainObject();
|
|
91
|
-
const mode = getMode();
|
|
92
|
-
if (mode === "dev") {
|
|
93
|
-
return subDomainMap.www;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return `https://${SUB_DOMAIN_NAMES.WWW}.${d.name}.${mode}`;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// https://www.hosting.bikiran.com/
|
|
100
|
-
export function getHostingUrl(): string {
|
|
101
|
-
const d = getDomainObject();
|
|
102
|
-
const mode = getMode();
|
|
103
|
-
if (mode === "dev") {
|
|
104
|
-
return subDomainMap.hosting;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return `https://${SUB_DOMAIN_NAMES.HOSTING}.${d.name}.${mode}`;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// https://www.domain.bikiran.com/
|
|
111
|
-
export function getDomainUrl(): string {
|
|
112
|
-
const d = getDomainObject();
|
|
113
|
-
const mode = getMode();
|
|
114
|
-
if (mode === "dev") {
|
|
115
|
-
return subDomainMap.domain;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
return `https://${SUB_DOMAIN_NAMES.DOMAIN}.${d.name}.${mode}`;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// https://www.appocean.bikiran.com/
|
|
122
|
-
export function getAppoceanUrl(): string {
|
|
123
|
-
const d = getDomainObject();
|
|
124
|
-
const mode = getMode();
|
|
125
|
-
if (mode === "dev") {
|
|
126
|
-
return subDomainMap.appocean;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return `https://${SUB_DOMAIN_NAMES.APPOCEAN}.${d.name}.${mode}`;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// https://www.admanage.bikiran.com/
|
|
133
|
-
export function getAdManageUrl(): string {
|
|
134
|
-
const d = getDomainObject();
|
|
135
|
-
const mode = getMode();
|
|
136
|
-
if (mode === "dev") {
|
|
137
|
-
return subDomainMap.admanage;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return `https://${SUB_DOMAIN_NAMES.ADMANAGE}.${d.name}.${mode}`;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// https://www.support.bikiran.com/
|
|
144
|
-
export function getSupportUrl(): string {
|
|
145
|
-
const d = getDomainObject();
|
|
146
|
-
const mode = getMode();
|
|
147
|
-
if (mode === "dev") {
|
|
148
|
-
return subDomainMap.support;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
return `https://${SUB_DOMAIN_NAMES.SUPPORT}.${d.name}.${mode}`;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export function getSiteUrl(): string {
|
|
155
|
-
const d = getDomainObject();
|
|
156
|
-
const mode = getMode();
|
|
157
|
-
if (mode === "dev") {
|
|
158
|
-
return subDomainMap[d.sub];
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
return `https://${d.sub}.${d.name}.${mode}`;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export function getApiUrl(): string {
|
|
165
|
-
const d = getDomainObject();
|
|
166
|
-
const mode = getMode();
|
|
167
|
-
if (mode === "dev") {
|
|
168
|
-
return subDomainMap.api;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return `https://${SUB_DOMAIN_NAMES.API}.${d.name}.${mode}`;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export function getApi2Url(): string {
|
|
175
|
-
const d = getDomainObject();
|
|
176
|
-
const mode = getMode();
|
|
177
|
-
if (mode === "dev") {
|
|
178
|
-
return subDomainMap.api2;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return `https://${SUB_DOMAIN_NAMES.API2}.${d.name}.${mode}`;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export function getApi3Url(): string {
|
|
185
|
-
const d = getDomainObject();
|
|
186
|
-
const mode = getMode();
|
|
187
|
-
if (mode === "dev") {
|
|
188
|
-
return subDomainMap.api3;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
return `https://${SUB_DOMAIN_NAMES.API3}.${d.name}.${mode}`;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export function getAccountUrl(): string {
|
|
195
|
-
const d = getDomainObject();
|
|
196
|
-
const mode = getMode();
|
|
197
|
-
if (mode === "dev") {
|
|
198
|
-
return subDomainMap.account;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return `https://${SUB_DOMAIN_NAMES.ACCOUNT}.${d.name}.${mode}`;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
export function getDocsUrl(): string {
|
|
205
|
-
const d = getDomainObject();
|
|
206
|
-
const mode = getMode();
|
|
207
|
-
if (mode === "dev") {
|
|
208
|
-
return subDomainMap.docs;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
return `https://${SUB_DOMAIN_NAMES.DOCS}.${d.name}.${mode}`;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
export function generateAnyUrl(subDomain: string): string {
|
|
215
|
-
const d = getDomainObject();
|
|
216
|
-
const mode = getMode();
|
|
217
|
-
if (mode === "dev") {
|
|
218
|
-
return subDomainMap[d.sub];
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
return `https://${subDomain}.${d.name}.${mode}`;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
export function getDBConnectionString(): string {
|
|
225
|
-
const mode = getMode();
|
|
226
|
-
if (mode === "dev") {
|
|
227
|
-
return process.env.DATABASE_URL_DEV || "";
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
if (mode === "win") {
|
|
231
|
-
return process.env.DATABASE_URL_WIN || "";
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
return process.env.DATABASE_URL_COM || "";
|
|
235
|
-
}
|
|
1
|
+
export const SUB_DOMAIN_NAMES = {
|
|
2
|
+
WWW: "www",
|
|
3
|
+
ACCOUNT: "account",
|
|
4
|
+
DOMAIN: "domain",
|
|
5
|
+
ADMANAGE: "admanage",
|
|
6
|
+
DNS: "dns",
|
|
7
|
+
HOSTING: "hosting",
|
|
8
|
+
APPOCEAN: "appocean",
|
|
9
|
+
DOCS: "docs",
|
|
10
|
+
PROBACKUP: "probackup",
|
|
11
|
+
EDUSOFT: "edusoft",
|
|
12
|
+
SUPPORT: "support",
|
|
13
|
+
ICON: "icon",
|
|
14
|
+
DRIVE: "drive",
|
|
15
|
+
API: "io",
|
|
16
|
+
API2: "api2",
|
|
17
|
+
API3: "api3",
|
|
18
|
+
} as const;
|
|
19
|
+
|
|
20
|
+
const subDomainMap: Record<string, string> = {
|
|
21
|
+
www: `http://localhost:7201`,
|
|
22
|
+
account: `http://localhost:5000`,
|
|
23
|
+
domain: `http://localhost:7203`,
|
|
24
|
+
dns: `http://localhost:7204`,
|
|
25
|
+
hosting: `http://localhost:7205`,
|
|
26
|
+
appocean: `http://localhost:7206`,
|
|
27
|
+
docs: `http://localhost:7207`,
|
|
28
|
+
admanage: `http://localhost:7208`,
|
|
29
|
+
probackup: `http://localhost:7209`,
|
|
30
|
+
edusoft: `http://localhost:7210`,
|
|
31
|
+
icon: `http://localhost:7211`,
|
|
32
|
+
drive: `http://localhost:7212`,
|
|
33
|
+
support: `http://localhost:7216`,
|
|
34
|
+
api: `https://io.bikiran.win`,
|
|
35
|
+
api2:
|
|
36
|
+
process.env.NEXT_PUBLIC_LOCAL_API === "true"
|
|
37
|
+
? `http://localhost:5010`
|
|
38
|
+
: `https://api2.bikiran.win`,
|
|
39
|
+
api3:
|
|
40
|
+
process.env.NEXT_PUBLIC_LOCAL_API === "true"
|
|
41
|
+
? `http://localhost:7301`
|
|
42
|
+
: `https://api3.bikiran.win`,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const isDev = process.env.NEXT_PUBLIC_MODE === "dev";
|
|
46
|
+
export function getMode(): "dev" | "win" | "com" {
|
|
47
|
+
if (isDev) {
|
|
48
|
+
return "dev";
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const isWin = process.env.NEXT_PUBLIC_MODE === "win";
|
|
52
|
+
if (isWin) {
|
|
53
|
+
return "win";
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return "com";
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const getDomain = (): string => {
|
|
60
|
+
return process.env.NEXT_PUBLIC_DOMAIN || "";
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
interface DomainObject {
|
|
64
|
+
sub: string;
|
|
65
|
+
name: string;
|
|
66
|
+
tld: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const getDomainObject = (): DomainObject => {
|
|
70
|
+
const domainParts = getDomain().split(".");
|
|
71
|
+
return {
|
|
72
|
+
sub: domainParts[0],
|
|
73
|
+
name: domainParts[1],
|
|
74
|
+
tld: domainParts[2],
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const getBaseDomain = (): string => {
|
|
79
|
+
const mode = getMode();
|
|
80
|
+
if (mode === "dev") {
|
|
81
|
+
return "localhost";
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const d = getDomainObject();
|
|
85
|
+
return `${d.name}.${mode}`;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// https://www.bikiran.com/
|
|
89
|
+
export function getBikiranUrl(): string {
|
|
90
|
+
const d = getDomainObject();
|
|
91
|
+
const mode = getMode();
|
|
92
|
+
if (mode === "dev") {
|
|
93
|
+
return subDomainMap.www;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return `https://${SUB_DOMAIN_NAMES.WWW}.${d.name}.${mode}`;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// https://www.hosting.bikiran.com/
|
|
100
|
+
export function getHostingUrl(): string {
|
|
101
|
+
const d = getDomainObject();
|
|
102
|
+
const mode = getMode();
|
|
103
|
+
if (mode === "dev") {
|
|
104
|
+
return subDomainMap.hosting;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return `https://${SUB_DOMAIN_NAMES.HOSTING}.${d.name}.${mode}`;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// https://www.domain.bikiran.com/
|
|
111
|
+
export function getDomainUrl(): string {
|
|
112
|
+
const d = getDomainObject();
|
|
113
|
+
const mode = getMode();
|
|
114
|
+
if (mode === "dev") {
|
|
115
|
+
return subDomainMap.domain;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return `https://${SUB_DOMAIN_NAMES.DOMAIN}.${d.name}.${mode}`;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// https://www.appocean.bikiran.com/
|
|
122
|
+
export function getAppoceanUrl(): string {
|
|
123
|
+
const d = getDomainObject();
|
|
124
|
+
const mode = getMode();
|
|
125
|
+
if (mode === "dev") {
|
|
126
|
+
return subDomainMap.appocean;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return `https://${SUB_DOMAIN_NAMES.APPOCEAN}.${d.name}.${mode}`;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// https://www.admanage.bikiran.com/
|
|
133
|
+
export function getAdManageUrl(): string {
|
|
134
|
+
const d = getDomainObject();
|
|
135
|
+
const mode = getMode();
|
|
136
|
+
if (mode === "dev") {
|
|
137
|
+
return subDomainMap.admanage;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return `https://${SUB_DOMAIN_NAMES.ADMANAGE}.${d.name}.${mode}`;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// https://www.support.bikiran.com/
|
|
144
|
+
export function getSupportUrl(): string {
|
|
145
|
+
const d = getDomainObject();
|
|
146
|
+
const mode = getMode();
|
|
147
|
+
if (mode === "dev") {
|
|
148
|
+
return subDomainMap.support;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return `https://${SUB_DOMAIN_NAMES.SUPPORT}.${d.name}.${mode}`;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function getSiteUrl(): string {
|
|
155
|
+
const d = getDomainObject();
|
|
156
|
+
const mode = getMode();
|
|
157
|
+
if (mode === "dev") {
|
|
158
|
+
return subDomainMap[d.sub];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return `https://${d.sub}.${d.name}.${mode}`;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export function getApiUrl(): string {
|
|
165
|
+
const d = getDomainObject();
|
|
166
|
+
const mode = getMode();
|
|
167
|
+
if (mode === "dev") {
|
|
168
|
+
return subDomainMap.api;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return `https://${SUB_DOMAIN_NAMES.API}.${d.name}.${mode}`;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function getApi2Url(): string {
|
|
175
|
+
const d = getDomainObject();
|
|
176
|
+
const mode = getMode();
|
|
177
|
+
if (mode === "dev") {
|
|
178
|
+
return subDomainMap.api2;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return `https://${SUB_DOMAIN_NAMES.API2}.${d.name}.${mode}`;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export function getApi3Url(): string {
|
|
185
|
+
const d = getDomainObject();
|
|
186
|
+
const mode = getMode();
|
|
187
|
+
if (mode === "dev") {
|
|
188
|
+
return subDomainMap.api3;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return `https://${SUB_DOMAIN_NAMES.API3}.${d.name}.${mode}`;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function getAccountUrl(): string {
|
|
195
|
+
const d = getDomainObject();
|
|
196
|
+
const mode = getMode();
|
|
197
|
+
if (mode === "dev") {
|
|
198
|
+
return subDomainMap.account;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return `https://${SUB_DOMAIN_NAMES.ACCOUNT}.${d.name}.${mode}`;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export function getDocsUrl(): string {
|
|
205
|
+
const d = getDomainObject();
|
|
206
|
+
const mode = getMode();
|
|
207
|
+
if (mode === "dev") {
|
|
208
|
+
return subDomainMap.docs;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return `https://${SUB_DOMAIN_NAMES.DOCS}.${d.name}.${mode}`;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export function generateAnyUrl(subDomain: string): string {
|
|
215
|
+
const d = getDomainObject();
|
|
216
|
+
const mode = getMode();
|
|
217
|
+
if (mode === "dev") {
|
|
218
|
+
return subDomainMap[d.sub];
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return `https://${subDomain}.${d.name}.${mode}`;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export function getDBConnectionString(): string {
|
|
225
|
+
const mode = getMode();
|
|
226
|
+
if (mode === "dev") {
|
|
227
|
+
return process.env.DATABASE_URL_DEV || "";
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (mode === "win") {
|
|
231
|
+
return process.env.DATABASE_URL_WIN || "";
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return process.env.DATABASE_URL_COM || "";
|
|
235
|
+
}
|
|
236
236
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
function capitalizeFirstLetter(string: string): string {
|
|
2
|
-
if (!string) return "";
|
|
3
|
-
const result = string.charAt(0).toUpperCase() + string.slice(1);
|
|
4
|
-
return result || string || "";
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export default capitalizeFirstLetter;
|
|
1
|
+
function capitalizeFirstLetter(string: string): string {
|
|
2
|
+
if (!string) return "";
|
|
3
|
+
const result = string.charAt(0).toUpperCase() + string.slice(1);
|
|
4
|
+
return result || string || "";
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default capitalizeFirstLetter;
|
package/dist/lib/utils/cn.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import clsx, { ClassValue } from "clsx";
|
|
2
|
-
import { twMerge } from "tailwind-merge";
|
|
3
|
-
|
|
4
|
-
export const cn = (...input: ClassValue[]) => twMerge(clsx(input));
|
|
1
|
+
import clsx, { ClassValue } from "clsx";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
|
|
4
|
+
export const cn = (...input: ClassValue[]) => twMerge(clsx(input));
|
package/dist/lib/utils/option.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export const addOption = (id: any, title: any, value: any) => {
|
|
2
|
-
return { id, title, value };
|
|
3
|
-
};
|
|
4
|
-
|
|
5
|
-
export const addOption2 = (id: any, title: any, value: any) => {
|
|
6
|
-
return { id, title, value };
|
|
7
|
-
};
|
|
1
|
+
export const addOption = (id: any, title: any, value: any) => {
|
|
2
|
+
return { id, title, value };
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
export const addOption2 = (id: any, title: any, value: any) => {
|
|
6
|
+
return { id, title, value };
|
|
7
|
+
};
|
package/dist/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module"}
|
|
1
|
+
{"type": "module"}
|
package/package.json
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@bikiran/utils",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"main": "dist/index.js",
|
|
5
|
-
"types": "dist/index.d.ts",
|
|
6
|
-
"files": [
|
|
7
|
-
"dist"
|
|
8
|
-
],
|
|
9
|
-
"scripts": {
|
|
10
|
-
"dev": "vite example",
|
|
11
|
-
"build": "tsc && echo 'Running copyfiles...' && copyfiles src/**/*.{js,ts,svg,css} dist --up 1 && echo
|
|
12
|
-
"vite-build": "vite build",
|
|
13
|
-
"preview": "vite preview example",
|
|
14
|
-
"prepublishOnly": "npm run build",
|
|
15
|
-
"pack-local": "npm run build && npm pack",
|
|
16
|
-
"clean": "node clean.js",
|
|
17
|
-
"test": "vitest",
|
|
18
|
-
"build:tailwind": "npm exec tailwindcss -i src/tailwind.css -o dist/output.css --minify"
|
|
19
|
-
},
|
|
20
|
-
"keywords": [
|
|
21
|
-
"react",
|
|
22
|
-
"button",
|
|
23
|
-
"component",
|
|
24
|
-
"ui"
|
|
25
|
-
],
|
|
26
|
-
"author": "Kumar Bishojit Paul",
|
|
27
|
-
"license": "MIT",
|
|
28
|
-
"type": "module",
|
|
29
|
-
"description": "A simple and reusable React input component library",
|
|
30
|
-
"repository": {
|
|
31
|
-
"type": "git",
|
|
32
|
-
"url": "https://github.com/bikirandev/bikiran-utils.git"
|
|
33
|
-
},
|
|
34
|
-
"bugs": {
|
|
35
|
-
"url": "https://github.com/bikirandev/bikiran-utils/issues"
|
|
36
|
-
},
|
|
37
|
-
"homepage": "https://github.com/bikirandev/bikiran-utils#readme",
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"clsx": "^2.1.1",
|
|
40
|
-
"tailwind-merge": "^3.2.0"
|
|
41
|
-
},
|
|
42
|
-
"peerDependencies": {
|
|
43
|
-
"react": "^19.1.0",
|
|
44
|
-
"react-dom": "^19.1.0"
|
|
45
|
-
},
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"@testing-library/react": "^16.3.0",
|
|
48
|
-
"@types/node": "^22.15.2",
|
|
49
|
-
"@types/react": "^19.1.2",
|
|
50
|
-
"@types/react-dom": "^19.1.2",
|
|
51
|
-
"@vitejs/plugin-react": "^4.4.1",
|
|
52
|
-
"copyfiles": "^2.4.1",
|
|
53
|
-
"jsdom": "^26.1.0",
|
|
54
|
-
"react": "^19.1.0",
|
|
55
|
-
"react-dom": "^19.1.0",
|
|
56
|
-
"typescript": "^5.8.3",
|
|
57
|
-
"vite": "^6.3.3",
|
|
58
|
-
"vitest": "^3.1.2"
|
|
59
|
-
}
|
|
60
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@bikiran/utils",
|
|
3
|
+
"version": "2.0.4",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "vite example",
|
|
11
|
+
"build": "tsc && echo 'Running copyfiles...' && copyfiles src/**/*.{js,ts,svg,css} dist --up 1 && echo \"{\\\"type\\\": \\\"module\\\"}\" > dist/package.json",
|
|
12
|
+
"vite-build": "vite build",
|
|
13
|
+
"preview": "vite preview example",
|
|
14
|
+
"prepublishOnly": "npm run build",
|
|
15
|
+
"pack-local": "npm run build && npm pack",
|
|
16
|
+
"clean": "node clean.js",
|
|
17
|
+
"test": "vitest",
|
|
18
|
+
"build:tailwind": "npm exec tailwindcss -i src/tailwind.css -o dist/output.css --minify"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"react",
|
|
22
|
+
"button",
|
|
23
|
+
"component",
|
|
24
|
+
"ui"
|
|
25
|
+
],
|
|
26
|
+
"author": "Kumar Bishojit Paul",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"type": "module",
|
|
29
|
+
"description": "A simple and reusable React input component library",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/bikirandev/bikiran-utils.git"
|
|
33
|
+
},
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/bikirandev/bikiran-utils/issues"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/bikirandev/bikiran-utils#readme",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"clsx": "^2.1.1",
|
|
40
|
+
"tailwind-merge": "^3.2.0"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"react": "^19.1.0",
|
|
44
|
+
"react-dom": "^19.1.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@testing-library/react": "^16.3.0",
|
|
48
|
+
"@types/node": "^22.15.2",
|
|
49
|
+
"@types/react": "^19.1.2",
|
|
50
|
+
"@types/react-dom": "^19.1.2",
|
|
51
|
+
"@vitejs/plugin-react": "^4.4.1",
|
|
52
|
+
"copyfiles": "^2.4.1",
|
|
53
|
+
"jsdom": "^26.1.0",
|
|
54
|
+
"react": "^19.1.0",
|
|
55
|
+
"react-dom": "^19.1.0",
|
|
56
|
+
"typescript": "^5.8.3",
|
|
57
|
+
"vite": "^6.3.3",
|
|
58
|
+
"vitest": "^3.1.2"
|
|
59
|
+
}
|
|
60
|
+
}
|