Fix Uncalled Function (#19819)

This commit is contained in:
Chris LaFreniere
2022-06-23 17:14:39 -07:00
committed by GitHub
parent 1b1117f07d
commit 4f2a430c77

View File

@@ -58,7 +58,6 @@ export class BookTocManager implements IBookTocManager {
*/ */
getInitFile(files: string[]): path.ParsedPath | undefined { getInitFile(files: string[]): path.ParsedPath | undefined {
let initFile = undefined; let initFile = undefined;
//
const initFileIndex = files.findIndex(f => f === 'index.md'); const initFileIndex = files.findIndex(f => f === 'index.md');
// If it doesnt find a file named as 'index.md' then use the first file we find. // If it doesnt find a file named as 'index.md' then use the first file we find.
@@ -165,7 +164,7 @@ export class BookTocManager implements IBookTocManager {
contents.forEach(async (content) => { contents.forEach(async (content) => {
let filePath = path.join(directory, content); let filePath = path.join(directory, content);
let fileStat = await fs.stat(filePath); let fileStat = await fs.stat(filePath);
if (fileStat.isFile) { if (fileStat.isFile()) {
//check if the file is in the moved files //check if the file is in the moved files
let newPath = this.movedFiles.get(filePath); let newPath = this.movedFiles.get(filePath);
if (newPath) { if (newPath) {
@@ -177,7 +176,7 @@ export class BookTocManager implements IBookTocManager {
await fs.unlink(filePath); await fs.unlink(filePath);
} }
} }
} else if (fileStat.isDirectory) { } else if (fileStat.isDirectory()) {
await this.cleanUp(filePath); await this.cleanUp(filePath);
} }
}); });