Skip to content

Commit cbc3e67

Browse files
authored
types(shared): Improve LooseRequired<T> (#6244)
1 parent b0b74a1 commit cbc3e67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/shared/src/typeUtils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export type UnionToIntersection<U> = (
55
: never
66

77
// make keys required but keep undefined values
8-
export type LooseRequired<T> = { [P in string & keyof T]: T[P] }
8+
export type LooseRequired<T> = { [P in keyof (T & Required<T>)]: T[P] }
99

1010
// If the the type T accepts type "any", output type Y, otherwise output type N.
1111
// https://stackoverflow.com/questions/49927523/disallow-call-with-any/49928360#49928360

0 commit comments

Comments
 (0)