mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
dev
This commit is contained in:
@@ -28,14 +28,21 @@ export class JavaScriptObfuscator {
|
||||
|
||||
obfuscator.obfuscateNode(astTree);
|
||||
|
||||
return JavaScriptObfuscator.generateCode(astTree);
|
||||
return JavaScriptObfuscator.generateCode(astTree, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param astTree
|
||||
* @param options
|
||||
*/
|
||||
private static generateCode (astTree: any): string {
|
||||
return escodegen.generate(astTree, JavaScriptObfuscator.escodegenParams);
|
||||
private static generateCode (astTree: any, options: any): string {
|
||||
let escodegenParams: any = Object.assign({}, JavaScriptObfuscator.escodegenParams);
|
||||
|
||||
if (options.compact !== undefined) {
|
||||
escodegenParams.format.compact = options.compact;
|
||||
}
|
||||
|
||||
return escodegen.generate(astTree, escodegenParams);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user