Summary
loggingOptions() switches on config.level without a runtime default case, so an unsupported level value arriving through an untyped path leaves levelParser undefined and causes an internal crash during parser construction.
Reproduction
import { loggingOptions } from "@optique/logtape";
loggingOptions({ level: "traceflag" as never });
Current behavior: construction throws TypeError: Cannot read properties of undefined (reading 'priority').
Expected behavior
Unsupported runtime level discriminants should be rejected up front with a clear configuration error.
Actual behavior
The invalid configuration falls through the switch, leaves levelParser undefined, and crashes later when the parser is assembled.
Notes
This is a runtime configuration-validation bug. The TypeScript union prevents this in typed code, but the public API still needs a defensive runtime check for untyped call sites.
Summary
loggingOptions()switches onconfig.levelwithout a runtime default case, so an unsupportedlevelvalue arriving through an untyped path leaveslevelParserundefined and causes an internal crash during parser construction.Reproduction
Current behavior: construction throws
TypeError: Cannot read properties of undefined (reading 'priority').Expected behavior
Unsupported runtime
leveldiscriminants should be rejected up front with a clear configuration error.Actual behavior
The invalid configuration falls through the switch, leaves
levelParserundefined, and crashes later when the parser is assembled.Notes
This is a runtime configuration-validation bug. The TypeScript union prevents this in typed code, but the public API still needs a defensive runtime check for untyped call sites.