type Foo = { a?: { c?: number }, b?: string };
type Bar = { foo: Foo };
type Baz = DeepRequired<Bar, []>; // { foo: { a: { c: number }, b: string } }
type Baz = DeepRequired<Bar, ['a', 'c']>; // { foo: { a: { c?: number }, b: string } }
type Baz = DeepRequired<Bar, ['a'] | ['b']>; // { foo: { a: { c?: number }, b?: string } }
A type that recursively makes each property of
Trequired. Optionally excluding a nested path specified by a list of keys.