From 0a98d914cbe7d812ef8ece6318b6be0ffbba6f5b Mon Sep 17 00:00:00 2001 From: WHenderson Date: Sun, 27 Mar 2022 11:28:40 +1100 Subject: [PATCH] replace `.replace` usage with `path.normalize` --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index df6fc08..34cba26 100644 --- a/src/index.ts +++ b/src/index.ts @@ -223,9 +223,9 @@ function findSymbolSourceFile(symbol: TSSymbol, project: ProjectReflection) { const sources = srcMapConverter.toObject().sources as string[] for (const source of sources) { - const srcFileName = path.resolve(srcDirPath, source).replace(/\\/g, '/') + const srcFileName = path.normalize(path.resolve(srcDirPath, source)) - const srcFile = project.files.find(({ fullFileName }) => fullFileName.replace(/\\/g, '/') === srcFileName) + const srcFile = project.files.find(({ fullFileName }) => path.normalize(fullFileName) === srcFileName) if (!srcFile) continue return srcFile