Skip to content

Instantly share code, notes, and snippets.

@meepoSenpai
Created January 28, 2015 20:30
Show Gist options
  • Save meepoSenpai/950c5a27e792561658fd to your computer and use it in GitHub Desktop.
Save meepoSenpai/950c5a27e792561658fd to your computer and use it in GitHub Desktop.
JS Maximize
min_js = open('min.js', 'r')
max_js = open('max.js', 'w')
min_js_str = min_js.read()
indent_counter = 0
help_string = ""
for character in min_js_str:
if character == '{':
help_string += "{\n" + " " * (indent_counter + 1)
indent_counter += 1
elif character == ';':
help_string += "; \n" + " " * indent_counter
elif character == "}":
indent_counter -= 1
help_string += "\n}\n" + " " * indent_counter
else:
help_string += character
max_js.write(help_string)
max_js.close()
min_js.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment