mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-13 03:52:00 +00:00
13 lines
267 B
TypeScript
13 lines
267 B
TypeScript
export function isEnvTruthy(envVar: string | boolean | undefined): boolean {
|
|
if (!envVar) {
|
|
return false
|
|
}
|
|
|
|
if (typeof envVar === 'boolean') {
|
|
return envVar
|
|
}
|
|
|
|
const v = envVar.toLowerCase().trim()
|
|
|
|
return ['1', 'true', 'yes', 'on'].includes(v)
|
|
}
|