Derive labels, active index, and active option for a discriminated union.
For each option, the label is the discriminator property's const value
(when the option is an object with a literal discriminator) or, failing
that, the option's meta.title or its type. The active index is chosen
from the discriminator's value on valueObject; missing or non-matching
values fall back to index 0.
Pure data transformation — no rendering concerns, no React imports.
Derive labels, active index, and active option for a discriminated union.
For each option, the label is the discriminator property's
constvalue (when the option is an object with a literal discriminator) or, failing that, the option'smeta.titleor itstype. The active index is chosen from the discriminator's value onvalueObject; missing or non-matching values fall back to index 0.Pure data transformation — no rendering concerns, no React imports.