fix(type): fix prop type infer (#4530)

fix #4525
This commit is contained in:
fishDog
2021-09-07 03:24:15 +08:00
committed by GitHub
parent 642710eded
commit 4178d5d7d9
2 changed files with 8 additions and 5 deletions

View File

@@ -109,10 +109,10 @@ type InferPropType<T> = [T] extends [null]
? boolean
: [T] extends [DateConstructor | { type: DateConstructor }]
? Date
: [T] extends [
(DateConstructor | infer U)[] | { type: (DateConstructor | infer U)[] }
]
? Date | InferPropType<U>
: [T] extends [(infer U)[] | { type: (infer U)[] }]
? U extends DateConstructor
? Date | InferPropType<U>
: InferPropType<U>
: [T] extends [Prop<infer V, infer D>]
? unknown extends V
? D