1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | class ReflectionGroup {
|
4 | constructor(title, kind) {
|
5 | this.children = [];
|
6 | this.title = title;
|
7 | this.kind = kind;
|
8 | this.allChildrenHaveOwnDocument = (() => this.getAllChildrenHaveOwnDocument());
|
9 | }
|
10 | getAllChildrenHaveOwnDocument() {
|
11 | let onlyOwnDocuments = true;
|
12 | this.children.forEach((child) => {
|
13 | onlyOwnDocuments = onlyOwnDocuments && !!child.hasOwnDocument;
|
14 | });
|
15 | return onlyOwnDocuments;
|
16 | }
|
17 | toObject() {
|
18 | const result = {
|
19 | title: this.title,
|
20 | kind: this.kind
|
21 | };
|
22 | if (this.children) {
|
23 | const children = [];
|
24 | this.children.forEach((child) => {
|
25 | children.push(child.id);
|
26 | });
|
27 | result['children'] = children;
|
28 | }
|
29 | if (this.categories) {
|
30 | const categories = [];
|
31 | this.categories.forEach((category) => {
|
32 | categories.push(category.toObject());
|
33 | });
|
34 | result['categories'] = categories;
|
35 | }
|
36 | return result;
|
37 | }
|
38 | }
|
39 | exports.ReflectionGroup = ReflectionGroup;
|
40 |
|
\ | No newline at end of file |