Q:

How to type input to `mergeDeepRight`

I have function
const updateStoreMerge = (value: PartialRecursive<StoreType>): StoreType => updateStore(s => mergeDeepRight(s, value));

how to type it? Value should be just subset of StoreType. I want something like partial but recursively put nullability to all attributes.
type PropsThatAreObjects<T, K extends keyof T> = K extends keyof T ? T[K] extends object ? K : never : never;

type PartialAll<T> = {
  [K in PropsThatAreObjects<T, keyof T>]?: PartialAll<T[K]> &
  [K in keyof T except the ones in PropsThatAreObjects<T, keyof T>]?: T<K> 
};

I have problem writing this
[K in keyof T except the ones in PropsThatAreObjects<T, keyof T>]?: T<K> 

Thanks a lot :)

A:

It seems to me that PartialAll (or PartialRecursive) could be simplified to this:
type PartialAll<T> = T extends object ? { [K in keyof T]?: PartialAll<T[K]> } : T;

