Typescript: Generic function for creating a lookup object
I currently have a function to which I can pass an array of objects, where the objects all have the _id key. From that object the function creates a lookup object, which has the _id fields as keys and the corresponding objects as values. function createLookupById<S extends string, T extends object & { _id: S … Read more