mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2979] Updated doc tools to avoid erasing MD docs with blank JSDocs in services (#3347)
* [ADF-2979] Update to ignore blank JSDocs for method signature * [ADF-2979] Finished adding blank JSDoc check for services
This commit is contained in:
committed by
Eugenio Romano
parent
592ad185e7
commit
73bc62ae8f
@@ -26,6 +26,38 @@ export class MDNav {
|
||||
}
|
||||
|
||||
|
||||
findAll(test: (element: any) => boolean = () => true, index: number = 0): MDNav[] {
|
||||
if (!this.root || !this.root.children) {
|
||||
return [];
|
||||
}
|
||||
|
||||
let result = [];
|
||||
|
||||
let currIndex = 0;
|
||||
|
||||
for (let i = this.pos; i < this.root.children.length; i++) {
|
||||
let child = this.root.children[i];
|
||||
|
||||
if (test(child)) {
|
||||
if (currIndex === index) {
|
||||
result.push(new MDNav(this.root, i));
|
||||
} else {
|
||||
currIndex++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
emph(test: (element: any) => boolean = () => true, index: number = 0): MDNav {
|
||||
return this.find((h) => {
|
||||
return h.type === "emphasis" && test(h);
|
||||
}, index);
|
||||
}
|
||||
|
||||
|
||||
heading(test: (element: any) => boolean = () => true, index: number = 0): MDNav {
|
||||
return this.find((h) => {
|
||||
return h.type === "heading" && test(h);
|
||||
@@ -33,16 +65,49 @@ export class MDNav {
|
||||
}
|
||||
|
||||
|
||||
table(test: (element: any) => boolean = () => true, index: number = 0): MDNav {
|
||||
html(test: (element: any) => boolean = () => true, index: number = 0): MDNav {
|
||||
return this.find((h) => {
|
||||
return h.type === "table" && test(h);
|
||||
return h.type === "html" && test(h);
|
||||
}, index);
|
||||
}
|
||||
|
||||
|
||||
text(test: (element: any) => boolean = () => true, index: number = 0): MDNav {
|
||||
list(test: (element: any) => boolean = () => true, index: number = 0): MDNav {
|
||||
return this.find((h) => {
|
||||
return h.type === "text" && test(h);
|
||||
return h.type === "list" && test(h);
|
||||
}, index);
|
||||
}
|
||||
|
||||
|
||||
listItem(test: (element: any) => boolean = () => true, index: number = 0): MDNav {
|
||||
return this.find((h) => {
|
||||
return h.type === "listItem" && test(h);
|
||||
}, index);
|
||||
}
|
||||
|
||||
listItems(test: (element: any) => boolean = () => true, index: number = 0): MDNav[] {
|
||||
return this.findAll((h) => {
|
||||
return h.type === "listItem" && test(h);
|
||||
}, index);
|
||||
}
|
||||
|
||||
paragraph(test: (element: any) => boolean = () => true, index: number = 0): MDNav {
|
||||
return this.find((h) => {
|
||||
return h.type === "paragraph" && test(h);
|
||||
}, index);
|
||||
}
|
||||
|
||||
|
||||
strong(test: (element: any) => boolean = () => true, index: number = 0): MDNav {
|
||||
return this.find((h) => {
|
||||
return h.type === "strong" && test(h);
|
||||
}, index);
|
||||
}
|
||||
|
||||
|
||||
table(test: (element: any) => boolean = () => true, index: number = 0): MDNav {
|
||||
return this.find((h) => {
|
||||
return h.type === "table" && test(h);
|
||||
}, index);
|
||||
}
|
||||
|
||||
@@ -60,6 +125,14 @@ export class MDNav {
|
||||
}, index);
|
||||
}
|
||||
|
||||
|
||||
text(test: (element: any) => boolean = () => true, index: number = 0): MDNav {
|
||||
return this.find((h) => {
|
||||
return h.type === "text" && test(h);
|
||||
}, index);
|
||||
}
|
||||
|
||||
|
||||
get item(): any {
|
||||
if (!this.root || !this.root.children) {
|
||||
return undefined;
|
||||
@@ -75,7 +148,16 @@ export class MDNav {
|
||||
}
|
||||
|
||||
|
||||
get childNav() {
|
||||
get childNav(): MDNav {
|
||||
return new MDNav(this.item);
|
||||
}
|
||||
|
||||
|
||||
get value(): any {
|
||||
if (this.item && this.item["value"]) {
|
||||
return this.item.value;
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user