forked from mxx1111/mdlook
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeatures.ts
More file actions
36 lines (30 loc) · 1.02 KB
/
Copy pathfeatures.ts
File metadata and controls
36 lines (30 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function envFlag(name: string, defaultValue = false): boolean {
const env = import.meta.env as Record<string, string | undefined>
const value = env[name]
if (value === undefined || value === ``)
return defaultValue
return value === `true` || value === `1`
}
/**
* mdlook keeps inherited doocs/md capabilities in code, but hides heavier
* product surfaces by default so the app stays focused on writing and copying
* Markdown for WeChat.
*/
export function isAccountFeatureEnabled(): boolean {
return envFlag(`VITE_ACCOUNT_UI_ENABLED`)
}
export function isSyncFeatureEnabled(): boolean {
return envFlag(`VITE_SYNC_UI_ENABLED`)
}
export function isShareFeatureEnabled(): boolean {
return envFlag(`VITE_SHARE_UI_ENABLED`)
}
export function isAiFeatureEnabled(): boolean {
return envFlag(`VITE_AI_UI_ENABLED`)
}
export function isFundFeatureEnabled(): boolean {
return envFlag(`VITE_FUND_UI_ENABLED`)
}
export function isThemeServiceFeatureEnabled(): boolean {
return envFlag(`VITE_THEME_SERVICE_UI_ENABLED`)
}