types(runtime-core): fix for multiple possible prop types including Date (#4518)

fix #4517
This commit is contained in:
Husam Ibrahim
2021-09-06 00:16:44 +02:00
committed by GitHub
parent fac9a2926d
commit 4645a42b79
2 changed files with 11 additions and 1 deletions

View File

@@ -109,6 +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 [Prop<infer V, infer D>]
? unknown extends V
? D