Skip to content

Instantly share code, notes, and snippets.

@jasonbyrne
Created May 2, 2022 13:01
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 jasonbyrne/eb64b112f259bd66949d5889562ca040 to your computer and use it in GitHub Desktop.
Save jasonbyrne/eb64b112f259bd66949d5889562ca040 to your computer and use it in GitHub Desktop.
DeepPartial in TypeScript
export type DeepPartial<T> = T extends Function
? T
: T extends object
? { [P in keyof T]?: DeepPartial<T[P]> | undefined }
: T | undefined;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment