I'm looking for a tool that unminifies a JS file, while restoring the variable names in the whole document.
For example, after running the minified code at unminify.com, the code itself contains:
W.find("li.patternItem").click(function() {
and at the end of the code there is a reference defining W:
W = $("#pattern1")
So I am looking for a simple script to restore the name inside the code, but can't find one. I understand the auto replace might be harmful for the code, but I guess that there should be some smart way to restore. Right now I'm doing it manually and replacing "W." with "$("#pattern1")." (match case, with dot at the end) so it won't be mixed with any W letter.
Thanks