Last active
June 29, 2023 12:59
-
-
Save edubskiy/6b9d786d37ff550a126d64c2b910c117 to your computer and use it in GitHub Desktop.
This file contains 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 PartiallyRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>; | |
interface Human { | |
name: string; | |
age?: number; | |
} | |
type HumanWithRequiredAge = PartiallyRequired<Human, "age">; | |
const dan: HumanWithRequiredAge = { | |
name: "Dan Jordan", | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment