Skip to content

Commit

Permalink
added utility RequiredOnly type
Browse files Browse the repository at this point in the history
  • Loading branch information
Oaphi committed Aug 11, 2021
1 parent 5e7aa06 commit 9ec0c1e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//@see https://stackoverflow.com/a/68261391/11407695
export type RequiredOnly<T> = {
[K in keyof T as T[K] extends Required<T>[K] ? K : never]: T[K];
};

0 comments on commit 9ec0c1e

Please # to comment.