Skip to content

Commit

Permalink
🏷️ (@modules/typings): Add type DeepPartial
Browse files Browse the repository at this point in the history
  • Loading branch information
toridoriv committed Oct 15, 2023
1 parent b08b892 commit a18e767
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/typings/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,14 @@ export type ExcludeNever<T> = {
: T[K];
};

/**
* Makes all properties in T optional.
*/
export type DeepPartial<T> = T extends object ? {
[P in keyof T]?: DeepPartial<T[P]>;
}
: T;

/* -------------------------------------------------------------------------- */
/* Internal Types */
/* -------------------------------------------------------------------------- */
Expand Down

0 comments on commit a18e767

Please sign in to comment.