Skip to content

Instantly share code, notes, and snippets.

@devgioele
Created April 28, 2023 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devgioele/656e232902ffbd01a347b1739decc6d4 to your computer and use it in GitHub Desktop.
Save devgioele/656e232902ffbd01a347b1739decc6d4 to your computer and use it in GitHub Desktop.
Transform number fields to strings recursively
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