| 188 | } |
| 189 | |
| 190 | const makeLists = (names?: Array<string>) => { |
| 191 | const entries = Object.entries(outdatedDeps).filter( |
| 192 | ([n]) => !names || names.includes(n), |
| 193 | ) |
| 194 | const wantedList = entries.map(([name, info]) => ({ |
| 195 | name, |
| 196 | target: info.wanted, |
| 197 | })) |
| 198 | const latestList = entries.map(([name, info]) => ({ |
| 199 | name, |
| 200 | target: info.latest, |
| 201 | })) |
| 202 | return { wantedList, latestList } |
| 203 | } |
| 204 | |
| 205 | const BulkActions = ({ names }: { names?: Array<string> }) => { |
| 206 | const { wantedList, latestList } = makeLists(names) |