diff --git a/src/containers/transform/MarkdownTreeProcessor.ts b/src/containers/transform/MarkdownTreeProcessor.ts index e5ba87c5..b61408dc 100644 --- a/src/containers/transform/MarkdownTreeProcessor.ts +++ b/src/containers/transform/MarkdownTreeProcessor.ts @@ -1,12 +1,12 @@ -import {FileContentService} from '../../utils/FileContentService'; -import {TreeItem} from '../../model/TreeItem'; -import {DirectoryScanner, RESERVED_NAMES} from './DirectoryScanner'; -import {MimeTypes} from '../../model/GoogleFile'; -import {FileId} from '../../model/model'; +import { FileContentService } from '../../utils/FileContentService'; +import { TreeItem } from '../../model/TreeItem'; +import { DirectoryScanner, RESERVED_NAMES } from './DirectoryScanner'; +import { MimeTypes } from '../../model/GoogleFile'; +import { FileId } from '../../model/model'; type CallBack = (treeItem: K) => boolean; -export type TreeItemTuple = [ TreeItem?, string? ]; +export type TreeItemTuple = [TreeItem?, string?]; export class MarkdownTreeProcessor { private driveTree: TreeItem[] = []; @@ -91,7 +91,7 @@ export class MarkdownTreeProcessor { for (const file of children) { const part = file['realFileName']; if (callBack(file)) { - return [ file, curPath ? curPath + '/' + part : part ]; + return [file, curPath ? curPath + '/' + part : part]; } } @@ -142,6 +142,6 @@ export class MarkdownTreeProcessor { return null; } - return this.driveTree[0]['wikigdrive']; + return this.driveTree[0]['wikigdrive'] || null; } }