mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
source map support: refactoring
This commit is contained in:
@@ -12,13 +12,6 @@ import { JavaScriptObfuscator } from "../JavaScriptObfuscator";
|
||||
import { Utils } from "../Utils";
|
||||
|
||||
export class JavaScriptObfuscatorCLI {
|
||||
/**
|
||||
* @type {string[]}
|
||||
*/
|
||||
private static availableInputExtensions: string[] = [
|
||||
'.js'
|
||||
];
|
||||
|
||||
/**
|
||||
* @type {string[]}
|
||||
*/
|
||||
@@ -94,7 +87,7 @@ export class JavaScriptObfuscatorCLI {
|
||||
return;
|
||||
}
|
||||
|
||||
this.inputPath = CLIUtils.getInputPath(this.arguments, JavaScriptObfuscatorCLI.availableInputExtensions);
|
||||
this.inputPath = CLIUtils.getInputPath(this.arguments);
|
||||
|
||||
this.getData();
|
||||
this.processData();
|
||||
@@ -195,6 +188,9 @@ export class JavaScriptObfuscatorCLI {
|
||||
obfuscationResult = JavaScriptObfuscator.obfuscateWithSourceMap(this.data, options, sourceMapUrl);
|
||||
|
||||
CLIUtils.writeFile(outputCodePath, obfuscationResult.obfuscatedCode);
|
||||
CLIUtils.writeFile(outputSourceMapPath, obfuscationResult.sourceMap);
|
||||
|
||||
if (obfuscationResult.sourceMap) {
|
||||
CLIUtils.writeFile(outputSourceMapPath, obfuscationResult.sourceMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user