Add conditional operator before checking length (#16180)

* add optional op to sections

* remove check for undefined
This commit is contained in:
Barbara Valdez
2021-07-16 11:38:18 -07:00
committed by GitHub
parent 669623a228
commit 6df69f525c

View File

@@ -30,7 +30,7 @@ export interface quickPickResults {
const allowedFileExtensions: string[] = [FileExtension.Markdown, FileExtension.Notebook];
export function hasSections(node: JupyterBookSection): boolean {
return node.sections !== undefined && node.sections.length > 0;
return node.sections?.length > 0;
}
export class BookTocManager implements IBookTocManager {