Fixed wrong name of obfuscated files when input directory path is the . symbol

https://github.com/javascript-obfuscator/javascript-obfuscator/issues/816
This commit is contained in:
sanex
2020-11-20 10:21:11 +03:00
parent 1409c02f45
commit 576c50e755
7 changed files with 67 additions and 5 deletions
+5 -1
View File
@@ -60,7 +60,11 @@ export class ObfuscatedCodeWriter {
if (isDirectoryRawInputPath) {
if (isDirectoryRawOutputPath) {
const baseOutputPath: string = normalizedFilePath.replace(this.inputPath, '');
const parsedNormalizedFilePath: path.ParsedPath = path.parse(normalizedFilePath);
const baseOutputPath: string = path.join(
parsedNormalizedFilePath.dir.replace(this.inputPath, ''),
parsedNormalizedFilePath.base
);
return path.join(normalizedRawOutputPath, baseOutputPath);
} else {