OptionalUndefined hard

by Jesus The Hun @JesusTheHun

Take the Challenge

Implement the util type `OptionalUndefined` that turns all the properties of `T` that can be `undefined`, into optional properties. In addition, a second -optional- generic `Props` can be passed to restrict the properties that can be altered. ```ts OptionalUndefined<{ value: string | undefined, description: string }> // { value?: string | undefined; description: string } OptionalUndefined<{ value: string | undefined, description: string | undefined, author: string | undefined }, 'description' | 'author'> // { value: string | undefined; description?: string | undefined, author?: string | undefined } ```
Back Share your Solutions Check out Solutions