Skip to content

(feat) Add optional transform callback #6

Description

@justsml

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions