codePreviews: use lastIndexOf for file type
This commit is contained in:
parent
7abd01a125
commit
68ccd5ff98
1 changed files with 2 additions and 2 deletions
|
@ -31,9 +31,9 @@ async function processFile(link) {
|
|||
link.indexOf("#") == -1 ? link.length : link.indexOf("#")
|
||||
);
|
||||
const fileType =
|
||||
fileName.indexOf(".") == -1
|
||||
fileName.lastIndexOf(".") == -1
|
||||
? ""
|
||||
: fileName.substring(fileName.indexOf(".") + 1);
|
||||
: fileName.substring(fileName.lastIndexOf(".") + 1);
|
||||
|
||||
const lineStr = link.match(/#L\d+(-L?\d+)?/)?.[0];
|
||||
let startLine, endLine;
|
||||
|
|
Loading…
Reference in a new issue