Here is a string that needs parsing:
const str = 'map("a")to("b");map("foo")to("bar");map("alpha")to("beta");'
The goal is to generate a JSON structure like this:
[{id: 'a', map: 'b'},
{id: 'foo', map: 'bar'},
{id: 'alpha', map: 'beta'}]
I am considering using regex for this task, but also exploring if there are any useful libraries available for this purpose.