Created
April 28, 2023 07:53
-
-
Save devgioele/656e232902ffbd01a347b1739decc6d4 to your computer and use it in GitHub Desktop.
Transform number fields to strings recursively
This file contains hidden or 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 FormCompatible<T> = T extends unknown | |
? { | |
[P in keyof T]: T[P] extends infer K | |
? K extends object | |
? FormCompatible<T[P]> | |
: K extends number | |
? string | |
: K | |
: never | |
} | |
: never |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment