fix(types): extract the correct props type for the DateConstructor (#2676)
This commit is contained in:
@@ -97,7 +97,9 @@ type InferPropType<T> = T extends null
|
||||
? Record<string, any>
|
||||
: T extends BooleanConstructor | { type: BooleanConstructor }
|
||||
? boolean
|
||||
: T extends Prop<infer V, infer D> ? (unknown extends V ? D : V) : T
|
||||
: T extends DateConstructor | { type: DateConstructor }
|
||||
? Date
|
||||
: T extends Prop<infer V, infer D> ? (unknown extends V ? D : V) : T
|
||||
|
||||
export type ExtractPropTypes<O> = O extends object
|
||||
? { [K in RequiredKeys<O>]: InferPropType<O[K]> } &
|
||||
|
||||
Reference in New Issue
Block a user