I have an interface containing some optional fields
interface Config {
name: string,
context?: string,
value?: number,
type: string
}
I would like to extract all optional fields and their values
The result should look like this:
type OptionalConfig = ExtractOptionalProperties<Config>
// {
// context?: string,
// value?: number,
// }
I found a way to extract all optional keys but have no idea how to extract also the values. Is it possible with Typescript?