Skip to content

Commit

Permalink
fix(ngdoc): use useCaseSensitiveFileNames to normalize filePath
Browse files Browse the repository at this point in the history
  • Loading branch information
why520crazy committed Mar 8, 2022
1 parent adccbf0 commit c0ea534
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/ngdoc/src/ng-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ export class NgDocParser {
debug(`fileGlobs: ${fileGlobs}, filePaths: ${filePaths.length}`, 'ng-parser');
const sourceFiles = filePaths
.map(filePath => {
const sourceFile = this.ngParserHost.program.getSourceFileByPath(filePath.toLowerCase() as ts.Path);
const finalPath = ts.sys.useCaseSensitiveFileNames ? filePath : filePath.toLowerCase();
const sourceFile = this.ngParserHost.program.getSourceFileByPath(finalPath as ts.Path);
if (!sourceFile) {
debug(`sourceFile is null by ${filePath.toLowerCase()}`, 'ng-parser');
debug(`getSourceFileByPath(${finalPath}) is null, origin: ${filePath}`, 'ng-parser');
}
return sourceFile;
})
Expand Down

0 comments on commit c0ea534

Please sign in to comment.