Last active
August 29, 2015 14:02
-
-
Save MiguelCastillo/b945ceb0ca99c23b71ec to your computer and use it in GitHub Desktop.
Regex to test if function is minified and if its big enough that it's hard enough to read that you can just skip...
This file contains hidden or 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
| // Heuristic to guess if code is minified. | |
| // http://regex101.com/r/oE3nP0 | |
| if ( /function[ ]?\w*\([\w,]*\)\{(?:\S[ ]?){1000,}\}/g.test(text) ) { | |
| return; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment