UNPKG

1.09 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3class SourceDirectory {
4 constructor(name, parent) {
5 this.directories = {};
6 this.files = [];
7 if (name && parent) {
8 this.name = name;
9 this.dirName = (parent.dirName ? parent.dirName + '/' : '') + name;
10 this.parent = parent;
11 }
12 }
13 toString(indent = '') {
14 let res = indent + this.name;
15 for (let key in this.directories) {
16 if (!this.directories.hasOwnProperty(key)) {
17 continue;
18 }
19 res += '\n' + this.directories[key].toString(indent + ' ');
20 }
21 this.files.forEach((file) => {
22 res += '\n' + indent + ' ' + file.fileName;
23 });
24 return res;
25 }
26 getAllReflections() {
27 const reflections = [];
28 this.files.forEach((file) => {
29 reflections.push.apply(reflections, file.reflections);
30 });
31 return reflections;
32 }
33}
34exports.SourceDirectory = SourceDirectory;
35//# sourceMappingURL=directory.js.map
\No newline at end of file