14 lines
358 B
TypeScript
14 lines
358 B
TypeScript
|
const toAnvilOverviewHostList = (
|
||
|
data: APIAnvilOverviewArray[number]['hosts'],
|
||
|
): APIAnvilOverview['hosts'] =>
|
||
|
data.reduce<APIAnvilOverview['hosts']>(
|
||
|
(previous, { hostName: name, hostType: type, hostUUID: uuid }) => {
|
||
|
previous[uuid] = { name, type, uuid };
|
||
|
|
||
|
return previous;
|
||
|
},
|
||
|
{},
|
||
|
);
|
||
|
|
||
|
export default toAnvilOverviewHostList;
|