Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 683 Bytes

File metadata and controls

32 lines (23 loc) · 683 Bytes

Home > types-kit > PartialDeep

PartialDeep type

Make all properties (includes deep properties) in T optional.

Signature:

export type PartialDeep<T> = {
  [P in keyof T]?: PartialDeep<T[P]>
}

References: PartialDeep

Example

interface Props {
      a: {
        d: number
      };
      b: number;
      c: number;
    };
   // Expect: { a?: { d?: number }; b?: number; c?: number; }
   type NewProps = PartialDeep<Props>;