type-challenges
type-challenges copied to clipboard
2757 - PartialByKeys
type IntersectionObj<T> = {
[P in keyof T]: T[P]
}
type PartialByKeys<T, K extends PropertyKey = keyof T> = IntersectionObj<{
[P in keyof T as P extends K ? P : never]?: T[P]
} & {
[P in keyof Omit<T, K>]: T[P]
}>