twenty / packages /twenty-shared /src /utils /array /findByProperty.ts
Jules
Initial clean CRM deployment with prebuilt assets
d9494a5
Raw
History Blame Contribute Delete
205 Bytes
export const findByProperty = <T, K extends keyof T>(
property: K,
valueToMatch: T[K] | null | undefined,
) => {
return (itemToFind: T) => {
return itemToFind[property] === valueToMatch;
};
};