1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-25 22:37:27 -04:00

Convert History to TypeScript

(cherry picked from commit 824ed0a36931ce7aae9aa544a7baf0738dae568c)

Closes #10230
Closes #10390
Closes #10247
This commit is contained in:
Mark McDowall
2024-07-19 20:42:59 -07:00
committed by Bogdan
parent 13f10906f1
commit 6747b74271
47 changed files with 923 additions and 1178 deletions
@@ -1,15 +0,0 @@
import _ from 'lodash';
function selectUniqueIds(items, idProp) {
const ids = _.reduce(items, (result, item) => {
if (item[idProp]) {
result.push(item[idProp]);
}
return result;
}, []);
return _.uniq(ids);
}
export default selectUniqueIds;
@@ -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;