Created
January 28, 2015 20:30
-
-
Save meepoSenpai/950c5a27e792561658fd to your computer and use it in GitHub Desktop.
JS Maximize
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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