TehShrike/deepmerge

use recursive partial for type definitions

jonnytest1 opened this issue · 1 comments

export type RecursivePartial<T> = {
  [P in keyof T]?: T[P] extends (infer U)[]
    ? RecursivePartial<U>[]
    : T[P] extends object
      ? RecursivePartial<T[P]>
      : T[P];
};

this way subobjects can also be partial but need to have the correct types if provided

The Partial type is planned to be removed completely in the next version (whenever that may happen). A much more in-depth merging is planned.

See #226, specifically the types.ts file for more details.
However, the typings there may be a little out of date now. See this alternative for the latest work on the typings (currently release as deepmerge-ts)