(code)
| 1399 | } |
| 1400 | |
| 1401 | function condenseNewlines (code) { |
| 1402 | // Replace multiple newlines, possibly with whitespace in the middle, with single newlines |
| 1403 | // Only do this in between lines of code, not comments |
| 1404 | return code.replace(/([^\n])\n[ \t]*\n([^\n])/g, '$1\n$2') |
| 1405 | } |
| 1406 | |
| 1407 | function removeStandaloneExpressions (code) { |
| 1408 | code = code.replace(/^ *'[^']*';? *$/gm, '') // Strip out string literals on their own line, we don't need to preserve those |