File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 11import { Node , SyntaxKind } from "ts-morph" ;
22import { parseDocComment } from "./parse-doc-comment.ts" ;
33
4+ /** `docs` returns a list of unique JSDoc comments that are closest to the node. */
45export function docs ( node : Node ) : string [ ] {
5- return [
6- // List of unique JSDoc comments that are closest to the node.
7- ...new Set ( nodesWithDocs ( node ) . flatMap ( ( node ) => lastDoc ( node ) ?? [ ] ) ) ,
8- ] ;
6+ return [ ...new Set ( nodesWithDocs ( node ) . flatMap ( ( node ) => lastDoc ( node ) ?? [ ] ) ) ] ;
97}
108
119function nodesWithDocs ( node : Node ) : Node [ ] {
Original file line number Diff line number Diff line change @@ -11,10 +11,14 @@ export function exportEqualsDeclarations(
1111) : FoundDeclaration [ ] {
1212 // Shorthand ambient modules have no body and thus no declarations.
1313 if ( isShorthandAmbientModule ( container ) ) return [ ] ;
14+
15+ // Get the identifier from the export equals assignment (e.g., `export = foo`).
1416 const exportIdentifier = container
1517 . getExportAssignment ( ( assignment ) => assignment . isExportEquals ( ) )
1618 ?. getLastChildByKind ( SyntaxKind . Identifier ) ;
1719 if ( ! exportIdentifier ) return [ ] ;
20+
21+ // Get the declarations linked to the exported identifier.
1822 const exportName = exportIdentifier . getText ( ) ;
1923 const exportEqualsDeclarations = [ ] ;
2024 for ( const declaration of exportIdentifier . getDefinitionNodes ( ) ) {
You can’t perform that action at this time.
0 commit comments