mirror of https://github.com/lidarr/Lidarr
16 lines
320 B
JavaScript
16 lines
320 B
JavaScript
import _ from 'lodash';
|
|
|
|
function getSelectedIds(selectedState, { parseIds = true } = {}) {
|
|
return _.reduce(selectedState, (result, value, id) => {
|
|
if (value) {
|
|
const parsedId = parseIds ? parseInt(id) : id;
|
|
|
|
result.push(parsedId);
|
|
}
|
|
|
|
return result;
|
|
}, []);
|
|
}
|
|
|
|
export default getSelectedIds;
|