Files
litlyx/dashboard/server/utils/isSelfhosted.ts
2025-11-28 16:49:20 +01:00

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);
}