NestedUpdateFields
For each field (e.g. 'bar'), find all nested keys (e.g. {'bar.baz': T1, 'bar.qux': T2}). Intersect them together to make a single map containing all possible keys that are all marked as optional
type NestedUpdateFields<T extends Record<string, unknown>> = UnionToIntersection<[K in keyof T & string]: ChildUpdateFields<K, T[K]>[keyof T & string]>;
§Type
§
UnionToIntersection<[K in keyof T & string]: ChildUpdateFields<K, T[K]>[keyof T & string]>
[src]