Skip to content

Commit

Permalink
feat: add RemoveDeepReadonly type
Browse files Browse the repository at this point in the history
  • Loading branch information
abxlfazl authored and ASafaeirad committed May 23, 2024
1 parent a078250 commit a35775b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,9 @@ export type Replace<T, P, V> = [T] extends [never]
? V
: T[Key];
};

export type RemoveDeepReadonly<T> = keyof T extends never
? T
: {
-readonly [P in keyof T]: RemoveDeepReadonly<T[P]>;
};

0 comments on commit a35775b

Please sign in to comment.