feat(core-extensions): Handle function type in MappedKeys
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
export type MappedKeys<T, R extends string> = T extends any[]
|
||||
? { [K in keyof T]: MappedKeys<T[K], R> }
|
||||
: T extends object
|
||||
? {
|
||||
[K in keyof T as R]: MappedKeys<T[K], R>
|
||||
}
|
||||
: T
|
||||
export type MappedKeys<T, R extends string> = T extends Function
|
||||
? T
|
||||
: T extends Array<infer U>
|
||||
? Array<MappedKeys<U, R>>
|
||||
: T extends object
|
||||
? {
|
||||
[K in keyof T as R]: MappedKeys<T[K], R>
|
||||
}
|
||||
: T
|
||||
|
||||
Reference in New Issue
Block a user