Guest User

Untitled

a guest
Jan 19th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. def minify_js(js):
  2. """
  3. Basic minification of javascript code.
  4. Assumes no line comments and semi-colon delimited lines
  5. """
  6. return re.sub("[/][*][\s\S]*?[*][/]", "", # remove /**/ comments
  7. js.replace(" ", "").replace("\n", "") # remove 4 spaces and new lines (assume semicolons exist)
  8. )
Add Comment
Please, Sign In to add comment