This is a basic implementation of Typescript's Pick utility type from this tuturial
type ObjectWithKeys<T, K extends keyof T> = {
[P in K]: T[P];
};
I undestand what it does, but I find the use of K extends keyof T a bit confusing. We want to ensure that K is a member (or union of members) of the union type keyof T. It's never going to "extend" it, so why use the extends operator here?
Is Typescript lacking an operator and this is the best current option?