That's not a solution because you manually turned the input into a valid TS array. You also manually turned the method names into strings, and they aren't in the input... that's part of the fun :)
To have parity with the original article, now do it without recursion / bounded stack depth because you're worried that your data might blow out the stack.
I thought about it, but it's just so unmotivated in this case. URLs would have to be hundreds of path segments long.