@jsdocs-io/extractor
Version:
Analyze and extract the API from npm packages
14 lines (12 loc) • 362 B
text/typescript
import * as tsm from 'ts-morph';
export function getOverview({
indexFile,
}: {
indexFile: tsm.SourceFile;
}): string | undefined {
return indexFile
.getDescendantsOfKind(tsm.SyntaxKind.JSDocTag)
.find((tag) => tag.getTagName() === 'packageDocumentation')
?.getParentIfKind(tsm.SyntaxKind.JSDocComment)
?.getText();
}