Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
const targetReflections: {[uid: string]: TargetReflection | undefined} = {};
const targets = this.target.transitiveDeps();
for (let i = 0; i < targets.length; i += 1) {
const target = targets[i];
const indexPath = path.resolve(target.baseDir, "index.ts");
const targetInfo = this.fileTargetMap[indexPath];
if (targetInfo) {
delete this.fileTargetMap[indexPath];
targetReflections[target.uid] = targetInfo;
const targetReflection = targetInfo.reflection as ContainerReflection;
targetReflection.name = target.project.name;
targetReflection.kind = typedoc.ReflectionKind.Module;
const readmePath = path.join(target.project.baseDir, target.project.build.readme || "README.md");
if (fs.existsSync(readmePath)) {
const readme = fs.readFileSync(readmePath);
targetReflection.comment = new Comment("", readme.toString());
}
}
}
const rootInfo = targetReflections[this.target.uid]!;
const rootTarget = rootInfo.target;
const rootReflection = rootInfo.reflection as ContainerReflection;
for (const fileName in this.fileTargetMap) {
// lift file reflections into library reflection
const fileInfo = this.fileTargetMap[fileName]!;
private parseMethods(reflection: Typedoc.DeclarationReflection): MethodContext[] {
const methodReflections = reflection.getChildrenByKind(Typedoc.ReflectionKind.Method);
const methods = methodReflections.map((m) => this.parseMethod(m))
.filter((m) => !m.source.includes('/node_modules/'))
.sort((a, b) => a.line - b.line);
return methods;
}
private parseProperties(reflection: Typedoc.DeclarationReflection): PropertyContext[] {
const propsReflections = reflection.getChildrenByKind(Typedoc.ReflectionKind.Property);
return propsReflections.map((propReflection) => ({
name: propReflection.name,
type: propReflection.type.toString()
}));
}
}
}
const targetReflections: {[uid: string]: TargetReflection | undefined} = {};
const targets = this.target.transitiveDeps();
for (let i = 0; i < targets.length; i += 1) {
const target = targets[i];
const indexPath = path.resolve(target.baseDir, "index.ts");
const targetInfo = this.fileTargetMap[indexPath];
if (targetInfo) {
delete this.fileTargetMap[indexPath];
targetReflections[target.uid] = targetInfo;
const targetReflection = targetInfo.reflection as typedoc.ContainerReflection;
targetReflection.name = target.project.name;
targetReflection.kind = typedoc.ReflectionKind.Module;
const readmePath = path.join(target.project.baseDir, target.project.readme || "README.md");
if (fs.existsSync(readmePath)) {
const readme = fs.readFileSync(readmePath);
targetReflection.comment = new Comment("", readme.toString());
}
}
}
const rootInfo = targetReflections[this.target.uid]!;
const rootTarget = rootInfo.target;
const rootReflection = rootInfo.reflection as typedoc.ContainerReflection;
const rootReadmePath = path.join(this.target.project.baseDir, this.target.project.readme || "README.md");
if (fs.existsSync(rootReadmePath)) {
const readme = fs.readFileSync(rootReadmePath);