RequiredByKeys medium #object

by jiangshan @jiangshanmeta

Take the Challenge    简体中文

Implement a generic `RequiredByKeys` which takes two type argument `T` and `K`. `K` specify the set of properties of `T` that should set to be required. When `K` is not provided, it should make all properties required just like the normal `Required`. For example ```typescript interface User { name?: string age?: number address?: string } type UserRequiredName = RequiredByKeys // { name: string; age?: number; address?: string } ```
Back Share your Solutions Check out Solutions