I have a specific requirement that I have partially achieved using Java, but now I need to transition it to TypeScript on the client side.
Please note: The input provided below is for illustrative purposes and may vary dynamically.
Input:
var input = ["a.name", "a.type", "b.city.name" , "b.city.zip", "b.desc","c"];
We are looking to develop a utility function that takes the input above and generates output as shown below:
Output:
The output should be a string, not an object or any other data type.
"{ a { name, type }, b { city {name, zip } , desc }, c }"
Any assistance with this would be greatly appreciated.