Skip to content

Commit ab271b5

Browse files
committed
refactor: update exportedDeclarations
1 parent c30a473 commit ab271b5

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/exported-declarations.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
1-
import type { ExportedDeclarations, ModuleDeclaration, SourceFile } from "ts-morph";
1+
import type { ModuleDeclaration, SourceFile } from "ts-morph";
22
import { isExportedDeclarations } from "./is-exported-declarations.ts";
33
import { isHidden } from "./is-hidden.ts";
4-
5-
export type ExportedDeclarationsReturn = {
6-
containerName: string;
7-
exportName: string;
8-
declaration: ExportedDeclarations;
9-
}[];
4+
import type { FoundDeclaration } from "./types.ts";
105

116
export function exportedDeclarations(
127
containerName: string,
138
container: SourceFile | ModuleDeclaration,
14-
): ExportedDeclarationsReturn {
9+
): FoundDeclaration[] {
1510
const exportedDeclarations = [];
1611
for (const [exportName, declarations] of container.getExportedDeclarations()) {
1712
for (const declaration of declarations) {
18-
if (isHidden(declaration) || !isExportedDeclarations(declaration)) {
19-
continue;
20-
}
13+
if (!isExportedDeclarations(declaration)) continue;
14+
if (isHidden(declaration)) continue;
2115
exportedDeclarations.push({ containerName, exportName, declaration });
2216
}
2317
}

0 commit comments

Comments
 (0)