Skip to content

Instantly share code, notes, and snippets.

@Saul-Mirone
Created August 28, 2018 02:59
Show Gist options
  • Save Saul-Mirone/daf63ffc218cbe133cd326b250c9b1f0 to your computer and use it in GitHub Desktop.
Save Saul-Mirone/daf63ffc218cbe133cd326b250c9b1f0 to your computer and use it in GitHub Desktop.
export type TRequiredKeys<T, keys extends keyof T = keyof T> =
Pick<T, Exclude<keyof T, keys>> & {
[K in keys]-?: Required<Pick<T, K>>
}[keys];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment