Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
buildUrls(reflection: DeclarationReflection, urls: UrlMapping[]): UrlMapping[] {
const mapping = MarkdownTheme.getMapping(reflection);
if (mapping) {
if (!reflection.url || !MarkdownTheme.URL_PREFIX.test(reflection.url)) {
const url = this.toUrl(mapping, reflection);
urls.push(new UrlMapping(url, reflection, mapping.template));
reflection.url = url;
reflection.hasOwnDocument = true;
}
for (const child of reflection.children || []) {
if (mapping.isLeaf) {
this.applyAnchorUrl(child, reflection);
} else {
this.buildUrls(child, urls);
}
}
} else if (reflection.parent) {
this.applyAnchorUrl(reflection, reflection.parent);
}
return urls;
}
getUrls(project) {
const urls = [];
const entryPoint = this.getEntryPoint(project);
const url = this.indexName + this.fileExt;
entryPoint.url = url;
urls.push(
this.application.options.getValue('readme') === 'none'
? new UrlMapping(url, entryPoint, 'reflection.hbs')
: new UrlMapping(url, project, 'index.hbs')
);
if (entryPoint.children) {
entryPoint.children.forEach(child => {
if (child instanceof DeclarationReflection) {
this.buildUrls(child, urls);
}
});
}
return urls;
}
};
getUrls(project: ProjectReflection): UrlMapping[] {
const urls: UrlMapping[] = [];
const entryPoint = this.getEntryPoint(project);
if (this.application.options.getValue('readme') === 'none') {
entryPoint.url = this.indexName + this.fileExt;
urls.push(new UrlMapping(this.indexName + this.fileExt, entryPoint, 'reflection.hbs'));
} else {
entryPoint.url = 'globals' + this.fileExt;
urls.push(new UrlMapping('globals' + this.fileExt, entryPoint, 'reflection.hbs'));
urls.push(new UrlMapping(this.indexName + this.fileExt, project, 'index.hbs'));
}
if (entryPoint.children) {
entryPoint.children.forEach((child: Reflection) => {
if (child instanceof DeclarationReflection) {
this.buildUrls(child, urls);
}
});
}
return urls;
}
getUrls(project: ProjectReflection): UrlMapping[] {
const urls: UrlMapping[] = [];
const entryPoint = this.getEntryPoint(project);
if (this.application.options.getValue('readme') === 'none') {
entryPoint.url = this.indexName + this.fileExt;
urls.push(new UrlMapping(this.indexName + this.fileExt, entryPoint, 'reflection.hbs'));
} else {
entryPoint.url = 'globals' + this.fileExt;
urls.push(new UrlMapping('globals' + this.fileExt, entryPoint, 'reflection.hbs'));
urls.push(new UrlMapping(this.indexName + this.fileExt, project, 'index.hbs'));
}
if (entryPoint.children) {
entryPoint.children.forEach((child: Reflection) => {
if (child instanceof DeclarationReflection) {
this.buildUrls(child, urls);
}
});
}
return urls;
}
getUrls(project) {
const urls = [];
const entryPoint = this.getEntryPoint(project);
const url = this.indexName + this.fileExt;
entryPoint.url = url;
urls.push(
this.application.options.getValue('readme') === 'none'
? new UrlMapping(url, entryPoint, 'reflection.hbs')
: new UrlMapping(url, project, 'index.hbs')
);
if (entryPoint.children) {
entryPoint.children.forEach(child => {
if (child instanceof DeclarationReflection) {
this.buildUrls(child, urls);
}
});
}
return urls;
}
};