mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-08 01:43:07 +00:00
13 lines
343 B
TypeScript
13 lines
343 B
TypeScript
const TRUE_VALUES = new Set(['1', 'true', 'yes', 'on'])
|
|
|
|
function parseBooleanFlag(value: string | undefined): boolean {
|
|
if (!value) {
|
|
return false
|
|
}
|
|
return TRUE_VALUES.has(value.trim().toLowerCase())
|
|
}
|
|
|
|
export function requireHubUrlForLogin(): boolean {
|
|
return parseBooleanFlag(import.meta.env.VITE_REQUIRE_HUB_URL)
|
|
}
|