File size: 205 Bytes
d9494a5
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
export const findByProperty = <T, K extends keyof T>(
  property: K,
  valueToMatch: T[K] | null | undefined,
) => {
  return (itemToFind: T) => {
    return itemToFind[property] === valueToMatch;
  };
};