Below is an example array
const roads = [
"Alice's House-Bob's House",
"Alice's House-Cabin",
"Alice's House-Post Office",
...
];
I'm looking to create a type Graph which should be an object with name:value pairs.
In this scenario, each string in the roads array represents a direction where the text before '-' is the starting point, and the text after is the destination. I envision the type to have a name string as the key and an array of strings as the value.
Here's an example of what I'm aiming for:
{
"Alice's House": [ "Bob's House", 'Cabin', 'Post Office' ],
...
}
Any suggestions?