spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / telemetry / hooks / is-analytics-off / is-env-truthy / is-env-truthy.ts
9 lines · 391 BRaw
1/**
2 * Whether a variable reads as on, as the CLI reads its boolean switches:
3 * `1`, `true`, `yes` or `on`, in any case, spaces around it ignored.
4 *
5 * @param value the variable as the environment holds it
6 * @returns true for one of the four spellings
7 */
8export const isEnvTruthy = (value: string | undefined) =>
9 ['1', 'true', 'yes', 'on'].includes((value ?? '').trim().toLowerCase())