Last active
August 3, 2022 14:44
-
-
Save sebinsua/4ad2feb86e64e3fd12b5d40668b61f98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type LeftRight = 'left' | 'right'; | |
type LeftRightNet = 'left' | 'right' | 'net'; | |
type ExpandNumericFields<Str> = Str extends `${infer Prefix}_numeric` ? `${Prefix}_numeric_${LeftRightNet}` : Str extends 'weight' ? `weight_${LeftRightNet}` : Str extends string ? `${Str}_${LeftRight}` : never; | |
type T1 = ExpandNumericFields<'base_numeric'> | |
type T2 = ExpandNumericFields<'weight'> | |
type T3 = ExpandNumericFields<'numeric_exposure'> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment