Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) Add optional transform callback #6

Open
justsml opened this issue May 14, 2022 · 0 comments
Open

(feat) Add optional transform callback #6

justsml opened this issue May 14, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@justsml
Copy link
Contributor

justsml commented May 14, 2022

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.

@justsml justsml changed the title Feature: Add optional transform callback (feat) Add optional transform callback May 15, 2022
@justsml justsml added the enhancement New feature or request label May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant