Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return docs.filter(doc => {
const isPublic = isPublicDoc(doc);
// Update the API document name in case the "@docs-public" tag is used
// with an alias name.
if (isPublic && doc instanceof ApiDoc.BaseApiDoc) {
const docsPublicTag = getDocsPublicTag(doc);
if (docsPublicTag !== undefined && docsPublicTag.description) {
doc.name = docsPublicTag.description;
}
}
// Filter out private class members which could be annotated
// with the "@docs-private" tag.
if (isPublic && doc instanceof ClassExportDoc.ClassExportDoc) {
doc.members = doc.members.filter(memberDoc => isPublicDoc(memberDoc));
}
return isPublic;
});
}