Path 1: Simplify OptionTypeConfig
Where transform becomes THE WAY to do validation, defaults, and the expected return type, etc.
export type OptionTypeConfig =
| OptionTypeEnum
| {
transform?: (input: unknown) => OptionType;
}
| {...} //
Path 2: Add transform to all existing type's
This would run through all existing validation and apply defaults, then run it through any specified transform().
| Seems trickier with TS.
Path 1: Simplify OptionTypeConfig
Where
transformbecomes THE WAY to do validation, defaults, and the expected return type, etc.Path 2: Add
transformto all existingtype'sThis would run through all existing validation and apply defaults, then run it through any specified
transform().| Seems trickier with TS.