Looking for a solution to convert synchronous JavaScript function calls into asynchronous ones? Here's the scenario:
If you have a code snippet like this:
someSyncFunction();
console.log("function complete")
You want it converted to:
someAsyncFunction(function () {console.log("function complete")} );
Your task is to accomplish this transformation using regex or do you need to write a parser? In case of needing a parser, any recommendations on libraries that can assist?
To add another layer of complexity, there's also recursion/nesting to deal with, such as:
someSyncFunction();
console.log("first function complete");
someSyncFunction();
console.log("second function complete");
...