mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 15:58:38 +01:00
15 lines
458 B
TypeScript
15 lines
458 B
TypeScript
|
|
function truthy(value: any, ifNull: boolean) {
|
|
if (value === undefined || value === null || value === '') return ifNull;
|
|
return value === 'true' || value === true || value === '1' || value === 1;
|
|
}
|
|
|
|
export function isSelfhosted() {
|
|
const config = useRuntimeConfig();
|
|
return truthy(config.public.SELFHOSTED, false);
|
|
}
|
|
|
|
export function isAiEnabled() {
|
|
const config = useRuntimeConfig();
|
|
return truthy(config.public.AI_ENABLED, true);
|
|
} |