1
0
Fork 0
mirror of https://github.com/seejohnrun/haste-server.git synced 2024-11-01 11:31:22 +00:00
haste-server/node_modules/uglify-js/uglify-js.js

17 lines
666 B
JavaScript
Raw Normal View History

2012-02-06 19:09:01 +00:00
//convienence function(src, [options]);
function uglify(orig_code, options){
options || (options = {});
var jsp = uglify.parser;
var pro = uglify.uglify;
var ast = jsp.parse(orig_code, options.strict_semicolons); // parse code and get the initial AST
ast = pro.ast_mangle(ast, options.mangle_options); // get a new AST with mangled names
ast = pro.ast_squeeze(ast, options.squeeze_options); // get an AST with compression optimizations
var final_code = pro.gen_code(ast, options.gen_options); // compressed code here
return final_code;
};
uglify.parser = require("./lib/parse-js");
uglify.uglify = require("./lib/process");
module.exports = uglify