From cbc3e67c375ed75fb4ef605c6d5a823890a29712 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BC=95=E8=AF=81?= Date: Wed, 26 Oct 2022 15:01:37 +0800 Subject: [PATCH] types(shared): Improve LooseRequired (#6244) --- packages/shared/src/typeUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared/src/typeUtils.ts b/packages/shared/src/typeUtils.ts index 8730d7f38b..3f3620c667 100644 --- a/packages/shared/src/typeUtils.ts +++ b/packages/shared/src/typeUtils.ts @@ -5,7 +5,7 @@ export type UnionToIntersection = ( : never // make keys required but keep undefined values -export type LooseRequired = { [P in string & keyof T]: T[P] } +export type LooseRequired = { [P in keyof (T & Required)]: T[P] } // If the the type T accepts type "any", output type Y, otherwise output type N. // https://stackoverflow.com/questions/49927523/disallow-call-with-any/49928360#49928360 -- 2.47.3