I am working on a problem where I need to ensure whether a particular argument is present in calls to console.log
throughout in my code base. Simply speaking the main objective would be add that argument if not present.
In my initial approach, I am extracting the list of parameters to console.log(...)
and thinking of making it into any array somehow (I am not sure how. I wish to make it reliable enough like closing braces, commas can be inside a string as a parameter to function etc.).
A complex instance would be
console.log("this is a string,another()",'single \'quote\'',param1, param['key'+some_variable]);
So any approach or suggestion to help me going.