Imagine this structure:
[
{
name: "Tailor",
text: "any string",
}, {
name: "Avi",
text: "any string",
}, {
name: "Yehoshua",
text: "any string",
}
]
Now, there's a function that takes that data and converts it into the following structure:
{
Tailor: "the `text`",
Avi: "the `text`",
Yehoshua: "the `text`",
}
How would you implement this using generics in order to preserve the type?