From 4d4e254ba50a2fd0034173588534bf33e234f2c3 Mon Sep 17 00:00:00 2001 From: mrmlnc Date: Thu, 5 Dec 2019 20:22:47 +0300 Subject: [PATCH] fix(scanner): do not add extra underscore characters --- src/services/scanner.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/services/scanner.ts b/src/services/scanner.ts index 80348b44..e59e21db 100644 --- a/src/services/scanner.ts +++ b/src/services/scanner.ts @@ -67,9 +67,12 @@ export default class ScannerService { private _formatPartialFilepath(filepath: string): string { const original = path.parse(filepath); + const hasUnderscorePrefix = original.base[0] === '_'; + const base = hasUnderscorePrefix ? original.base : `_${original.base}`; + return path.format({ ...original, - base: '_' + original.base + base }); } }