1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-26 22:56:23 -04:00

Convert History to TypeScript

This commit is contained in:
Mark McDowall
2024-07-19 20:42:59 -07:00
committed by Mark McDowall
parent ee80564dd4
commit 824ed0a369
41 changed files with 1276 additions and 1515 deletions
@@ -0,0 +1,13 @@
import KeysMatching from 'typings/Helpers/KeysMatching';
function selectUniqueIds<T, K>(items: T[], idProp: KeysMatching<T, K>) {
return items.reduce((acc: K[], item) => {
if (item[idProp] && acc.indexOf(item[idProp] as K) === -1) {
acc.push(item[idProp] as K);
}
return acc;
}, []);
}
export default selectUniqueIds;