Updated
On this page
Env var value resolution for a single flag, mirroring the env-resolution blocks of Go parseCommand/extractGlobalFlags and Python's step-4 loops.
#typescript/src/env
#typescript/src/env
Env var value resolution for a single flag, mirroring the env-resolution blocks of Go parseCommand/extractGlobalFlags and Python's step-4 loops. Env-prefix conformance is a registration-time concern (app.ts); this module only turns an env var's string value into a typed flag value.
Per-type rules:
- dict: the env value is a whole JSON object.
- list: split on the declared envSeparator (escape-aware), coerce each
element by the element schema; str elements resolve the @-prefix.
- bool: strict bool strings (1|true|yes / 0|false|no, case-insensitive).
- int/float: strict parse, errors suffixed with "(from env var '')".
- str: @-prefix resolution (its errors carry no env suffix, matching the
siblings).
#resolveEnvValue
typescript
export function resolveEnvValue(Resolves envVal (the raw string value of envVar) into the typed value for flag f. Throws ParseError with sibling-exact messages.