Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

Commit

Permalink
replace .replace usage with path.normalize
Browse files Browse the repository at this point in the history
  • Loading branch information
WHenderson authored and nlepage committed Apr 8, 2022
1 parent c324b9d commit 0a98d91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Expand Up @@ -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
Expand Down

0 comments on commit 0a98d91

Please sign in to comment.