Skip to content

Instantly share code, notes, and snippets.

@mayognaise
Created July 27, 2023 06:11
Show Gist options
  • Save mayognaise/61f4980f7b70690c1e5deb13df0f515f to your computer and use it in GitHub Desktop.
Save mayognaise/61f4980f7b70690c1e5deb13df0f515f to your computer and use it in GitHub Desktop.
Define all keys as optional
// When all keys are optional
type User = Partial<{
name: string
email: string
phone: string
}>
/**
type User = {
name?: string | undefined;
email?: string | undefined;
phone?: string | undefined;
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment